diff --git a/objects/videoAddNew.json.php b/objects/videoAddNew.json.php index be7958e1f..6558434e8 100644 --- a/objects/videoAddNew.json.php +++ b/objects/videoAddNew.json.php @@ -1,131 +1,133 @@ setClean_Title($_POST['clean_title']); $audioLinks = array('mp3', 'ogg'); $videoLinks = array('mp4', 'webm'); TimeLogEnd(__FILE__, __LINE__); if (!empty($_POST['videoLink'])) { //var_dump($config->getEncoderURL()."getLinkInfo/". base64_encode($_POST['videoLink']));exit; $path_parts = pathinfo($_POST['videoLink']); $extension = strtolower(@$path_parts["extension"]); if (empty($_POST['id']) && !(in_array($extension, $audioLinks) || in_array($extension, $videoLinks))) { $info = url_get_contents($config->getEncoderURL() . "getLinkInfo/" . base64_encode($_POST['videoLink'])); $infoObj = json_decode($info); $filename = uniqid("_YPTuniqid_", true); $filename = $obj->setFilename($filename); $obj->setTitle($infoObj->title); $obj->setClean_title($infoObj->title); $obj->setDuration($infoObj->duration); $obj->setDescription($infoObj->description); file_put_contents($global['systemRootPath'] . "videos/{$filename}.jpg", base64_decode($infoObj->thumbs64)); } else if (empty($_POST['id'])) { $filename = uniqid("_YPTuniqid_", true); $filename = $obj->setFilename($filename); $obj->setTitle($path_parts["filename"]); $obj->setClean_title($path_parts["filename"]); $obj->setDuration(""); $obj->setDescription(@$_POST['description']); } $obj->setVideoLink($_POST['videoLink']); if (in_array($extension, $audioLinks) || in_array($extension, $videoLinks)) { if (in_array($extension, $audioLinks)) { $obj->setType('linkAudio'); } else { $obj->setType('linkVideo'); } } else if(!empty($obj->getType())){ $obj->setType('embed'); } if (!empty($_POST['videoLinkType'])) { $obj->setType($_POST['videoLinkType']); } if (empty($_POST['id'])) { $obj->setStatus('a'); } }else if(!empty($obj->getType()) && ($obj->getType() == 'video' || $obj->getType() == 'serie' || $obj->getType() == 'audio')){ $obj->setVideoLink(""); } TimeLogEnd(__FILE__, __LINE__); if (!empty($_POST['isArticle'])) { $obj->setType("article"); if (empty($_POST['id'])) { $obj->setStatus('a'); } $filename = uniqid("_YPTuniqid_", true); $filename = $obj->setFilename($filename); } TimeLogEnd(__FILE__, __LINE__); $obj->setNext_videos_id($_POST['next_videos_id']); if (!empty($_POST['description'])) { $obj->setDescription($_POST['description']); } if (empty($advancedCustomUser->userCanNotChangeCategory) || User::isAdmin()) { $obj->setCategories_id($_POST['categories_id']); } -$obj->setVideoGroups(empty($_POST['videoGroups']) ? array() : $_POST['videoGroups']); +if (empty($advancedCustomUser->userCanNotChangeUserGroup) || User::isAdmin()) { + $obj->setVideoGroups(empty($_POST['videoGroups']) ? array() : $_POST['videoGroups']); +} if (User::isAdmin()) { $obj->setUsers_id($_POST['users_id']); } TimeLogEnd(__FILE__, __LINE__); $obj->setCan_download(@$_POST['can_download']); $obj->setCan_share(@$_POST['can_share']); $obj->setOnly_for_paid(@$_POST['only_for_paid']); $obj->setTrailer1(@$_POST['trailer1']); $obj->setRrating(@$_POST['rrating']); $obj->setExternalOptions(@$_POST['externalOptions']); TimeLogEnd(__FILE__, __LINE__); $resp = $obj->save(true); // if is a new embed video if (empty($_POST['id']) && $obj->getType() == 'embed') { AVideoPlugin::afterNewVideo($resp); } AVideoPlugin::saveVideosAddNew($_POST, $resp); TimeLogEnd(__FILE__, __LINE__); $obj = new stdClass(); $obj->status = !empty($resp); $obj->msg = $msg; $obj->info = json_encode($info); $obj->infoObj = json_encode($infoObj); $obj->videos_id = intval($resp); -$obj->video = Video::getVideo($obj->videos_id, false); +$obj->video = Video::getVideo($obj->videos_id, false, true); TimeLogEnd(__FILE__, __LINE__); echo json_encode($obj); diff --git a/plugin/CustomizeUser/CustomizeUser.php b/plugin/CustomizeUser/CustomizeUser.php index 0bc3242b7..e86de0ea7 100644 --- a/plugin/CustomizeUser/CustomizeUser.php +++ b/plugin/CustomizeUser/CustomizeUser.php @@ -1,313 +1,314 @@ userCanAllowFilesDownload = false; $obj->userCanAllowFilesShare = false; $obj->userCanAllowFilesDownloadSelectPerVideo = false; $obj->userCanAllowFilesShareSelectPerVideo = false; $obj->usersCanCreateNewCategories = !isset($advancedCustom->usersCanCreateNewCategories) ? false : $advancedCustom->usersCanCreateNewCategories; $obj->userCanNotChangeCategory = !isset($advancedCustom->userCanNotChangeCategory) ? false : $advancedCustom->userCanNotChangeCategory; + $obj->userCanNotChangeUserGroup = false; $obj->userMustBeLoggedIn = !isset($advancedCustom->userMustBeLoggedIn) ? false : $advancedCustom->userMustBeLoggedIn; $obj->onlyVerifiedEmailCanUpload = !isset($advancedCustom->onlyVerifiedEmailCanUpload) ? false : $advancedCustom->onlyVerifiedEmailCanUpload; $obj->sendVerificationMailAutomaic = !isset($advancedCustom->sendVerificationMailAutomaic) ? false : $advancedCustom->sendVerificationMailAutomaic; $obj->unverifiedEmailsCanNOTLogin = !isset($advancedCustom->unverifiedEmailsCanNOTLogin) ? false : $advancedCustom->unverifiedEmailsCanNOTLogin; $obj->newUsersCanStream = !isset($advancedCustom->newUsersCanStream) ? false : $advancedCustom->newUsersCanStream; $obj->doNotIndentifyByEmail = !isset($advancedCustom->doNotIndentifyByEmail) ? false : $advancedCustom->doNotIndentifyByEmail; $obj->doNotIndentifyByName = !isset($advancedCustom->doNotIndentifyByName) ? false : $advancedCustom->doNotIndentifyByName; $obj->doNotIndentifyByUserName = !isset($advancedCustom->doNotIndentifyByUserName) ? false : $advancedCustom->doNotIndentifyByUserName; $obj->hideRemoveChannelFromModeYoutube = !isset($advancedCustom->hideRemoveChannelFromModeYoutube) ? false : $advancedCustom->hideRemoveChannelFromModeYoutube; $obj->showChannelBannerOnModeYoutube = !isset($advancedCustom->showChannelBannerOnModeYoutube) ? false : $advancedCustom->showChannelBannerOnModeYoutube; $obj->encryptPasswordsWithSalt = !isset($advancedCustom->encryptPasswordsWithSalt) ? false : $advancedCustom->encryptPasswordsWithSalt; $obj->requestCaptchaAfterLoginsAttempts = !isset($advancedCustom->requestCaptchaAfterLoginsAttempts) ? 0 : $advancedCustom->requestCaptchaAfterLoginsAttempts; $obj->disableSignOutButton = false; $obj->disableNativeSignUp = !isset($advancedCustom->disableNativeSignUp) ? false : $advancedCustom->disableNativeSignUp; $obj->disableNativeSignIn = !isset($advancedCustom->disableNativeSignIn) ? false : $advancedCustom->disableNativeSignIn; $obj->disablePersonalInfo = !isset($advancedCustom->disablePersonalInfo) ? true : $advancedCustom->disablePersonalInfo; $obj->userCanChangeUsername = true; $obj->signInOnRight = false; $obj->doNotShowRightProfile = false; $obj->doNotShowLeftProfile = false; $obj->forceLoginToBeTheEmail = false; // added on 2019-02-11 $o = new stdClass(); $o->type = "textarea"; $o->value = ""; $obj->messageToAppearBelowLoginBox = $o; $obj->keepViewerOnChannel = false; $obj->showLeaveChannelButton = false; $obj->addChannelNameOnLinks = true; $obj->doNotShowTopBannerOnChannel = false; $obj->doNotShowMyChannelNameOnBasicInfo = false; $obj->doNotShowMyAnalyticsCodeOnBasicInfo = false; $obj->doNotShowMyAboutOnBasicInfo = false; $obj->MyChannelLabel = "My Channel"; $obj->afterLoginGoToMyChannel = false; $obj->afterLoginGoToURL = ""; $obj->afterLogoffGoToMyChannel = false; $obj->afterLogoffGoToURL = ""; $obj->allowDonationLink = false; $obj->donationButtonLabel = __('Donation'); ; $obj->showEmailVerifiedMark = true; $obj->Checkmark1Enabled = true; $obj->Checkmark1HTML = ''; $obj->Checkmark2Enabled = true; $obj->Checkmark2HTML = ''; $obj->Checkmark3Enabled = true; $obj->Checkmark3HTML = ''; return $obj; } public function getUserOptions() { $obj = $this->getDataObject(); if ($obj->Checkmark1Enabled) { $userOptions["Checkmark 1"] = "checkmark1"; } if ($obj->Checkmark2Enabled) { $userOptions["Checkmark 2"] = "checkmark2"; } if ($obj->Checkmark3Enabled) { $userOptions["Checkmark 3"] = "checkmark3"; } return $userOptions; } static function canDownloadVideosFromUser($users_id) { global $config; $obj = AVideoPlugin::getObjectDataIfEnabled("CustomizeUser"); if (empty($obj) || empty($obj->userCanAllowFilesDownload)) { return $config->getAllow_download(); } $user = new User($users_id); return !empty($user->getExternalOption('userCanAllowFilesDownload')); } static function setCanDownloadVideosFromUser($users_id, $value = true) { $obj = AVideoPlugin::getObjectDataIfEnabled("CustomizeUser"); if (empty($obj) || empty($obj->userCanAllowFilesDownload)) { return false; } $user = new User($users_id); return $user->addExternalOptions('userCanAllowFilesDownload', $value); } static function canShareVideosFromUser($users_id) { global $advancedCustom; if (!empty($advancedCustom->disableShareAndPlaylist)) { return false; } $obj = AVideoPlugin::getObjectDataIfEnabled("CustomizeUser"); if (empty($obj) || empty($obj->userCanAllowFilesShare)) { return true; } $user = new User($users_id); return !empty($user->getExternalOption('userCanAllowFilesShare')); } static function setCanShareVideosFromUser($users_id, $value = true) { $obj = AVideoPlugin::getObjectDataIfEnabled("CustomizeUser"); if (empty($obj) || empty($obj->userCanAllowFilesShare)) { return false; } $user = new User($users_id); return $user->addExternalOptions('userCanAllowFilesShare', $value); } static function getSwitchUserCanAllowFilesDownload($users_id) { global $global; include $global['systemRootPath'] . 'plugin/CustomizeUser/switchUserCanAllowFilesDownload.php'; } static function getSwitchUserCanAllowFilesShare($users_id) { global $global; include $global['systemRootPath'] . 'plugin/CustomizeUser/switchUserCanAllowFilesShare.php'; } public function getMyAccount($users_id) { $objcu = AVideoPlugin::getObjectDataIfEnabled("CustomizeUser"); if (!empty($objcu) && !empty($objcu->userCanAllowFilesDownload)) { echo '
'; self::getSwitchUserCanAllowFilesDownload($users_id); echo '
'; } if (!empty($objcu) && !empty($objcu->userCanAllowFilesShare)) { echo '
'; self::getSwitchUserCanAllowFilesShare($users_id); echo '
'; } } public function getTags() { return array('free', 'customization', 'users'); } public function getChannelButton() { global $global, $isMyChannel; if (!$isMyChannel) { return ""; } $objcu = AVideoPlugin::getObjectDataIfEnabled("CustomizeUser"); echo "
"; if (!empty($objcu) && !empty($objcu->userCanAllowFilesDownload)) { echo '
'; echo '
'; self::getSwitchUserCanAllowFilesDownload(User::getId()); echo '
'; } if (!empty($objcu) && !empty($objcu->userCanAllowFilesShare)) { echo '
'; echo '
'; self::getSwitchUserCanAllowFilesShare(User::getId()); echo '
'; } echo "
"; } public function getVideoManagerButton() { global $isMyChannel; $isMyChannel = true; return self::getChannelButton(); } static function canDownloadVideosFromVideo($videos_id) { $video = new Video("", "", $videos_id); if (empty($video)) { return false; } $users_id = $video->getUsers_id(); if (!self::canDownloadVideosFromUser($users_id)) { return false; } $category = new Category($video->getCategories_id()); if (is_object($category) && !$category->getAllow_download()) { return false; } $obj = AVideoPlugin::getObjectDataIfEnabled("CustomizeUser"); if (!empty($obj->userCanAllowFilesDownloadSelectPerVideo)) { if (empty($video->getCan_download())) { return false; } } return true; } static function canShareVideosFromVideo($videos_id) { $video = new Video("", "", $videos_id); if (empty($video)) { return false; } $users_id = $video->getUsers_id(); if (!self::canShareVideosFromUser($users_id)) { return false; } $obj = AVideoPlugin::getObjectDataIfEnabled("CustomizeUser"); if (!empty($obj->userCanAllowFilesShareSelectPerVideo)) { if (empty($video->getCan_share())) { return false; } } return true; } public function onUserSignup($users_id) { global $global; $obj = $this->getDataObject(); if ($obj->sendVerificationMailAutomaic) { url_get_contents("{$global['webSiteRootURL']}objects/userVerifyEmail.php?users_id=$users_id"); } } public function getWatchActionButton($videos_id) { global $global, $video; $obj = $this->getDataObject(); include $global['systemRootPath'] . 'plugin/CustomizeUser/actionButton.php'; } public function getHTMLMenuRight() { global $global; $obj = $this->getDataObject(); if ($obj->keepViewerOnChannel) { include $global['systemRootPath'] . 'plugin/CustomizeUser/channelMenuRight.php'; } } public function getModeYouTube($videos_id) { global $global; $cansee = User::canWatchVideoWithAds($videos_id); if (!$cansee) { if (!AVideoPlugin::isEnabled('Gallery') && !AVideoPlugin::isEnabled('YouPHPFlix2') && !AVideoPlugin::isEnabled('YouTube')) { header("Location: {$global['webSiteRootURL']}user?msg=" . urlencode(__("Sorry, this video is private"))); } else { header("Location: {$global['webSiteRootURL']}?msg=" . urlencode(__("Sorry, this video is private"))); } exit; } } public function getEmbed($videos_id) { $this->getModeYouTube($videos_id); } public function getStart() { global $global; $obj = $this->getDataObject(); $thisScriptFile = pathinfo($_SERVER["SCRIPT_FILENAME"]); if (!empty($obj->userMustBeLoggedIn) && ($thisScriptFile["basename"] === 'index.php' || $thisScriptFile["basename"] === "channel.php" || $thisScriptFile["basename"] === "channels.php" || $thisScriptFile["basename"] === "trending.php") && !User::isLogged()) { $actual_link = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on' ? "https" : "http") . "://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]"; header("Location: {$global['webSiteRootURL']}user?redirectUri=" . urlencode($actual_link)); exit; } } } \ No newline at end of file diff --git a/plugin/Gallery/functions.php b/plugin/Gallery/functions.php index 3e36cfb1b..8669a383e 100644 --- a/plugin/Gallery/functions.php +++ b/plugin/Gallery/functions.php @@ -1,381 +1,388 @@

" . $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()) { global $global, $config, $obj, $advancedCustom; $countCols = 0; $obj = AVideoPlugin::getObjectData("Gallery"); $zindex = 1000; $startG = microtime(true); 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" : ""; $name = User::getNameIdentificationById($value['users_id']); - $name .= " ".User::getEmailVerifiedIcon($value['users_id']);; + $name .= " " . User::getEmailVerifiedIcon($value['users_id']); + ; // make a row each 6 cols if ($countCols % $obj->screenColsLarge === 0) { echo '
'; } $countCols ++; ?>
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" />

- + - + 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)) { ?> -
" > - + Description)) { + $desc = str_replace(array('"', "'", "#", "/"), array('``', "`", "", ""), preg_replace("/\r|\n/", "", nl2br(trim($value['description'])))); + if (!empty($desc)) { + ?> + ", text: "
"});return false;' >
+
- +
+ if (!(!empty($files['m3u8']) && empty($files['mp4']))) { + ?> -
- -
+

diff --git a/view/managerVideos_body.php b/view/managerVideos_body.php index b813a2a01..0ff9a7a31 100644 --- a/view/managerVideos_body.php +++ b/view/managerVideos_body.php @@ -1,2066 +1,2078 @@
onlyVerifiedEmailCanUpload) && $advancedCustomUser->onlyVerifiedEmailCanUpload && User::isVerified()) || (isset($advancedCustomUser->onlyVerifiedEmailCanUpload) && !$advancedCustomUser->onlyVerifiedEmailCanUpload) || !isset($advancedCustomUser->onlyVerifiedEmailCanUpload)) { if (empty($advancedCustom->doNotShowEncoderButton)) { if (!empty($config->getEncoderURL())) { ?>
doNotShowUploadMP4Button)) { ?> doNotShowEmbedButton)) { ?>
$secondsTotal) { $percent = intval($secondsTotal / $secondsLimit * 100); } else { $percent = 100; } ?> and you have minutes of storage
% of your storage limit used
getDisable_youtubeupload()) { ?> userCanNotChangeCategory) || User::isAdmin()) { ?> -
- - +
+
(SEO .txt file) (Permalink .txt file)
getDisable_youtubeupload())) { ?>

Let us upload your video to YouTube

Before you start

  1. Enable Google Login and get your google ID and Key
  2. Go to https://console.developers.google.com on dashboard Enable YouTube Data API v3
  3. In credentials authorized this redirect URIs objects/youtubeUpload.json.php
  4. You can find more help on https://developers.google.com/youtube/v3/getting-started
disableHTMLDescription)) { ?>