1
0
Fork 0
mirror of https://github.com/DanielnetoDotCom/YouPHPTube synced 2025-10-03 01:39:24 +02:00

Whitespace cleanup.

This commit is contained in:
Caleb Mazalevskis 2023-02-15 23:12:58 +08:00
parent 89362c403c
commit af0b9a239a
No known key found for this signature in database
GPG key ID: 082E6BC1046FAB95
29 changed files with 166 additions and 177 deletions

View file

@ -42,14 +42,14 @@ class EpgParser {
}
/**
* @param mixed $url - url
* @param mixed $url - url
*/
public function setUrl($url): void {
$this->url = $url;
}
/**
* @param mixed $content = xml parsed string.
* @param mixed $content = xml parsed string.
*/
public function setContent($content): void {
$this->content = $content;
@ -78,7 +78,7 @@ class EpgParser {
/**
* Set group by for channels must be channels atribute.
* @param $group - channel will be grouped with. must be @id or pgram attribute.
* @param $group - channel will be grouped with. must be @id or pgram attribute.
*/
public function setChannelGroup($group) {
$this->channels_groupby = $group;
@ -103,9 +103,9 @@ class EpgParser {
$dt->setTimezone(new DateTimeZone($this->targetTimeZone));
return $dt->format('Y-m-d H:i:s');
} catch (\Exception $e) {
} catch (\Error $e) {
}
try {
@ -113,9 +113,9 @@ class EpgParser {
$dt->setTimezone(new DateTimeZone($this->targetTimeZone));
return $dt->format('Y-m-d H:i:s');
} catch (\Exception $e) {
} catch (\Error $e) {
}
@ -134,9 +134,9 @@ class EpgParser {
$dt->setTimezone(new DateTimeZone($this->targetTimeZone));
return $dt->format('Y-m-d H:i:s');
} catch (\Exception $e) {
} catch (\Error $e) {
}
@ -170,14 +170,14 @@ class EpgParser {
}
/**
*
*
*/
public function resetChannelfilter(): void {
$this->channelfilter = [];
}
/**
*
*
*/
private function channelMatchFilter(string $channel): bool {
return array_key_exists($channel, $this->channelfilter);
@ -197,7 +197,7 @@ class EpgParser {
throw new \RuntimeException('file does not exists: ' . $this->file);
}
//
//
$xml = new XMLReader();
// compress.zlib://'
@ -207,7 +207,7 @@ class EpgParser {
/** @noinspection LoopWhichDoesNotLoopInspection */
/** @noinspection MissingOrEmptyGroupStatementInspection */
while ($xml->read() && $xml->name !== 'channel') {
}
$i = 0;
@ -261,7 +261,7 @@ class EpgParser {
/** @noinspection LoopWhichDoesNotLoopInspection */
/** @noinspection MissingOrEmptyGroupStatementInspection */
while ($xml->read() && $xml->name !== 'programme') {
}
while ($xml->name === 'programme') {
@ -388,5 +388,4 @@ class EpgParser {
throw new \RuntimeException("Content of this request its not XML: $errors");
}
}
}

View file

@ -372,9 +372,9 @@ abstract class ObjectYPT implements ObjectInterface
$insert_row = sqlDAL::writeSql($sql, $formats, $values);
/**
*
*
* @var array $global
* @var object $global['mysqli']
* @var object $global['mysqli']
*/
if ($insert_row) {
if (empty($this->id)) {

View file

@ -69,7 +69,7 @@ if (empty($title) && !empty($_POST['title'])) {
$title = $video->setTitle($_POST['title']);
} elseif (empty($title)) {
$video->setTitle("Automatic Title");
}else{
}else{
_error_log("aVideoEncoder.json: Title not updated {$_POST['title']} ");
}

View file

@ -27,7 +27,7 @@ $total = Category::getTotalCategories(true, $onlyWithVideos);
foreach ($categories as $key => $value) {
$categories[$key]['iconHtml'] = "<span class='$value[iconClass]'></span>";
$categories[$key]['users_groups_ids_array'] = Categories_has_users_groups::getUserGroupsIdsFromCategory($value['id']);
if(empty($categories[$key]['users_groups_ids_array'])){
$categories[$key]['total_users_groups'] = 0;
}else{

View file

@ -182,7 +182,7 @@ class Category {
}
}
/**
*
*
* @param string $clean_title
* @param int $count
* @param int $id
@ -440,11 +440,11 @@ class Category {
//_error_log("getAllCategories id={$row['id']} line=".__LINE__);
$totals = self::getTotalFromCategory($row['id']);
if($onlyWithVideos && empty($totals['total'])){
continue;
}
//_error_log("getAllCategories id={$row['id']} line=".__LINE__);
$fullTotals = self::getTotalFromCategory($row['id'], false, true, true);
@ -988,5 +988,4 @@ class Category {
}
return $return;
}
}

View file

@ -48,7 +48,7 @@ if (!empty($obj->categories_id)) {
$obj->image2 = saveCroppieImage($path['path'], "image2");
$obj->image2P = $path['path'];
_error_log('CategoryAddnew: save image 2 '.$path['path']);
// save usergroups
_error_log('CategoryAddnew: save usergroups '. json_encode($obj->usergroups_ids_array));
Category::setUsergroups($obj->categories_id, $obj->usergroups_ids_array);

View file

@ -29,7 +29,7 @@ class Comment {
$this->load($id);
}
}
public function getPin() {
return $this->pin;
}
@ -37,7 +37,7 @@ class Comment {
public function setPin($pin): void {
$this->pin = intval($pin);
}
public function getId() {
return $this->id;
}
@ -87,7 +87,7 @@ class Comment {
if (empty($this->comments_id_pai)) {
$this->comments_id_pai = 'NULL';
}
$this->pin = intval($this->pin);
if (empty($this->videos_id) && !empty($this->comments_id_pai)) {
@ -375,13 +375,13 @@ class Comment {
return $commentsArray;
}
static function addExtraInfo2($row) {
static function addExtraInfo2($row) {
if(empty($row['commentHTML'])){
$row['comment'] = str_replace('\n', "\n", $row['comment']);
$row['commentPlain'] = xss_esc_back($row['comment']);
$row['commentHTML'] = nl2br($row['commentPlain']);
}
$row['identification'] = User::getNameIdentificationById($row['users_id']);
$row['commentWithLinks'] = self::fixCommentText(textToLink($row['commentHTML']));
$row['humanTiming'] = humanTiming(strtotime($row['created']));
@ -408,5 +408,4 @@ class Comment {
$replace = ["<br/>"];
return stripslashes(str_replace($search, $replace, $subject));
}
}

View file

@ -126,7 +126,7 @@ if (!empty($obj->comments_id)) {
$obj->error = false;
$obj->comment = Comment::getComment($obj->comments_id);
$obj->comment = Comment::addExtraInfo2($obj->comment);
$obj->msg = __("Your comment has been saved!");
} else {
$obj->msg = __("Your comment has NOT been saved!");

View file

@ -29,7 +29,7 @@ if(!empty($obj->status)){
$obj->error = false;
//$obj->comments = Comment::getAllComments($obj->videos_id);
//$obj->comments = Comment::addExtraInfo($obj->comments);
}
die(_json_encode($obj));

View file

@ -31,7 +31,7 @@ $obj->save = $objC->save();
if (!empty($obj->save)) {
$obj->error = false;
$obj->comment = Comment::getComment($obj->comments_id);
$obj->comment = Comment::addExtraInfo2($obj->comment);
$obj->comment = Comment::addExtraInfo2($obj->comment);
if($obj->new_pin_value){
$obj->msg = __("Your comment is pinned");
}else{

View file

@ -36,14 +36,14 @@ $croppieFilesAdded = 1;
var viewportHeight = <?php echo $viewportHeight; ?>;
var boundaryWidth = <?php echo $boundaryWidth; ?>;
var boundaryHeight = <?php echo $boundaryHeight; ?>;
var parentWidth = $('#croppie<?php echo $uid; ?>').parent().width();
var totalWidth = viewportWidth+(boundaryWidth-viewportWidth);
if(parentWidth <= totalWidth){
var factor = (parentWidth/(totalWidth));
console.log('createCroppie parent and factor ', parentWidth, totalWidth, factor, viewportWidth, viewportHeight, boundaryWidth, boundaryHeight);
viewportWidth = parseInt(viewportWidth * factor);
viewportHeight = parseInt(viewportHeight * factor);
boundaryWidth = viewportWidth;
@ -53,20 +53,20 @@ $croppieFilesAdded = 1;
}else{
console.log('createCroppie ', viewportWidth, viewportHeight, boundaryWidth, boundaryHeight);
}
var paddingTop = 25;
var saveButton = 55;
var slider = 25;
var uploadDeleteButtons = 40;
var parentHeight = $('body').height();
var totalHeight = viewportHeight+(boundaryHeight-viewportHeight)+paddingTop+saveButton+slider+uploadDeleteButtons;
if(parentHeight <= totalHeight){
var factor = (parentHeight/(totalHeight));
console.log('createCroppie height parent and factor parentHeight, totalHeight', parentHeight, totalHeight);
console.log('createCroppie height parent and factor factor, viewportWidth, viewportHeight', factor, viewportWidth, viewportHeight);
viewportWidth = parseInt(viewportWidth * factor);
viewportHeight = parseInt(viewportHeight * factor);
boundaryWidth = viewportWidth;
@ -77,7 +77,7 @@ $croppieFilesAdded = 1;
console.log('createCroppie height', parentHeight, totalHeight, viewportHeight, boundaryWidth, boundaryHeight);
}
uploadCrop<?php echo $uid; ?> = $('#croppie<?php echo $uid; ?>').croppie({
//url: imageURL,
//enableExif: true,
@ -112,7 +112,7 @@ $croppieFilesAdded = 1;
<?php
if($enforceBoundary){
?>
$('#croppie<?php echo $uid; ?>').croppie('setZoom', <?php echo $zoom; ?>);
$('#croppie<?php echo $uid; ?>').croppie('setZoom', <?php echo $zoom; ?>);
<?php
}
?>

View file

@ -5,7 +5,7 @@ if ($startActive) {
$svgClass .= ' active';
}
if ($invert) {
if(preg_match('/style=["\']/', $parameters)){
$parameters = str_replace(array('style="','style=\''), array('style="transform: scale(-1,1);', 'style=\'transform: scale(-1,1);'), $parameters );
}else{
@ -28,7 +28,7 @@ if ($invert) {
<path
class="line bottom"
d="m 30,67 h 40 c 12.796276,0 15.357889,-11.717785 15.357889,-26.851538 0,-15.133752 -4.786586,-27.274118 -16.667516,-27.274118 -11.88093,0 -18.499247,6.994427 -18.435284,17.125656 l 0.252538,40" />
</svg>
</svg>
<?php
break;
case '2':
@ -43,7 +43,7 @@ if ($invert) {
<path
class="line bottom"
d="m 70,67 h -40 c -6.5909,0 -7.763966,4.501509 -7.763966,7.511428 0,4.721448 3.376452,9.583771 13.876919,9.583771 14.786182,0 11.409257,-14.896182 9.596449,-21.970818 -1.812808,-7.074636 -15.709402,-12.124381 -15.709402,-12.124381" />
</svg>
</svg>
<?php
break;
case '3':
@ -150,13 +150,9 @@ if ($invert) {
<path
class="line bottom"
d="m 30,67 h 40 c 12.796276,0 15.357889,-11.717785 15.357889,-26.851538 0,-15.133752 -4.786586,-27.274118 -16.667516,-27.274118 -11.88093,0 -18.499247,6.994427 -18.435284,17.125656 l 0.252538,40" />
</svg>
</svg>
<?php
break;
}
?>
</button>

View file

@ -18,7 +18,7 @@ if ($users_id = isChannel()) {
$img = Category::getOGImage($category['id']);
$title = html2plainText($category['name']);
$url = Category::getCategoryLinkFromName($_GET['catName']);
$description = html2plainText($category['description']);
$description = html2plainText($category['description']);
echo PHP_EOL."<!-- OpenGraph not video 1 -->".PHP_EOL; ?>
<meta property="og:type" content="website" />
<meta property="og:site_name" content="<?php echo $title; ?>">
@ -85,4 +85,4 @@ if (!empty($advancedCustom->twitter_summary_large_image)) {
<meta name="twitter:url" content="<?php echo $global['webSiteRootURL']; ?>"/>
<meta name="twitter:title" content="<?php echo $title; ?>"/>
<meta name="twitter:description" content="<?php echo $title; ?>"/>
<meta name="twitter:image" content="<?php echo $img; ?>"/>
<meta name="twitter:image" content="<?php echo $img; ?>"/>

View file

@ -436,7 +436,7 @@ function safeString($text, $strict = false, $try=0){
//$text = cleanURLName($text);
}
$text = trim($text);
if(empty($try) && empty($text)){
return safeString(utf8_encode($originalText), $strict, 1);
}
@ -1433,7 +1433,7 @@ function getVideosURL_V2($fileName, $recreateCache = false)
$cacheName = "getVideosURL_V2$fileName";
if (empty($recreateCache)) {
$lifetime = maxLifetime();
$TimeLog1 = "getVideosURL_V2($fileName) empty recreateCache";
@ -1496,7 +1496,7 @@ function getVideosURL_V2($fileName, $recreateCache = false)
$isAVideo = false;
foreach ($filesInDir as $file) {
$parts = pathinfo($file);
if($parts['extension'] == 'log'){
continue;
}
@ -1555,7 +1555,7 @@ function getVideosURL_V2($fileName, $recreateCache = false)
$files[$key] = AVideoPlugin::modifyURL($_file);
}
TimeLogEnd($timeName, __LINE__);
$pdf = $paths['path'] . "{$cleanfilename}.pdf";
$mp3 = $paths['path'] . "{$cleanfilename}.mp3";
@ -1577,7 +1577,7 @@ function getVideosURL_V2($fileName, $recreateCache = false)
$extraFiles = array_merge($extraFiles, $extraFilesMP3);
}
$files = array_merge($extraFiles, $files);
ObjectYPT::setCache($cacheName, $files);
}
if (is_array($files)) {
@ -2004,7 +2004,7 @@ function scaleUpImage($file_src, $file_dest, $wd, $hd)
echo '<h1>Results</h1>';
var_dump($sizes);exit;
}
*
*
*/
$thumb_w = $sizes['w'];
$thumb_h = $sizes['h'];
@ -4704,9 +4704,9 @@ function _mysql_commit(){
if (_mysql_is_open()) {
try {
/**
*
*
* @var array $global
* @var object $global['mysqli']
* @var object $global['mysqli']
*/
@$global['mysqli']->commit();
} catch (Exception $exc) {
@ -4723,9 +4723,9 @@ function _mysql_close()
$mysql_connect_was_closed = 1;
try {
/**
*
*
* @var array $global
* @var object $global['mysqli']
* @var object $global['mysqli']
*/
@$global['mysqli']->close();
} catch (Exception $exc) {
@ -4968,7 +4968,7 @@ function getUsageFromFilename($filename, $dir = "")
* @param $url - The location of the remote file to download. Cannot
* be null or empty.
*
* @return int
* @return int
* return The size of the file referenced by $url, or false if the size
* could not be determined.
*/
@ -5796,14 +5796,14 @@ function isValidEmail($email) {
if(!isset($_email_hosts_checked)){
$_email_hosts_checked = array();
}
//Get host name from email and check if it is valid
$email_host = array_slice(explode("@", $email), -1)[0];
if(isset($_email_hosts_checked[$email_host])){
return $_email_hosts_checked[$email_host];
}
$_email_hosts_checked[$email_host] = true;
// Check if valid IP (v4 or v6). If it is we can't do a DNS lookup
if (!filter_var($email_host, FILTER_VALIDATE_IP, [
@ -9408,9 +9408,9 @@ function mysqlBeginTransaction()
global $global;
_error_log('Begin transaction ' . getSelfURI());
/**
*
*
* @var array $global
* @var object $global['mysqli']
* @var object $global['mysqli']
*/
$global['mysqli']->autocommit(false);
}
@ -9420,9 +9420,9 @@ function mysqlRollback()
global $global;
_error_log('Rollback transaction ' . getSelfURI(), AVideoLog::$ERROR);
/**
*
*
* @var array $global
* @var object $global['mysqli']
* @var object $global['mysqli']
*/
$global['mysqli']->rollback();
$global['mysqli']->autocommit(true);
@ -9433,9 +9433,9 @@ function mysqlCommit()
global $global;
_error_log('Commit transaction ' . getSelfURI());
/**
*
*
* @var array $global
* @var object $global['mysqli']
* @var object $global['mysqli']
*/
$global['mysqli']->commit();
$global['mysqli']->autocommit(true);
@ -10087,9 +10087,9 @@ function getValidCrontabLines()
}
/**
*
* @param string $strOrArray
* @return string return an array with the valid emails.
*
* @param string $strOrArray
* @return string return an array with the valid emails.
*/
function is_email($strOrArray)
{
@ -10510,7 +10510,7 @@ function getFeedButton($rss, $mrss, $roku)
{
$buttons = '<div class="dropdown feedDropdown" style="display: inline-block;" data-toggle="tooltip" title="' . __("Feed") . '">
<button class="btn btn-default btn-xs dropdown-toggle" type="button" data-toggle="dropdown">
<i class="fas fa-rss-square"></i>
<i class="fas fa-rss-square"></i>
<span class="hidden-xs hidden-sm">' . __("Feed") . '</span>
<span class="caret"></span>
</button>
@ -10598,4 +10598,4 @@ function setIsConfirmationPage(){
function isConfirmationPage(){
global $_isConfirmationPage;
return !empty($_isConfirmationPage);
}
}

View file

@ -7,7 +7,7 @@ if (!empty($doNotIncludeConfig)) {
if($_SERVER["HTTP_HOST"] === 'localhost' || $_SERVER["HTTP_HOST"] === '127.0.0.1'){
$global["webSiteRootURL"] = $_SERVER["REQUEST_SCHEME"].'://'.$_SERVER["HTTP_HOST"].$global["webSiteRootPath"];
}
*
*
*/
//if(!empty($global['debugMemmory'])){return false;}
//if(!empty($global['debugMemmory'])){var_dump(__LINE__);exit;}

View file

@ -19,11 +19,10 @@ if(preg_match('/^@/', $_REQUEST['term'])){
foreach ($users as $key => $value) {
$response[] = array(
'id'=>$value['id'],
'value'=>$value['identification'],
'value'=>$value['identification'],
'label'=>Video::getCreatorHTML($value['id'], '', true, true)
);
}
}
echo json_encode($response);

View file

@ -1,5 +1,4 @@
<?php
/*
tester-execution-code
$sql = "SELECT * FROM users WHERE id=?;";
@ -20,9 +19,9 @@
*/
/**
*
*
* @var array $global
* @var object $global['mysqli']
* @var object $global['mysqli']
*/
class iimysqli_result
@ -65,9 +64,9 @@ class sqlDAL
// Perform the query
/**
*
*
* @var array $global
* @var object $global['mysqli']
* @var object $global['mysqli']
*/
if (!$global['mysqli']->query($templine)) {
_error_log('sqlDAL::executeFile ' . $filename . ' Error performing query \'<strong>' . $templine . '\': ' . $global['mysqli']->error . '<br /><br />', AVideoLog::$ERROR);
@ -117,9 +116,9 @@ class sqlDAL
}
/**
*
*
* @var array $global
* @var object $global['mysqli']
* @var object $global['mysqli']
*/
if (!($stmt = $global['mysqli']->prepare($preparedStatement))) {
log_error("[sqlDAL::writeSql] Prepare failed: (" . $global['mysqli']->errno . ") " . $global['mysqli']->error .
@ -151,7 +150,7 @@ class sqlDAL
_mysql_connect();
return self::writeSql($preparedStatement, $formats, $values);
}
*
*
*/
$stmt->close();
@ -203,9 +202,9 @@ class sqlDAL
// When not cached
/**
*
*
* @var array $global
* @var object $global['mysqli']
* @var object $global['mysqli']
*/
$readSqlCached[$crc] = "false";
_mysql_connect();
@ -290,9 +289,9 @@ class sqlDAL
// Mysqlnd-fallback
/**
*
*
* @var array $global
* @var object $global['mysqli']
* @var object $global['mysqli']
*/
if (!($stmt = $global['mysqli']->prepare($preparedStatement))) {
log_error("[sqlDAL::readSql] (no mysqlnd) Prepare failed: (" . $global['mysqli']->errno . ") " . $global['mysqli']->error . " ({$preparedStatement})");

View file

@ -350,12 +350,12 @@ class PlayList extends ObjectYPT {
_session_start();
unset($_SESSION['user']['sessionCache']['getAllFromUserVideo'][$videos_id]);
}
public static function getSuggested() {
global $global;
return Video::getAllVideosLight("viewableNotUnlisted", false, false, true, 'serie');
}
public static function getVideosIDFromPlaylistLight($playlists_id) {
@ -384,7 +384,7 @@ class PlayList extends ObjectYPT {
foreach ($fullData as $key => $row) {
if (empty($playlists_id)) {
$row['order'] = $key;
}
}
$rows[] = $row;
}
} else {
@ -744,7 +744,7 @@ class PlayList extends ObjectYPT {
public function getName() {
return $this->name;
}
public function getNameOrSerieTitle() {
return PlayLists::getNameOrSerieTitle($this->id);
}
@ -865,5 +865,4 @@ class PlayList extends ObjectYPT {
}
return false;
}
}

View file

@ -61,7 +61,7 @@ foreach ($scanVars as $value) {
}
}
}
foreach ($securityRemoveNonCharsStrict as $value) {
if (!empty($scanThis[$value])) {
if (is_string($scanThis[$value])) {

View file

@ -43,7 +43,7 @@ if ($valid) {
//Set the subject line
$mail->Subject = 'Message From Site ' . $config->getWebSiteTitle() . " ({$_POST['first_name']})";
$mail->msgHTML($msg);
_error_log("Send email now");
//send the message, check for errors
if (!$mail->send()) {

View file

@ -106,7 +106,7 @@ class Sites extends ObjectYPT
foreach ($fullData as $row) {
$rows[] = $row;
}
}
}
return $rows;
}
}

View file

@ -82,7 +82,7 @@ class Subscribe extends ObjectYPT{
AVideoPlugin::onNewSubscription($this->users_id, $this->subscriber_users_id);
}
}
return $saved;
}
@ -205,7 +205,7 @@ class Subscribe extends ObjectYPT{
if (in_array($row['email'], $emails)) {
//continue;
}
//$value['notify'] =
//$value['notify'] =
$emails[] = $row['email'];
$row['identification'] = User::getNameIdentificationById($row['subscriber_id']);
if ($row['identification'] === __("Unknown User")) {
@ -289,7 +289,7 @@ class Subscribe extends ObjectYPT{
$subscribe[] = $row;
}
//$subscribe = $res->fetch_all(MYSQLI_ASSOC);
}
}
return $subscribe;
}

View file

@ -12,9 +12,9 @@ require_once $global['systemRootPath'] . 'plugin/AVideoPlugin.php';
/**
*
*
* @var array $global
* @var object $global['mysqli']
* @var object $global['mysqli']
*/
class User {
@ -747,9 +747,9 @@ if (typeof gtag !== \"function\") {
$insert_row = sqlDAL::writeSql($sql, $formats, $values);
/**
*
*
* @var array $global
* @var object $global['mysqli']
* @var object $global['mysqli']
*/
if ($insert_row) {
if (empty($this->id)) {
@ -953,7 +953,7 @@ if (typeof gtag !== \"function\") {
try {
sqlDAL::writeSql($sql, "i", [$this->id]);
} catch (Exception $exc) {
}
}
@ -1293,10 +1293,10 @@ if (typeof gtag !== \"function\") {
}
return $can;
}
static public function getLastUserCanStreamReason() {
global $_thisUserCanStreamReasonMessage;
return $_thisUserCanStreamReasonMessage;
}
@ -2398,7 +2398,7 @@ if (typeof gtag !== \"function\") {
$contactEmail = $config->getContactEmail();
$webSiteTitle = $config->getWebSiteTitle();
/**
* @var string $email
* @var string $email
*/
$email = '';
$email = $user->getEmail();
@ -2577,9 +2577,9 @@ if (typeof gtag !== \"function\") {
$row = self::getBlob($users_id, $type);
$null = null;
/**
*
*
* @var array $global
* @var object $global['mysqli']
* @var object $global['mysqli']
*/
if (!empty($row['id'])) {
$sql = "UPDATE users_blob SET `blob` = ? , modified = now() WHERE id = ?";
@ -3065,5 +3065,4 @@ if (typeof gtag !== \"function\") {
}
return $_SESSION['swapUser']['id'];
}
}

View file

@ -86,7 +86,7 @@ _error_log("userAddNew.json.php: saving");
$obj->users_id = $user->save(true);
if (!empty($obj->users_id) && !empty($_POST['usersExtraInfo'])) {
$obj->status = $obj->users_id;
if (!empty($_POST['usersExtraInfo'])) {
User::saveExtraInfo(json_encode($_POST['usersExtraInfo']), $obj->users_id);

View file

@ -29,6 +29,6 @@ foreach ($obj->videos_ids as $videos_id) {
$obj->delResponse = UserGroups::deleteVideoGroups($videos_id, $obj->users_groups_id);
$obj->error = empty($obj->delResponse);
}
}
die(json_encode($obj));

View file

@ -69,9 +69,9 @@ class UserGroups{
}
if (sqlDAL::writeSql($sql, $formats, $values)) {
/**
*
*
* @var array $global
* @var object $global['mysqli']
* @var object $global['mysqli']
*/
if (empty($this->id)) {
$id = $global['mysqli']->insert_id;
@ -279,7 +279,7 @@ class UserGroups{
if(!isset($__getUserGroups)){
$__getUserGroups = array();
}
}
if(isset($__getUserGroups[$users_id])){
return $__getUserGroups[$users_id];
@ -451,15 +451,15 @@ class UserGroups{
}
return $arr;
}
public static function getCategoriesGroups($videos_id){
if (empty($videos_id)) {
return [];
}
global $global;
$v = Video::getVideoLight($videos_id);
$sql = "SELECT chug.*, ug.* FROM categories_has_users_groups as chug "
. " LEFT JOIN users_groups as ug ON users_groups_id = ug.id WHERE categories_id = ? ";
$res = sqlDAL::readSql($sql, "i", [$v['categories_id']]);
@ -477,10 +477,10 @@ class UserGroups{
}
return $arr;
}
public static function getVideosAndCategoriesUserGroups($videos_id, $force = false){
global $_getVideosAndCategoriesUserGroups;
if(!isset($_getVideosAndCategoriesUserGroups)){
$_getVideosAndCategoriesUserGroups = array();
}
@ -518,7 +518,7 @@ class UserGroups{
} else {
return false;
}
unset($_getVideosAndCategoriesUserGroups[$videos_id]);
return sqlDAL::writeSql($sql, "i", [$videos_id]);
}

View file

@ -71,11 +71,11 @@ if (empty($users)) {
}
if(empty($u['creator'])){
$u['creator'] = Video::getCreatorHTML($u['id'], '', true, true);
}
}
if(empty($u['photo'])){
$u['photo'] = User::getPhoto($u['id']);
}
$users[$key] = $u;
}
$users[$key] = $u;
}
$json = _json_encode($users);

View file

@ -367,7 +367,7 @@ if (!class_exists('Video')) {
if (empty($this->type) || !in_array($this->type, self::$typeOptions)) {
$this->type = 'video';
} else if (!empty($this->id) && $this->type == 'linkVideo') {
// chek if it has no media
// chek if it has no media
$types = Video::getVideoTypeFromId($this->id);
if (!empty($types)) {
if ($types->mp4 || $types->webm || $types->m3u8) {
@ -497,9 +497,9 @@ if (!class_exists('Video')) {
}
}
/**
*
*
* @var array $global
* @var object $global['mysqli']
* @var object $global['mysqli']
*/
//var_dump($this->title, $insert_row);exit;
if ($insert_row) {
@ -547,9 +547,9 @@ if (!class_exists('Video')) {
return $id;
}
/**
*
*
* @var array $global
* @var object $global['mysqli']
* @var object $global['mysqli']
*/
_error_log('Video::save Error : (' . $global['mysqli']->errno . ') ' . $global['mysqli']->error);
return false;
@ -671,9 +671,9 @@ if (!class_exists('Video')) {
return false;
}
/**
*
*
* @var array $global
* @var object $global['mysqli']
* @var object $global['mysqli']
*/
_error_log("Video::setStatus " . json_encode($_REQUEST));
_error_log("Video::setStatus({$status}) " . json_encode(debug_backtrace()));
@ -746,9 +746,9 @@ if (!class_exists('Video')) {
$res = sqlDAL::writeSql($sql, $formats, $values);
/**
*
*
* @var array $global
* @var object $global['mysqli']
* @var object $global['mysqli']
*/
if ($global['mysqli']->errno !== 0) {
die('Error on update Rotation: (' . $global['mysqli']->errno . ') ' . $global['mysqli']->error);
@ -762,7 +762,7 @@ if (!class_exists('Video')) {
}
/**
*
*
* @return int
*/
public function getUsers_id() {
@ -783,9 +783,9 @@ if (!class_exists('Video')) {
$values = [$saneZoom, $this->id];
$res = sqlDAL::writeSql($sql, $formats, $values);
/**
*
*
* @var array $global
* @var object $global['mysqli']
* @var object $global['mysqli']
*/
if ($global['mysqli']->errno !== 0) {
die('Error on update Zoom: (' . $global['mysqli']->errno . ') ' . $global['mysqli']->error);
@ -1172,9 +1172,9 @@ if (!class_exists('Video')) {
return false;
}
/**
*
*
* @var array $global
* @var object $global['mysqli']
* @var object $global['mysqli']
*/
$sql = "SELECT * FROM videos v WHERE v.id != {$videos_id} AND v.status='a' AND (categories_id = {$video['categories_id']} ";
if (AVideoPlugin::isEnabledByName("VideoTags")) {
@ -1246,9 +1246,9 @@ if (!class_exists('Video')) {
}
$tolerance = 0.5;
/**
*
*
* @var array $global
* @var object $global['mysqli']
* @var object $global['mysqli']
*/
if (!empty($_POST['sort']['suggested'])) {
$suggestedOnly = true;
@ -1485,9 +1485,9 @@ if (!class_exists('Video')) {
$allowedDurationTypes = array('video', 'audio');
/**
*
*
* @var array $global
* @var object $global['mysqli']
* @var object $global['mysqli']
*/
self::startTransaction();
foreach ($fullData as $index => $row) {
@ -1885,7 +1885,7 @@ if (!class_exists('Video')) {
if (!empty($_GET['catName'])) {
$cn .= ", c.clean_name as cn";
}
*
*
*/
if (AVideoPlugin::isEnabledByName("VideoTags")) {
if (!empty($_GET['tags_id']) && empty($videosArrayId)) {
@ -2013,7 +2013,7 @@ if (!class_exists('Video')) {
$res = sqlDAL::readSql($sql);
$numRows = sqlDal::num_rows($res);
sqlDAL::close($res);
*
*
*/
global $lastGetTotalVideos;
$lastGetTotalVideos = $sql;
@ -2145,7 +2145,7 @@ if (!class_exists('Video')) {
if (!empty($content)) {
$object->$value = self::parseProgress($content);
} else {
}
if (!empty($object->$value->progress) && !is_numeric($object->$value->progress)) {
@ -3742,9 +3742,9 @@ if (!class_exists('Video')) {
}
/**
*
*
* @var array $global
* @var array $global['avideo_resolutions']
* @var array $global['avideo_resolutions']
*/
foreach ($global['avideo_resolutions'] as $value) {
$search[] = "_{$value}";
@ -3851,7 +3851,7 @@ if (!class_exists('Video')) {
}
$HigestResolution = $video->getVideoHigestResolution();
if (!empty($HigestResolution)) {
//_error_log("getHigestResolution($filename) 1 {$HigestResolution} ".$video->getType());
//_error_log("getHigestResolution($filename) 1 {$HigestResolution} ".$video->getType());
$resolution = $HigestResolution;
$return['resolution'] = $resolution;
$return['resolution_text'] = getResolutionText($return['resolution']);
@ -3954,9 +3954,9 @@ if (!class_exists('Video')) {
global $global;
$types = ['', '_HD', '_SD', '_Low'];
/**
*
*
* @var array $global
* @var array $global['avideo_resolutions']
* @var array $global['avideo_resolutions']
*/
$resolutions = $global['avideo_resolutions'];
rsort($resolutions);
@ -4058,9 +4058,9 @@ if (!class_exists('Video')) {
$types = ['', '_Low', '_SD', '_HD'];
/**
*
*
* @var array $global
* @var array $global['avideo_resolutions']
* @var array $global['avideo_resolutions']
*/
foreach ($global['avideo_resolutions'] as $value) {
$types[] = "_{$value}";
@ -5167,7 +5167,7 @@ if (!class_exists('Video')) {
$video = new Video('', '', $videos_id);
/**
*
*
* @var string $status
*/
$status = $video->getStatus();
@ -5475,16 +5475,16 @@ if (!class_exists('Video')) {
$galleryVideoButtons = '';
$galleryVideoButtons .= '
<!-- getVideoImagewithHoverAnimationFromVideosId --><div class="galleryVideoButtons ' . getCSSAnimationClassAndStyle('animate__flipInY', uniqid(), 0) . '">
<button onclick="addVideoToPlayList(' . $videos_id . ', false, ' . $watchLaterId . ');return false;" class="btn btn-dark btn-xs watchLaterBtnAdded watchLaterBtnAdded' . $videos_id . '" data-toggle="tooltip" data-placement="left" title=' . printJSString("Added On Watch Later", true) . ' style="color: #4285f4;' . $watchLaterBtnAddedStyle . '" ><i class="fas fa-check"></i></button>
<button onclick="addVideoToPlayList(' . $videos_id . ', false, ' . $watchLaterId . ');return false;" class="btn btn-dark btn-xs watchLaterBtnAdded watchLaterBtnAdded' . $videos_id . '" data-toggle="tooltip" data-placement="left" title=' . printJSString("Added On Watch Later", true) . ' style="color: #4285f4;' . $watchLaterBtnAddedStyle . '" ><i class="fas fa-check"></i></button>
<button onclick="addVideoToPlayList(' . $videos_id . ', true, ' . $watchLaterId . ');return false;" class="btn btn-dark btn-xs watchLaterBtn watchLaterBtn' . $videos_id . '" data-toggle="tooltip" data-placement="left" title=' . printJSString("Watch Later", true) . ' style="' . $watchLaterBtnStyle . '" ><i class="fas fa-clock"></i></button>
<br>
<button onclick="addVideoToPlayList(' . $videos_id . ', false, ' . $favoriteId . ');return false;" class="btn btn-dark btn-xs favoriteBtnAdded favoriteBtnAdded' . $videos_id . '" data-toggle="tooltip" data-placement="left" title=' . printJSString("Added On Favorite", true) . ' style="color: #4285f4; ' . $favoriteBtnAddedStyle . '"><i class="fas fa-check"></i></button>
<button onclick="addVideoToPlayList(' . $videos_id . ', true, ' . $favoriteId . ');return false;" class="btn btn-dark btn-xs favoriteBtn favoriteBtn' . $videos_id . ' faa-parent animated-hover" data-toggle="tooltip" data-placement="left" title=' . printJSString("Favorite", true) . ' style="' . $favoriteBtnStyle . '" ><i class="fas fa-heart faa-pulse faa-fast" ></i></button>
<button onclick="addVideoToPlayList(' . $videos_id . ', false, ' . $favoriteId . ');return false;" class="btn btn-dark btn-xs favoriteBtnAdded favoriteBtnAdded' . $videos_id . '" data-toggle="tooltip" data-placement="left" title=' . printJSString("Added On Favorite", true) . ' style="color: #4285f4; ' . $favoriteBtnAddedStyle . '"><i class="fas fa-check"></i></button>
<button onclick="addVideoToPlayList(' . $videos_id . ', true, ' . $favoriteId . ');return false;" class="btn btn-dark btn-xs favoriteBtn favoriteBtn' . $videos_id . ' faa-parent animated-hover" data-toggle="tooltip" data-placement="left" title=' . printJSString("Favorite", true) . ' style="' . $favoriteBtnStyle . '" ><i class="fas fa-heart faa-pulse faa-fast" ></i></button>
<br>';
if (Video::canEdit($videos_id)) {
$galleryVideoButtons .= '
<button onclick="avideoModalIframe(webSiteRootURL + \'view/managerVideosLight.php?image=1&avideoIframe=1&videos_id=' . $videos_id . '\');return false;" class="btn btn-dark btn-xs" data-toggle="tooltip" data-placement="left" title=' . printJSString("Edit Thumbnail", true) . '><i class="fas fa-edit"></i></button>
<button onclick="avideoModalIframe(webSiteRootURL + \'view/managerVideosLight.php?image=1&avideoIframe=1&videos_id=' . $videos_id . '\');return false;" class="btn btn-dark btn-xs" data-toggle="tooltip" data-placement="left" title=' . printJSString("Edit Thumbnail", true) . '><i class="fas fa-edit"></i></button>
<br>';
}
@ -5493,9 +5493,9 @@ if (!class_exists('Video')) {
$href = Video::getLink($video['id'], $video['clean_title']);
$embed = Video::getLink($video['id'], $video['clean_title'], true);
$title = safeString($video['title']);
$a = '<a videos_id="' . $videos_id . '"
href="' . $href . '"
embed="' . $embed . '"
$a = '<a videos_id="' . $videos_id . '"
href="' . $href . '"
embed="' . $embed . '"
title="' . $title . '" alternativeLink="' . $alternativeLink . '">';
if ($addLink) {
$img = $a . $img . '</a>';

View file

@ -65,9 +65,9 @@ class VideoStatistic extends ObjectYPT {
$insert_row = sqlDAL::writeSql($sql, "si", [getRealIpAddr(), $videos_id]);
//if($videos_id==4){_error_log($sql);}
/**
*
*
* @var array $global
* @var object $global['mysqli']
* @var object $global['mysqli']
*/
if (!empty($global['mysqli']->insert_id)) {
return $global['mysqli']->insert_id;
@ -129,14 +129,14 @@ class VideoStatistic extends ObjectYPT {
$this->seconds_watching_video = intval($this->seconds_watching_video);
$this->json = ($this->json);
if(empty($this->id)){
$row = self::getLastStatistics($this->videos_id, $this->users_id);
if(!empty($row)){
$this->id = $row['id'];
}
}
return parent::save();
}
@ -321,13 +321,13 @@ class VideoStatistic extends ObjectYPT {
public static function getChannelsWithMoreViews($daysLimit = 0) {
global $global, $advancedCustom;
if(empty($daysLimit)){
$daysLimit = getTrendingLimit();
}
//$dateDaysLimit = getTrendingLimitDate();
$cacheName3 = "getChannelsWithMoreViews{$daysLimit}" . DIRECTORY_SEPARATOR . md5(json_encode([$_GET, $_POST]));
$cache = ObjectYPT::getCache($cacheName3, 3600); // 1 hour cache
if (!empty($cache)) {
@ -392,13 +392,13 @@ class VideoStatistic extends ObjectYPT {
public static function getVideosWithMoreViews($status, $showOnlyLoggedUserVideos, $showUnlisted, $suggestedOnly, $daysLimit = 0) {
global $global, $advancedCustom;
if(empty($daysLimit)){
$daysLimit = getTrendingLimit();
}
$dateDaysLimit = getTrendingLimitDate();
// get unique videos ids from the requested timeframe
$sql = "SELECT distinct(videos_id) as videos_id FROM videos_statistics s "
. " LEFT JOIN videos v ON v.id = videos_id "
@ -479,13 +479,13 @@ class VideoStatistic extends ObjectYPT {
public static function getChannelsTotalViews($users_id, $daysLimit = 0) {
global $global, $advancedCustom;
if(empty($daysLimit)){
$daysLimit = getTrendingLimit();
}
$dateDaysLimit = getTrendingLimitDate();
$cacheName = "getChannelsTotalViews($users_id, $daysLimit)";
$cache = ObjectYPT::getCache($cacheName, 3600); // 1 hour cache
if (!empty($cache)) {