diff --git a/plugin/Gallery/functions.php b/plugin/Gallery/functions.php index b82e172c2..1d8852b28 100644 --- a/plugin/Gallery/functions.php +++ b/plugin/Gallery/functions.php @@ -1,499 +1,672 @@
-

- - - " . $info[1] . ""; - } else { - echo "{$title}"; - } - ?> - -

+

+ + + " . $info[1] . ""; + } else { + echo "{$title}"; + } + ?> + +

+
-
" . __("Up") . ""; $mostLess = $mostWord; } else { if (strpos($orderString, $getName . "=ASC")) { $tmpOrderString = substr($orderString, 0, strpos($orderString, $getName . "=ASC")) . $getName . "=DESC" . substr($orderString, strpos($orderString, $getName . "=ASC") + strlen($getName . "=ASC"), strlen($orderString)); } else { $tmpOrderString .= $getName . "=DESC"; } $upDown = "" . __("Down") . ""; $mostLess = $lessWord; } if (substr($tmpOrderString, strlen($tmpOrderString) - 1, strlen($tmpOrderString)) == "&") { $tmpOrderString = substr($tmpOrderString, 0, strlen($tmpOrderString) - 1); } return array($tmpOrderString, $upDown, $mostLess); } function createGallerySection($videos, $crc = "", $get = array(), $ignoreAds = false, $screenColsLarge = 0, $screenColsMedium = 0, $screenColsSmall = 0, $screenColsXSmall = 0) { global $global, $config, $obj, $advancedCustom, $advancedCustomUser; $countCols = 0; $obj = AVideoPlugin::getObjectData("Gallery"); $zindex = 1000; $startG = microtime(true); $program = AVideoPlugin::loadPluginIfEnabled('PlayLists'); foreach ($videos as $value) { // that meas auto generate the channelName if (empty($get) && !empty($obj->filterUserChannel)) { $getCN = array('channelName' => $value['channelName'], 'catName' => @$_GET['catName']); } else { $getCN = $get; } - $img_portrait = ($value['rotation'] === "90" || $value['rotation'] === "270") ? "img-portrait" : ""; + $img_portrait = (@$value['rotation'] === "90" || @$value['rotation'] === "270") ? "img-portrait" : ""; $name = User::getNameIdentificationById($value['users_id']); $name .= " " . User::getEmailVerifiedIcon($value['users_id']); // make a row each 6 cols if ($countCols % $obj->screenColsLarge === 0) { echo '
'; } $countCols++; - - if(!empty($screenColsLarge)){ + + if (!empty($screenColsLarge)) { $obj->screenColsLarge = $screenColsLarge; } - if(!empty($screenColsMedium)){ + if (!empty($screenColsMedium)) { $obj->screenColsMedium = $screenColsMedium; } - if(!empty($screenColsSmall)){ + if (!empty($screenColsSmall)) { $obj->screenColsSmall = $screenColsSmall; } - if(!empty($screenColsXSmall)){ + if (!empty($screenColsXSmall)) { $obj->screenColsXSmall = $screenColsXSmall; } - - $colsClass = "col-lg-".(12 / $obj->screenColsLarge)." col-md-".(12 / $obj->screenColsMedium)." col-sm-".(12 / $obj->screenColsSmall)." col-xs-".(12 / $obj->screenColsXSmall); + + $colsClass = "col-lg-" . (12 / $obj->screenColsLarge) . " col-md-" . (12 / $obj->screenColsMedium) . " col-sm-" . (12 / $obj->screenColsSmall) . " col-xs-" . (12 / $obj->screenColsXSmall); ?>
- thumbsGif = ""; - $images->poster = "{$global['webSiteRootURL']}view/img/notfound.jpg"; - $images->thumbsJpg = "{$global['webSiteRootURL']}view/img/notfoundThumbs.jpg"; - $images->thumbsJpgSmall = "{$global['webSiteRootURL']}view/img/notfoundThumbsSmall.jpg"; - } - $startG = microtime(true); - $imgGif = $images->thumbsGif; - $poster = $images->thumbsJpg; - ?> + thumbsGif = ""; + $images->poster = "{$global['webSiteRootURL']}view/img/notfound.jpg"; + $images->thumbsJpg = "{$global['webSiteRootURL']}view/img/notfoundThumbs.jpg"; + $images->thumbsJpgSmall = "{$global['webSiteRootURL']}view/img/notfoundThumbsSmall.jpg"; + } + $startG = microtime(true); + $imgGif = $images->thumbsGif; + $poster = $images->thumbsJpg; + ?>
<?php echo $value['title']; ?>" id="thumbsJPG" />

- - + +
- +
- +

