diff --git a/install/checkMaxOpenFiles.php b/install/checkMaxOpenFiles.php new file mode 100644 index 0000000000..187d38d1a9 --- /dev/null +++ b/install/checkMaxOpenFiles.php @@ -0,0 +1,7 @@ + + + + + + diff --git a/objects/functions.php b/objects/functions.php index 5768dc2eb9..8e641d3618 100644 --- a/objects/functions.php +++ b/objects/functions.php @@ -545,7 +545,7 @@ function partition(array $list, $totalItens) { return $partition; } -function sendSiteEmail($to, $subject, $message, $fromEmail='', $fromName='') { +function sendSiteEmail($to, $subject, $message, $fromEmail = '', $fromName = '') { global $advancedCustom; $resp = false; if (empty($to)) { @@ -565,10 +565,10 @@ function sendSiteEmail($to, $subject, $message, $fromEmail='', $fromName='') { _error_log("sendSiteEmail [" . count($to) . "] {$subject}"); global $config, $global; //require_once $global['systemRootPath'] . 'objects/include_phpmailer.php'; - if(empty($fromEmail)){ + if (empty($fromEmail)) { $fromEmail = $config->getContactEmail(); } - if(empty($fromName)){ + if (empty($fromName)) { $fromName = $config->getWebSiteTitle(); } $webSiteTitle = $config->getWebSiteTitle(); @@ -8188,14 +8188,13 @@ function pluginsRequired($arrayPluginName, $featureName = '') { return $obj; } -function _strtotime($datetime){ - if(is_int($datetime)){ +function _strtotime($datetime) { + if (is_int($datetime)) { return $datetime; } return strtotime($datetime); } - function _isSocketPresentOnCrontab() { foreach (getValidCrontabLines() as $line) { if (!empty($line) && preg_match('/plugin\/YPTSocket\/server.php/', $line)) { @@ -8214,11 +8213,9 @@ function _isSchedulerPresentOnCrontab() { return false; } - - -function getValidCrontabLines(){ +function getValidCrontabLines() { global $_validCrontabLines; - if(empty($validCrontabLines)){ + if (empty($validCrontabLines)) { $crontab = shell_exec('crontab -l'); $crontabLines = preg_split("/\r\n|\n|\r/", $crontab); $_validCrontabLines = array(); @@ -8238,16 +8235,16 @@ function getValidCrontabLines(){ * @param type $strOrArray * @return type return an array with the valid emails. */ -function is_email($strOrArray){ - if(empty($strOrArray)){ +function is_email($strOrArray) { + if (empty($strOrArray)) { return array(); } - if(!is_array($strOrArray)){ + if (!is_array($strOrArray)) { $strOrArray = array($strOrArray); } $valid_emails = array(); foreach ($strOrArray as $email) { - if(is_numeric($email)){ + if (is_numeric($email)) { $email = User::getEmailDb($email); } if (filter_var($email, FILTER_VALIDATE_EMAIL)) { @@ -8255,4 +8252,40 @@ function is_email($strOrArray){ } } return $valid_emails; +} + +/** + * https://codepen.io/ainalem/pen/LJYRxz + * @global type $global + * @param type $id + * @param type $type 1 to 8 [1=x, 2=<-, 3=close, 4=x, 5=<-, 6=x, 7=x, 8=x] + * @param type $parameters + * @return type + */ +function getHamburgerButton($id = '', $type = 0, $parameters = 'class="btn btn-default hamburger"', $startActive = false, $invert = false) { + global $global; + if ($type === 'x') { + $XOptions = array(1, 4, 6, 7, 8); + $type = $XOptions[rand(0, 4)]; + }else if($type === '<-'){ + $XOptions = array(2, 5); + $type = $XOptions[rand(0, 1)]; + } + $type = intval($type); + if (empty($type) || ($type < 1 && $type > 8)) { + $type = rand(1, 8); + } + if (empty($id)) { + $id = uniqid(); + } + $filePath = $global['systemRootPath'] . 'objects/functionGetHamburgerButton.php'; + return getIncludeFileContent($filePath, array('type' => $type, 'id' => $id, 'parameters' => $parameters, 'startActive' => $startActive, 'invert' => $invert)); +} + +function getUserOnlineLabel($users_id, $class='', $style=''){ + if(AVideoPlugin::isEnabledByName('YPTSocket')){ + return YPTSocket::getUserOnlineLabel($users_id, $class, $style); + }else{ + return ''; + } } \ No newline at end of file diff --git a/plugin/CustomizeAdvanced/CustomizeAdvanced.php b/plugin/CustomizeAdvanced/CustomizeAdvanced.php index 62b0f43032..4491459067 100644 --- a/plugin/CustomizeAdvanced/CustomizeAdvanced.php +++ b/plugin/CustomizeAdvanced/CustomizeAdvanced.php @@ -1,520 +1,521 @@ - Help"; - return $txt . $help; - } - - public function getName() { - return "CustomizeAdvanced"; - } - - public function getUUID() { - return "55a4fa56-8a30-48d4-a0fb-8aa6b3f69033"; - } - - public function getPluginVersion() { - return "1.0"; - } - - public function getEmptyDataObject() { - global $global; - $obj = new stdClass(); - $obj->logoMenuBarURL = ""; - $obj->encoderNetwork = "https://network.wwbn.net/"; - $obj->useEncoderNetworkRecomendation = false; - $obj->doNotShowEncoderNetwork = true; - $obj->doNotShowUploadButton = false; - $obj->uploadButtonDropdownIcon = "fas fa-video"; - $obj->uploadButtonDropdownText = ""; - $obj->encoderNetworkLabel = ""; - $obj->doNotShowUploadMP4Button = true; - $obj->disablePDFUpload = false; - $obj->disableImageUpload = false; - $obj->disableZipUpload = true; - $obj->disableMP4Upload = false; - $obj->disableMP3Upload = false; - $obj->uploadMP4ButtonLabel = ""; - $obj->doNotShowImportMP4Button = true; - $obj->importMP4ButtonLabel = ""; - $obj->doNotShowEncoderButton = false; - $obj->encoderButtonLabel = ""; - $obj->doNotShowEmbedButton = false; - $obj->embedBackgroundColor = "white"; - $obj->embedButtonLabel = ""; - $obj->embedCodeTemplate = '
'; - $obj->embedCodeTemplateObject = ''; - $obj->htmlCodeTemplate = '" . $this->getDescription() . "
"; - } - return ""; - } - - public function getModeYouTube($videos_id) { - global $global, $config; - $obj = $this->getDataObject(); - $video = Video::getVideo($videos_id, "viewable", true); - if (!empty($video['rrating']) && empty($_GET['rrating'])) { - $suffix = strtoupper(str_replace("-", "", $video['rrating'])); - eval("\$show = \$obj->askRRatingConfirmationBeforePlay_$suffix;"); - if (!empty($show)) { - include "{$global['systemRootPath']}plugin/CustomizeAdvanced/confirmRating.php"; - exit; - } - } - } - - public function getEmbed($videos_id) { - return $this->getModeYouTube($videos_id); - } - - public function getFooterCode() { - global $global; - - $obj = $this->getDataObject(); - $content = ''; - if ($obj->autoHideNavbar && !isEmbed()) { - $content .= ''; - $content .= ''; - } - if ($obj->autoHideNavbarInSeconds && !isEmbed()) { - $content .= ''; - } - return $content; - } - - public function getHTMLMenuRight() { - global $global; - $obj = $this->getDataObject(); - if ($obj->filterRRating) { - include $global['systemRootPath'] . 'plugin/CustomizeAdvanced/menuRight.php'; - } - } - - public function getHTMLMenuLeft() { - global $global; - $obj = $this->getDataObject(); - if ($obj->filterRRating) { - include $global['systemRootPath'] . 'plugin/CustomizeAdvanced/menuLeft.php'; - } - } - - public static function getVideoWhereClause() { - $sql = ""; - $obj = AVideoPlugin::getObjectData("CustomizeAdvanced"); - if ($obj->filterRRating && isset($_GET['rrating'])) { - if ($_GET['rrating'] === "0") { - $sql .= " AND v.rrating = ''"; - } else if (in_array($_GET['rrating'], Video::$rratingOptions)) { - $sql .= " AND v.rrating = '{$_GET['rrating']}'"; - } - } - return $sql; - } - - public function getVideosManagerListButton() { - $btn = ""; - if (User::isAdmin()) { - $btn = ''; - $btn .= ''; - } - return $btn; - } - - public function getHeadCode() { - global $global; - $obj = $this->getDataObject(); - - if($obj->makeVideosIDHarderToGuess){ - if(isVideo()){ - if(!empty($global['makeVideosIDHarderToGuessNotDecrypted'])){ - unset($global['makeVideosIDHarderToGuessNotDecrypted']); - forbiddenPage(__('Invalid ID')); - } - } - } - - $baseName = basename($_SERVER['REQUEST_URI']); - - $js = ""; - if(empty($obj->autoPlayAjax)){ - $js .= ""; - }else{ - $js .= ""; - } - if ($baseName === 'mvideos') { - $js .= ""; - $js .= ""; - } - return $js; - } - - public function onReceiveFile($videos_id) { - Video::updateFilesize($videos_id); - return true; - } - -} - -class SocialMedias{ - public $href; - public $class; - public $title; - public $iclass; - public $img; - public $onclick; - - function __construct($iclass, $img='') { - $this->iclass = $iclass; - $this->img = $img; - } - - - function getHref() { - return $this->href; - } - - function getClass() { - return $this->class; - } - - function getTitle() { - return $this->title; - } - - function getIclass() { - return $this->iclass; - } - - function getImg() { - return $this->img; - } - - function getOnclick() { - return $this->onclick; - } - - function setHref($href): void { - $this->href = $href; - } - - function setClass($class): void { - $this->class = $class; - } - - function setTitle($title): void { - $this->title = $title; - } - - function setIclass($iclass): void { - $this->iclass = $iclass; - } - - function setImg($img): void { - $this->img = $img; - } - - function setOnclick($onclick): void { - $this->onclick = $onclick; - } - - -} - -$global['social_medias'] = array( - 'Facebook'=>new SocialMedias('fab fa-facebook-square', ''), - 'Twitter'=>new SocialMedias('fab fa-twitter', ''), - 'Tumblr'=>new SocialMedias('fab fa-tumblr', ''), - 'Pinterest'=>new SocialMedias('fab fa-pinterest-p', ''), - 'Reddit'=>new SocialMedias('fab fa-reddit-alien', ''), - 'LinkedIn'=>new SocialMedias('fab fa-linkedin-in', ''), - 'Wordpress'=>new SocialMedias('fab fa-wordpress-simple', ''), - 'Pinboard'=>new SocialMedias('fas fa-thumbtack', ''), - 'Gab'=>new SocialMedias('', getURL('view/img/gab.png')), - 'CloutHub'=>new SocialMedias('', getURL('view/img/cloutHub.png')), -); \ No newline at end of file + Help"; + return $txt . $help; + } + + public function getName() { + return "CustomizeAdvanced"; + } + + public function getUUID() { + return "55a4fa56-8a30-48d4-a0fb-8aa6b3f69033"; + } + + public function getPluginVersion() { + return "1.0"; + } + + public function getEmptyDataObject() { + global $global; + $obj = new stdClass(); + $obj->logoMenuBarURL = ""; + $obj->encoderNetwork = "https://network.wwbn.net/"; + $obj->useEncoderNetworkRecomendation = false; + $obj->doNotShowEncoderNetwork = true; + $obj->doNotShowUploadButton = false; + $obj->uploadButtonDropdownIcon = "fas fa-video"; + $obj->uploadButtonDropdownText = ""; + $obj->encoderNetworkLabel = ""; + $obj->doNotShowUploadMP4Button = true; + $obj->disablePDFUpload = false; + $obj->disableImageUpload = false; + $obj->disableZipUpload = true; + $obj->disableMP4Upload = false; + $obj->disableMP3Upload = false; + $obj->uploadMP4ButtonLabel = ""; + $obj->doNotShowImportMP4Button = true; + $obj->importMP4ButtonLabel = ""; + $obj->doNotShowEncoderButton = false; + $obj->encoderButtonLabel = ""; + $obj->doNotShowEmbedButton = false; + $obj->embedBackgroundColor = "white"; + $obj->embedButtonLabel = ""; + $obj->embedCodeTemplate = ''; + $obj->embedCodeTemplateObject = ''; + $obj->htmlCodeTemplate = '" . $this->getDescription() . "
"; + } + return ""; + } + + public function getModeYouTube($videos_id) { + global $global, $config; + $obj = $this->getDataObject(); + $video = Video::getVideo($videos_id, "viewable", true); + if (!empty($video['rrating']) && empty($_GET['rrating'])) { + $suffix = strtoupper(str_replace("-", "", $video['rrating'])); + eval("\$show = \$obj->askRRatingConfirmationBeforePlay_$suffix;"); + if (!empty($show)) { + include "{$global['systemRootPath']}plugin/CustomizeAdvanced/confirmRating.php"; + exit; + } + } + } + + public function getEmbed($videos_id) { + return $this->getModeYouTube($videos_id); + } + + public function getFooterCode() { + global $global; + + $obj = $this->getDataObject(); + $content = ''; + if ($obj->autoHideNavbar && !isEmbed()) { + $content .= ''; + $content .= ''; + } + if ($obj->autoHideNavbarInSeconds && !isEmbed()) { + $content .= ''; + } + return $content; + } + + public function getHTMLMenuRight() { + global $global, $config,$advancedCustom; + $obj = $this->getDataObject(); + if (!empty($obj->menuBarHTMLCode->value)) { + echo $obj->menuBarHTMLCode->value; + } + if ($obj->filterRRating) { + include $global['systemRootPath'] . 'plugin/CustomizeAdvanced/menuRight.php'; + } + if (User::canUpload() && empty($obj->doNotShowUploadButton)) { + include $global['systemRootPath'] . 'view/include/navbarUpload.php'; + } else { + include $global['systemRootPath'] . 'view/include/navbarNotUpload.php'; + } + } + + public function getHTMLMenuLeft() { + global $global; + $obj = $this->getDataObject(); + if ($obj->filterRRating) { + include $global['systemRootPath'] . 'plugin/CustomizeAdvanced/menuLeft.php'; + } + } + + public static function getVideoWhereClause() { + $sql = ""; + $obj = AVideoPlugin::getObjectData("CustomizeAdvanced"); + if ($obj->filterRRating && isset($_GET['rrating'])) { + if ($_GET['rrating'] === "0") { + $sql .= " AND v.rrating = ''"; + } else if (in_array($_GET['rrating'], Video::$rratingOptions)) { + $sql .= " AND v.rrating = '{$_GET['rrating']}'"; + } + } + return $sql; + } + + public function getVideosManagerListButton() { + $btn = ""; + if (User::isAdmin()) { + $btn = ''; + $btn .= ''; + } + return $btn; + } + + public function getHeadCode() { + global $global; + $obj = $this->getDataObject(); + + if ($obj->makeVideosIDHarderToGuess) { + if (isVideo()) { + if (!empty($global['makeVideosIDHarderToGuessNotDecrypted'])) { + unset($global['makeVideosIDHarderToGuessNotDecrypted']); + forbiddenPage(__('Invalid ID')); + } + } + } + + $baseName = basename($_SERVER['REQUEST_URI']); + + $js = ""; + if (empty($obj->autoPlayAjax)) { + $js .= ""; + } else { + $js .= ""; + } + if ($baseName === 'mvideos') { + $js .= ""; + $js .= ""; + } + return $js; + } + + public function onReceiveFile($videos_id) { + Video::updateFilesize($videos_id); + return true; + } + +} + +class SocialMedias { + + public $href; + public $class; + public $title; + public $iclass; + public $img; + public $onclick; + + function __construct($iclass, $img = '') { + $this->iclass = $iclass; + $this->img = $img; + } + + function getHref() { + return $this->href; + } + + function getClass() { + return $this->class; + } + + function getTitle() { + return $this->title; + } + + function getIclass() { + return $this->iclass; + } + + function getImg() { + return $this->img; + } + + function getOnclick() { + return $this->onclick; + } + + function setHref($href): void { + $this->href = $href; + } + + function setClass($class): void { + $this->class = $class; + } + + function setTitle($title): void { + $this->title = $title; + } + + function setIclass($iclass): void { + $this->iclass = $iclass; + } + + function setImg($img): void { + $this->img = $img; + } + + function setOnclick($onclick): void { + $this->onclick = $onclick; + } + +} + +$global['social_medias'] = array( + 'Facebook' => new SocialMedias('fab fa-facebook-square', ''), + 'Twitter' => new SocialMedias('fab fa-twitter', ''), + 'Tumblr' => new SocialMedias('fab fa-tumblr', ''), + 'Pinterest' => new SocialMedias('fab fa-pinterest-p', ''), + 'Reddit' => new SocialMedias('fab fa-reddit-alien', ''), + 'LinkedIn' => new SocialMedias('fab fa-linkedin-in', ''), + 'Wordpress' => new SocialMedias('fab fa-wordpress-simple', ''), + 'Pinboard' => new SocialMedias('fas fa-thumbtack', ''), + 'Gab' => new SocialMedias('', getURL('view/img/gab.png')), + 'CloutHub' => new SocialMedias('', getURL('view/img/cloutHub.png')), +); diff --git a/plugin/Gallery/style.css b/plugin/Gallery/style.css index cbb713179f..daf0ba9fb2 100644 --- a/plugin/Gallery/style.css +++ b/plugin/Gallery/style.css @@ -160,9 +160,14 @@ a.h6{ top: 5px; z-index: 1025; display: none; + } .galleryVideo .galleryVideoButtons button{ opacity: 0.5; + display: inline-grid; + padding: 2px; + justify-content: center; + width: 24px; } .galleryVideo:hover .galleryVideoButtons{ display: block !important; diff --git a/plugin/Gallery/view/BigVideo.php b/plugin/Gallery/view/BigVideo.php index a87cb9ac3e..02cc470167 100644 --- a/plugin/Gallery/view/BigVideo.php +++ b/plugin/Gallery/view/BigVideo.php @@ -1,306 +1,306 @@ -BigVideo && empty($_GET['showOnly'])) { - - if (!empty($obj->useSuggestedVideosAsCarouselInBigVideo)) { - //getAllVideos($status = "viewable", $showOnlyLoggedUserVideos = false, $ignoreGroup = false, $videosArrayId = array(), $getStatistcs = false, $showUnlisted = false, $activeUsersOnly = true) - //$videoRows = Video::getAllVideosLight("viewable", !$obj->hidePrivateVideos, false, true); - $_REQUEST['rowCount'] = 20; - $_REQUEST['current'] = 1; - $videoRows = Video::getAllVideos("viewable", false, !$obj->hidePrivateVideos, array(), false, false, true, true); - } - if (empty($videoRows)) { - $videoRows = array($video); - } - $class = ''; - $classInner = ''; - if (count($videoRows) > 1) { - $class = 'carousel slide'; - $classInner = 'carousel-inner'; - } - ?> - - -