1
0
Fork 0
mirror of https://github.com/DanielnetoDotCom/YouPHPTube synced 2025-10-03 01:39:24 +02:00
Daniel Neto 2024-10-28 10:55:11 -03:00
parent 97a9e25735
commit 986d113beb
3 changed files with 6 additions and 2 deletions

View file

@ -356,7 +356,7 @@ abstract class ObjectYPT implements ObjectInterface
foreach ($fieldsName as $value) {
if (is_string($value) && (strtolower($value) == 'created' || strtolower($value) == 'modified')) {
if (strtolower($value) == 'created') {
if (empty($this->created) || (!User::isAdmin() && !isCommandLineInterface())) {
if (empty($this->created) || (!User::isAdmin() && !isCommandLineInterface() && empty($global['allowModifyCreated']))) {
$fields[] = " now() ";
} else {
$this->created = preg_replace('/[^0-9: \/-]/', '', $this->created);
@ -399,7 +399,7 @@ abstract class ObjectYPT implements ObjectInterface
$sql .= " VALUES (" . implode(", ", $fields) . ")";
}
//error_log("save: $sql [$formats]".json_encode($values));
//var_dump(static::getTableName(), $sql, $values);
//var_dump(static::getTableName(), $sql, $values);exit;
//if(static::getTableName() == 'videos'){ echo $sql;var_dump($values); var_dump(debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS));}//return false;
//echo $sql;var_dump($this, $values, $global['mysqli']->error);exit;
$global['lastQuery'] = array('sql'=>$sql, 'formats'=>$formats, 'values'=>$values );

View file

@ -231,6 +231,7 @@ if (!class_exists('Video')) {
public function setCreated($created): void
{
$this->created = convertToMySQLDate($created);
_error_log("created date set from {$created} to {$this->created}");
}
function getUsers_id_company(): int

View file

@ -82,8 +82,11 @@ if(!BulkEmbed::canBulkEmbed()){
// Set the original video date if available in the form data
if (!empty($value['date']) && $objo->useOriginalYoutubeDate) {
//_error_log("Do save original date");
$global['allowModifyCreated'] = 1;
$videos->setCreated($value['date']); // Set the original creation date of the video
}else{
//_error_log("Do not save original date");
}
$poster = Video::getPathToFile("{$paths['filename']}.jpg");