showCategoryTag)) { ?> showTags)) { $value['tags'] = Video::getTags($value['id']); foreach ($value['tags'] as $value2) { if (!empty($value2->label) && $value2->label === __("Paid Content")) { ?>text; ?>label) && $value2->label === __("Group")) { ?>text; ?>label) && $value2->label === __("Plugin")) { ?> text; ?>
doNotDisplayViews)) { ?>
Description)) { $desc = str_replace(array('"', "'", "#", "/", "\\"), array('``', "`", "", "", ""), preg_replace("/\r|\n/", " ", nl2br(trim($value['description'])))); if (!empty($desc)) { $titleAlert = str_replace(array('"', "'"), array('``', "`"), $value['title']); ?>
1){ - if($countCols%$obj->screenColsLarge===0){ + if ($countCols > 1) { + if ($countCols % $obj->screenColsLarge === 0) { echo ""; } - if($countCols%$obj->screenColsMedium===0){ + if ($countCols % $obj->screenColsMedium === 0) { echo ""; } - if($countCols%$obj->screenColsSmall===0){ + if ($countCols % $obj->screenColsSmall === 0) { echo ""; } - if($countCols%$obj->screenColsXSmall===0){ + if ($countCols % $obj->screenColsXSmall === 0) { echo ""; } } } ?>
screenColsLarge === 0) { + echo '
'; + } + + $countCols++; + + if (!empty($screenColsLarge)) { + $obj->screenColsLarge = $screenColsLarge; + } + if (!empty($screenColsMedium)) { + $obj->screenColsMedium = $screenColsMedium; + } + if (!empty($screenColsSmall)) { + $obj->screenColsSmall = $screenColsSmall; + } + if (!empty($screenColsXSmall)) { + $obj->screenColsXSmall = $screenColsXSmall; + } + $colsClass = "col-lg-" . (12 / $obj->screenColsLarge) . " col-md-" . (12 / $obj->screenColsMedium) . " col-sm-" . (12 / $obj->screenColsSmall) . " col-xs-" . (12 / $obj->screenColsXSmall); + + + $liveNow = '' . __("LIVE NOW") . ''; + if ($video['type'] == 'live') { + $lives = Live::getOnlineLivesFromUser($video['users_id']); + foreach ($lives as $key => $liveOnlineItem) { + $lives[$key] = array( + 'title' => $liveOnlineItem['title'], + 'poster' => Live::getImage($video['users_id'], @$liveOnlineItem['live_servers_id']), + 'href' => $liveOnlineItem['href'], + 'link' => $liveOnlineItem['link'], + 'imgGif' => Live::getImageGif($video['users_id'], $video['live_servers_id'], @$liveOnlineItem['live_servers_id']) + ); + } + + if (empty($lives) && empty($liveobj->doNotShowOfflineLiveOnCategoryList)) { + $url = addQueryStringParameter(Live::getLinkToLiveFromUsers_id($video['users_id']),'playlists_id_live',0); + $lives = array( + array( + 'title' => $video['title'], + 'poster' => Live::getOfflineImage(), + 'href' => $url, + 'link' => addQueryStringParameter($url, 'embed', 1), + 'imgGif' => false + ) + ); + $liveNow = '' . __("OFFLINE") . ''; + } + } else { + $lives = array( + array( + 'title' => $video['title'], + 'poster' => LiveLinks::getImage($video['id']), + 'href' => LiveLinks::getLink($video['id']), + 'link' => LiveLinks::getLink($video['id'], true), + 'imgGif' => LiveLinks::getImageGif($video['id']) + ) + ); + } + foreach ($lives as $liveOnlineItem) { + ?> +
+ +
+ <?php echo $liveOnlineItem['title'] ?> + + + +
+
+ +

+
+ +
+
+ showCategoryTag)) { ?> + + + + + + + +
+
+ + + + + Description)) { + $desc = str_replace(array('"', "'", "#", "/", "\\"), array('``', "`", "", "", ""), preg_replace("/\r|\n/", " ", nl2br(trim($video['description'])))); + if (!empty($desc)) { + $titleAlert = str_replace(array('"', "'"), array('``', "`"), $video['title']); + ?> + + +
+
+
+ + 1) { + if ($countCols % $obj->screenColsLarge === 0) { + echo ""; + } + if ($countCols % $obj->screenColsMedium === 0) { + echo ""; + } + if ($countCols % $obj->screenColsSmall === 0) { + echo ""; + } + if ($countCols % $obj->screenColsXSmall === 0) { + echo ""; + } + } + } + } + ?> +
+ +
+

- Channel Owner + Channel Owner

"; return $countCols; } + +function canPrintCategoryTitle($title) { + global $doNotRepeatCategoryTitle; + if (!isset($doNotRepeatCategoryTitle)) { + $doNotRepeatCategoryTitle = array(); + } + if (in_array($title, $doNotRepeatCategoryTitle)) { + return false; + } + $doNotRepeatCategoryTitle[] = $title; + return true; +} ?>