1
0
Fork 0
mirror of https://github.com/DanielnetoDotCom/YouPHPTube synced 2025-10-03 09:49:28 +02:00

Making ready Wallet plugin

This commit is contained in:
daniel 2018-04-08 14:58:31 -03:00
parent e4db02cd49
commit d88bd01dc5
39 changed files with 2509 additions and 1640 deletions

View file

@ -38,6 +38,7 @@ CREATE TABLE IF NOT EXISTS `categories` (
`clean_name` VARCHAR(45) NOT NULL,
`description` TEXT NULL,
`nextVideoOrder` INT(2) NOT NULL DEFAULT '0',
`parentId` INT NOT NULL DEFAULT '0',
`created` DATETIME NOT NULL,
`modified` DATETIME NOT NULL,
`iconClass` VARCHAR(45) NOT NULL DEFAULT 'fa fa-folder',
@ -473,6 +474,19 @@ CREATE TABLE IF NOT EXISTS `comments_likes` (
ON UPDATE CASCADE)
ENGINE = InnoDB;
-- -----------------------------------------------------
-- Table `category_type_cache`
-- -----------------------------------------------------
CREATE TABLE `category_type_cache` (
`categoryId` int(11) NOT NULL,
`type` int(2) NOT NULL COMMENT '0=both, 1=audio, 2=video' DEFAULT 0,
`manualSet` int(1) NOT NULL COMMENT '0=auto, 1=manual' DEFAULT 0
) ENGINE=InnoDB;
ALTER TABLE `category_type_cache`
ADD UNIQUE KEY `categoryId` (`categoryId`);
COMMIT;
SET SQL_MODE=@OLD_SQL_MODE;
SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS;

View file

@ -306,6 +306,7 @@ $t['Yes, delete it!'] = "Ja lösche es!";
$t['You are hosting %d minutes and %d seconds of video'] = "Du verfügst über % d Minuten und % d Sekunden an Videos";
$t['You are running YouPHPTube version %s!'] = "Du nutzt YouPHPTube Version %s!";
$t['You asked for a recover link, click on the provided link'] = "Du hast nach einem Wiederherstellungslink gefragt, klicke auf den Link";
$t['You%20can%20not%20manage'] = "Du%20kannst"; // This is gramaticly not correct and only used in a error-field..
$t['You can not Manage This Video'] = "Du kannst das Videos nicht managen";
$t['You can not manage ads'] = "Du kannst keine Werbung managen";
$t['You can not manage categories'] = "Du kannst keine Kategorien managen";

View file

@ -1,4 +1,5 @@
<?php
error_reporting(0);
require_once 'category.php';
header('Content-Type: application/json');
$categories = Category::getAllCategories();
@ -7,5 +8,17 @@ $breaks = array("<br />","<br>","<br/>");
foreach ($categories as $key => $value) {
$categories[$key]['iconHtml'] = "<span class='$value[iconClass]'></span>";
$categories[$key]['description'] = str_ireplace($breaks, "\r\n", $value['description']);
$sql = "SELECT * FROM `category_type_cache` WHERE categoryId = '".$value['id']."';";
$res = $global['mysqli']->query($sql);
$catTypeCache = $res->fetch_assoc();
if($catTypeCache){
if($catTypeCache['manualSet']=="0"){
$categories[$key]['type'] = "3";
} else {
$categories[$key]['type'] = $catTypeCache['type'];
}
} else {
$categories[$key]['type'] = "3";
}
}
echo '{ "current": '.$_POST['current'].',"rowCount": '.$_POST['rowCount'].', "total": '.$total.', "rows":'. json_encode($categories).'}';

View file

@ -1,4 +1,5 @@
<?php
error_reporting(0);
header('Content-Type: application/json');
if (empty($global['systemRootPath'])) {
$global['systemRootPath'] = '../';
@ -16,4 +17,6 @@ $obj->setClean_name($_POST['clean_name']);
$obj->setDescription(nl2br ($_POST['description']));
$obj->setIconClass($_POST['iconClass']);
$obj->setNextVideoOrder($_POST['nextVideoOrder']);
$obj->setParentId($_POST['parentId']);
$obj->setType($_POST['type']);
echo '{"status":"'.$obj->save().'"}';

View file

@ -1,4 +1,5 @@
<?php
error_reporting(0);
header('Content-Type: application/json');
if (empty($global['systemRootPath'])) {
$global['systemRootPath'] = '../';

View file

@ -1,5 +1,5 @@
<?php
error_reporting(0);
header('Content-Type: application/json');
if (empty($global['systemRootPath'])) {
$global['systemRootPath'] = '../';

View file

@ -1,5 +1,5 @@
<?php
error_reporting(0);
header('Content-Type: application/json');
if (empty($global['systemRootPath'])) {
$global['systemRootPath'] = '../';

View file

@ -1,4 +1,5 @@
<?php
error_reporting(0);
require_once '../videos/configuration.php';
require_once 'video_ad.php';
require_once $global['systemRootPath'] . 'objects/functions.php';

View file

@ -1,4 +1,5 @@
<?php
error_reporting(0);
require_once '../videos/configuration.php';
require_once 'video.php';
require_once $global['systemRootPath'] . 'objects/functions.php';

View file

@ -1,5 +1,5 @@
<?php
error_reporting(0);
require_once '../videos/configuration.php';
require_once 'video.php';
$obj = new stdClass();

View file

@ -1,36 +0,0 @@
-- MySQL Workbench Synchronization
-- Generated: 2017-09-12 22:18
-- Model: New Model
-- Version: 1.0
-- Project: Name of the project
-- Author: Daniel
SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0;
SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0;
SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='TRADITIONAL,ALLOW_INVALID_DATES';
CREATE TABLE IF NOT EXISTS `ip2location_db1`(
`ip_from` INT(10) UNSIGNED,
`ip_to` INT(10) UNSIGNED,
`country_code` CHAR(2),
`country_name` VARCHAR(64),
INDEX `idx_ip_from` (`ip_from`),
INDEX `idx_ip_to` (`ip_to`),
INDEX `idx_ip_from_to` (`ip_from`, `ip_to`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
LOAD DATA LOCAL
INFILE '../plugin/CountryRedirect/install/IP2LOCATION-LITE-DB1.CSV'
INTO TABLE
`ip2location_db1`
FIELDS TERMINATED BY ','
ENCLOSED BY '"'
LINES TERMINATED BY '\r\n'
IGNORE 0 LINES;
SET SQL_MODE=@OLD_SQL_MODE;
SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS;
SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS;

View file

@ -38,6 +38,7 @@ class Gallery extends PluginAbstract {
$obj->DateAdded = true;
$obj->DateAddedRowCount = 12;
$obj->sortReverseable = false;
$obj->SubCategorys = false;
return $obj;
}

View file

@ -0,0 +1,119 @@
<?php
$orderString = "";
$_GET["dateAddedOrder"] = "";
$info[0] = "";
$info[1] = "";
$info[2] = "";
$_GET['page'] = "";
?>
<div class="clear clearfix">
<h3 class="galleryTitle">
<i class="glyphicon glyphicon-sort-by-attributes"></i> <?php
if (empty($_GET["dateAddedOrder"])) {
$_GET["dateAddedOrder"] = "DESC";
}
if ($obj->sortReverseable) {
$info = createOrderInfo("dateAddedOrder", "newest", "oldest", $orderString);
echo __("Date added (" . $info[2] . ")") . " (Page " . $_GET['page'] . ") <a href='" . $info[0] . "' >" . $info[1] . "</a>";
} else {
echo __("Date added (newest)");
}
?>
</h3>
<div class="row">
<?php
$countCols = 0;
unset($_POST['sort']);
$_POST['sort']['created'] = $_GET['dateAddedOrder'];
$_POST['rowCount'] = $obj->DateAddedRowCount;
$videos = Video::getAllVideos();
foreach ($videos as $value) {
$img_portrait = ($value['rotation'] === "90" || $value['rotation'] === "270") ? "img-portrait" : "";
$name = User::getNameIdentificationById($value['users_id']);
// make a row each 6 cols
if ($countCols % 6 === 0) {
echo '</div><div class="row aligned-row ">';
}
$countCols++;
?>
<div class="col-lg-2 col-sm-4 col-xs-6 galleryVideo thumbsImage fixPadding">
<a href="<?php echo $global['webSiteRootURL']; ?>cat/<?php echo $value['clean_category']; ?>/video/<?php echo $value['clean_title']; ?>" title="<?php echo $value['title']; ?>" >
<?php
$images = Video::getImageFromFilename($value['filename'], $value['type']);
$imgGif = $images->thumbsGif;
$poster = $images->thumbsJpg;
?>
<div class="aspectRatio16_9">
<img src="<?php echo $images->thumbsJpgSmall; ?>" data-src="<?php echo $poster; ?>" alt="<?php echo $value['title']; ?>" class="thumbsJPG img img-responsive <?php echo $img_portrait; ?> rotate<?php echo $value['rotation']; ?>" id="thumbsJPG<?php echo $value['id']; ?>"/>
<?php
if (!empty($imgGif)) {
?>
<img src="<?php echo $global['webSiteRootURL']; ?>img/loading-gif.png" data-src="<?php echo $imgGif; ?>" style="position: absolute; top: 0; display: none;" alt="<?php echo $value['title']; ?>" id="thumbsGIF<?php echo $value['id']; ?>" class="thumbsGIF img-responsive <?php echo $img_portrait; ?> rotate<?php echo $value['rotation']; ?>" height="130" />
<?php } ?>
</div>
<span class="duration"><?php echo Video::getCleanDuration($value['duration']); ?></span>
</a>
<a class="h6" href="<?php echo $global['webSiteRootURL']; ?>video/<?php echo $value['clean_title']; ?>" title="<?php echo $value['title']; ?>">
<h2><?php echo $value['title']; ?></h2>
</a>
<div class="text-muted galeryDetails">
<div>
<?php
$value['tags'] = Video::getTags($value['id']);
foreach ($value['tags'] as $value2) {
if ($value2->label === __("Group")) {
?>
<span class="label label-<?php echo $value2->type; ?>"><?php echo $value2->text; ?></span>
<?php
}
}
?>
</div>
<div>
<i class="fa fa-eye"></i>
<span itemprop="interactionCount">
<?php echo number_format($value['views_count'], 0); ?> <?php echo __("Views"); ?>
</span>
</div>
<div>
<i class="fa fa-clock-o"></i>
<?php
echo humanTiming(strtotime($value['videoCreation'])), " ", __('ago');
?>
</div>
<div>
<i class="fa fa-user"></i>
<a class="text-muted" href="<?php echo $global['webSiteRootURL']; ?>channel/<?php echo $value['users_id']; ?>/">
<?php
echo $name;
?>
</a>
<?php
if ((!empty($value['description'])) && ($obj->Description)) {
?>
<button type="button" class="btn btn-xs" data-toggle="popover" data-trigger="focus" data-placement="top" data-html="true" style="background-color: inherit; color: inherit;" title="<?php echo $value['title']; ?>" data-content="<div><?php echo str_replace('"', '&quot;', nl2br(textToLink($value['description']))); ?></div>">Description</button>
<?php } ?>
</div>
<?php
if (Video::canEdit($value['id'])) {
?>
<div>
<a href="<?php echo $global['webSiteRootURL']; ?>mvideos?video_id=<?php echo $value['id']; ?>" class="text-primary"><i class="fa fa-edit"></i> <?php echo __("Edit Video"); ?></a>
</div>
<?php
}
?>
</div>
</div>
<?php
}
?>
</div>
<div class="row">
<ul class="pages">
</ul>
</div>
</div>

View file

@ -1,67 +1,89 @@
<?php
if (!file_exists('../videos/configuration.php')) {
if (!file_exists('../install/index.php')) {
if (! file_exists('../videos/configuration.php')) {
if (! file_exists('../install/index.php')) {
die("No Configuration and no Installation");
}
header("Location: install/index.php");
}
require_once '../videos/configuration.php';
require_once $global['systemRootPath'] . 'objects/user.php';
require_once $global['systemRootPath'] . 'objects/functions.php';
$obj = YouPHPTubePlugin::getObjectData("Gallery");
if (!empty($_GET['type'])) {
if (! empty($_GET['type'])) {
if ($_GET['type'] == 'audio') {
$_SESSION['type'] = 'audio';
} else if ($_GET['type'] == 'video') {
$_SESSION['type'] = 'video';
} else {
$_SESSION['type'] = "";
unset($_SESSION['type']);
}
}
require_once $global['systemRootPath'] . 'objects/video.php';
if($obj->sortReverseable){
if(strpos($_SERVER['REQUEST_URI'],"?")!=false){
$orderString = $_SERVER['REQUEST_URI']."&";
require_once $global['systemRootPath'] . 'objects/category.php';
$currentCat;
$currentCatType;
if(!empty($_GET['catName'])){
$currentCat = Category::getCategoryByName($_GET['catName']);
$currentCatType = Category::getCategoryType($currentCat['id']);
}
if ((empty($_GET['type']))&&(!empty($currentCatType))) {
if($currentCatType['type']=="1"){
$_SESSION['type'] = "audio";
} else if($currentCatType['type']=="2"){
$_SESSION['type'] = "video";
} else {
$orderString = $_SERVER['REQUEST_URI']."/?";
unset($_SESSION['type']);
}
$orderString = str_replace("&&","&",$orderString);
$orderString = str_replace("//","/",$orderString);
}
require_once $global['systemRootPath'] . 'objects/video.php';
function createOrderInfo($getName,$mostWord,$lessWord,$orderString){
if ($obj->sortReverseable) {
if (strpos($_SERVER['REQUEST_URI'], "?") != false) {
$orderString = $_SERVER['REQUEST_URI'] . "&";
} else {
$orderString = $_SERVER['REQUEST_URI'] . "/?";
}
$orderString = str_replace("&&", "&", $orderString);
$orderString = str_replace("//", "/", $orderString);
function createOrderInfo($getName, $mostWord, $lessWord, $orderString)
{
$upDown = "";
$mostLess = "";
$tmpOrderString = $orderString;
if($_GET[$getName]=="DESC"){
if(strpos($orderString,$getName."=DESC")){
$tmpOrderString = substr($orderString,0,strpos($orderString,$getName."=DESC")).$getName."=ASC".substr($orderString,strpos($orderString,$getName."=DESC")+strlen($getName."=DESC"),strlen($orderString));
if ($_GET[$getName] == "DESC") {
if (strpos($orderString, $getName . "=DESC")) {
$tmpOrderString = substr($orderString, 0, strpos($orderString, $getName . "=DESC")) . $getName . "=ASC" . substr($orderString, strpos($orderString, $getName . "=DESC") + strlen($getName . "=DESC"), strlen($orderString));
} else {
$tmpOrderString .= $getName."=ASC";
$tmpOrderString .= $getName . "=ASC";
}
$upDown = "<span class='glyphicon glyphicon-arrow-up' >".__("Up")."</span>";
$upDown = "<span class='glyphicon glyphicon-arrow-up' >" . __("Up") . "</span>";
$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));
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";
$tmpOrderString .= $getName . "=DESC";
}
$upDown = "<span class='glyphicon glyphicon-arrow-down'>".__("Down")."</span>";
$upDown = "<span class='glyphicon glyphicon-arrow-down'>" . __("Down") . "</span>";
$mostLess = $lessWord;
}
if(substr($tmpOrderString,strlen($tmpOrderString)-1,strlen($tmpOrderString))=="&"){
$tmpOrderString = substr($tmpOrderString,0,strlen($tmpOrderString)-1);
if (substr($tmpOrderString, strlen($tmpOrderString) - 1, strlen($tmpOrderString)) == "&") {
$tmpOrderString = substr($tmpOrderString, 0, strlen($tmpOrderString) - 1);
}
return array($tmpOrderString,$upDown,$mostLess);
return array($tmpOrderString, $upDown, $mostLess);
}
}
$video = Video::getVideo("", "viewableNotAd", false, false, true);
if (empty($video)) {
$video = Video::getVideo("", "viewableNotAd");
}
@ -71,29 +93,32 @@ if (empty($_GET['page'])) {
} else {
$_GET['page'] = intval($_GET['page']);
}
$_POST['rowCount'] = 24;
$_POST['current'] = $_GET['page'];
$_POST['sort']['created'] = 'desc';
$videos = Video::getAllVideos("viewableNotAd");
unset($_POST['sort']);
foreach ($videos as $key => $value) {
$name = empty($value['name']) ? $value['user'] : $value['name'];
$videos[$key]['creator'] = '<div class="pull-left"><img src="' . User::getPhoto($value['users_id']) . '" alt="" class="img img-responsive img-circle" style="max-width: 20px;"/></div><div class="commentDetails" style="margin-left:25px;"><div class="commenterName"><strong>' . $name . '</strong> <small>' . humanTiming(strtotime($value['videoCreation'])) . '</small></div></div>';
}
$total = Video::getTotalVideos("viewableNotAd");
$totalPages = ceil($total / $_POST['rowCount']);
?>
<!DOCTYPE html>
<html lang="<?php echo $_SESSION['language']; ?>">
<head>
<title><?php echo $config->getWebSiteTitle(); ?></title>
<meta name="generator" content="YouPHPTube - A Free Youtube Clone Script" />
<?php
include $global['systemRootPath'] . 'view/include/head.php';
<head>
<title><?php
echo $config->getWebSiteTitle();
?></title>
<meta name="generator"
content="YouPHPTube - A Free Youtube Clone Script" />
<?php include $global['systemRootPath'] . 'view/include/head.php';
?>
<script>
$(document).ready(function () {
// Total Itens <?php echo $total; ?>
$('.pages').bootpag({
total: <?php echo $totalPages; ?>,
page: <?php echo $_GET['page']; ?>,
@ -102,10 +127,12 @@ $totalPages = ceil($total / $_POST['rowCount']);
<?php
$url = '';
$args = '';
if(strpos($_SERVER['REQUEST_URI'],"?")!=false){
$args = substr($_SERVER['REQUEST_URI'], strpos($_SERVER['REQUEST_URI'],"?"), strlen($_SERVER['REQUEST_URI']));
if (strpos($_SERVER['REQUEST_URI'], "?") != false) {
$args = substr($_SERVER['REQUEST_URI'], strpos($_SERVER['REQUEST_URI'], "?"), strlen($_SERVER['REQUEST_URI']));
}
echo 'var args = "'.$args.'";';
echo 'var args = "' . $args . '";';
if (strpos($_SERVER['REQUEST_URI'], "/cat/") === false) {
$url = $global['webSiteRootURL'] . "page/";
} else {
@ -116,48 +143,149 @@ $totalPages = ceil($total / $_POST['rowCount']);
});
});
</script>
</head>
</head>
<body>
<?php
include 'include/navbar.php';
?>
<body>
<?php include 'include/navbar.php'; ?>
<div class="container-fluid gallery" itemscope itemtype="http://schema.org/VideoObject">
<div class="row text-center" style="padding: 10px;">
<?php
echo $config->getAdsense();
?>
<?php echo $config->getAdsense(); ?>
</div>
<div class="col-sm-10 col-sm-offset-1 list-group-item">
<?php
if ((! empty($videos)) || ($obj->SubCategorys)) {
?>
<div class="row mainArea">
<?php if (($obj->CategoryDescription) && (! empty($_GET['catName']))) { ?>
<h1 style="text-align: center;"><?php echo $video['category']; ?></h1>
<p style="margin-left: 10%; margin-right: 10%; max-height: 200px; overflow-x: auto;"><?php echo $video['category_description']; ?></p>
<?php }
if (($obj->SubCategorys) && (! empty($_GET['catName']))) {
unset($_POST['rowCount']);
if(!empty($currentCat)){
$childCategories = Category::getChildCategories($currentCat['id']);
$parentCat = Category::getCategory($currentCat['parentId']);
// -1 is a personal workaround only
if((empty($parentCat))&&(($currentCat['parentId'] == "0") || ($currentCat['parentId'] == "-1"))) {
if(!empty($_GET['catName'])){ ?>
<div>
<a class="btn btn-primary" href="<?php echo $global['webSiteRootURL']; ?>"><?php echo __("Back to startpage"); ?> </a>
</div>
<?php }
} else if(!empty($parentCat)){ ?>
<div>
<a class="btn btn-primary" href="<?php echo $global['webSiteRootURL']; ?>cat/<?php echo $parentCat['clean_name']; ?>"><?php echo __("Back to") . " " . $parentCat['name']; ?> </a>
</div>
<?php }
} else {
?>
<div>
<a class="btn btn-primary" onclick="window.history.back();" ><?php echo __("Back"); ?> </a>
</div>
<?php
}
if ((!empty($childCategories)) && ((($currentCat['parentId'] != "0") || ($currentCat['parentId'] != "-1")))) { ?> <div class="clear clearfix">
<h3 class="galleryTitle"><i class="glyphicon glyphicon-download"></i>
<?php echo __("Sub-Category-Gallery"); ?>
<span class="badge"><?php echo count($childCategories); ?></span>
</h3>
<div class="row">
<?php
$countCols = 0;
$originalCat = $_GET['catName'];
unset($_POST['sort']);
$_POST['sort']['title'] = "ASC";
foreach ($childCategories as $cat) {
$_GET['catName'] = $cat['clean_name'];
$description = $cat['description'];
$_GET['limitOnceToOne'] = "1";
$videos = Video::getAllVideos();
// make a row each 6 cols
if ($countCols % 6 === 0) {
echo '</div><div class="row aligned-row ">';
}
$countCols ++;
unset($_GET['catName']);
?>
<div class="col-lg-2 col-md-4 col-sm-4 col-xs-6 galleryVideo thumbsImage fixPadding">
<a href="<?php echo $global['webSiteRootURL']; ?>cat/<?php echo $cat['clean_name']; ?>" title="<?php $cat['name']; ?>">
<div class="aspectRatio16_9">
<?php
if (!empty($videos)) {
foreach ($videos as $value) {
$img_portrait = ($value['rotation'] === "90" || $value['rotation'] === "270") ? "img-portrait" : "";
$images = Video::getImageFromFilename($value['filename'], $value['type']);
$poster = $images->thumbsJpg;
?>
<img src="<?php echo $poster; ?>" alt="" data-toggle="tooltip" title="<?php echo $description; ?>" class="thumbsJPG img img-responsive <?php echo $img_portrait; ?> rotate<?php echo $value['rotation']; ?>" id="thumbsJPG<?php echo $value['id']; ?>" />
<?php if ((! empty($imgGif)) && (! $o->LiteGalleryNoGifs)) { ?>
<img src="<?php echo $imgGif; ?>" style="position: absolute; top: 0; display: none;" alt="" data-toggle="tooltip" title="<?php echo $description; ?>" id="thumbsGIF<?php echo $value['id']; ?>" class="thumbsGIF img-responsive <?php echo $img_portrait; ?> rotate<?php echo $value['rotation']; ?>" height="130" />
<?php }
$videoCount = $global['mysqli']->query("SELECT COUNT(title) FROM videos WHERE categories_id = " . $value['categories_id'] . ";");
break;
}
} else {
$poster = $global['webSiteRootURL'] . "view/img/notfound.jpg"; ?>
<img src="<?php echo $poster; ?>" alt="" data-toggle="tooltip" title="<?php echo $description; ?>" class="thumbsJPG img img-responsive" id="thumbsJPG<?php echo $cat['id']; ?>" />
<?php
$videoCount = $global['mysqli']->query("SELECT COUNT(title) FROM videos WHERE categories_id = " . $cat['id'] . ";");
} ?>
</div>
<div class="videoInfo">
<?php if ($videoCount) { ?>
<span class="label label-default" style="top: 1px !important; position: absolute;">
<i class="glyphicon glyphicon-cd"></i>
<?php echo $videoCount->fetch_array()[0]; ?>
</span>
<?php } ?>
</div>
<div data-toggle="tooltip" title="<?php echo $cat['name']; ?>" class="tile__title" style="border-radius: 10px; background-color: black; color: white; position: absolute; margin-left: 10%; width: 80% !important; bottom: 40% !important; opacity: 0.8 !important; text-align: center;">
<?php echo $cat['name']; ?>
</div>
</a>
</div>
<?php } // end of foreach-cat
unset($_POST['sort']);
if(!empty($originalCat)){
$_GET['catName'] = $originalCat;
}
?>
</div>
</div>
<?php
}
}
}
$videos = Video::getAllVideos("viewableNotAd");
foreach ($videos as $key => $value) {
$name = empty($value['name']) ? $value['user'] : $value['name'];
$videos[$key]['creator'] = '<div class="pull-left"><img src="' . User::getPhoto($value['users_id']) . '" alt="" class="img img-responsive img-circle" style="max-width: 20px;"/></div><div class="commentDetails" style="margin-left:25px;"><div class="commenterName"><strong>' . $name . '</strong> <small>' . humanTiming(strtotime($value['videoCreation'])) . '</small></div></div>';
}
if (! empty($videos)) {
$name = User::getNameIdentificationById($video['users_id']);
$img_portrait = ($video['rotation'] === "90" || $video['rotation'] === "270") ? "img-portrait" : "";
?>
<?php if (($obj->CategoryDescription)&&(!empty($_GET['catName']))) { ?>
<h1 style="text-align: center;"><?php echo $video['category']; ?></h1>
<p style="margin-left: 10%; margin-right: 10%; max-height: 200px; overflow-x:auto;"><?php echo $video['category_description']; ?></p>
<?php } ?>
<?php if ($obj->SubCategorys == false) { ?>
<div class="row mainArea">
<?php if ($obj->BigVideo) { ?>
<div class="clear clearfix firstRow">
<?php } if ($obj->BigVideo) { ?>
<div class="clear clearfix">
<div class="row thumbsImage">
<div class="col-sm-6">
<a href="<?php echo $global['webSiteRootURL']; ?>cat/<?php echo $video['clean_category']; ?>/video/<?php echo $video['clean_title']; ?>"
title="<?php echo $video['title']; ?>" style="" >
<a href="<?php echo $global['webSiteRootURL']; ?>cat/<?php echo $video['clean_category']; ?>/video/<?php echo $video['clean_title']; ?>" title="<?php echo $video['title']; ?>" style="">
<?php
$images = Video::getImageFromFilename($video['filename'], $video['type']);
$imgGif = $images->thumbsGif;
$poster = $images->poster;
?>
<div class="aspectRatio16_9">
<img src="<?php echo $images->thumbsJpg; ?>" data-src="<?php echo $poster; ?>" alt="<?php echo $video['title']; ?>" class="thumbsJPG img img-responsive " style="height: auto; width: 100%;" id="thumbsJPG<?php echo $video['id']; ?>" />
<?php
if (!empty($imgGif)) {
?>
<img src="<?php echo $images->thumbsJpgSmall; ?>" data-src="<?php echo $poster; ?>" alt="<?php echo $video['title']; ?>" class="thumbsJPG img img-responsive " style="height: auto; width: 100%;" id="thumbsJPG<?php echo $video['id']; ?>" />
<?php if (!empty($imgGif)) { ?>
<img src="<?php echo $global['webSiteRootURL']; ?>img/loading-gif.png" data-src="<?php echo $imgGif; ?>" style="position: absolute; top: 0; display: none;" alt="<?php echo $video['title']; ?>" id="thumbsGIF<?php echo $video['id']; ?>" class="thumbsGIF img-responsive <?php echo @$img_portrait; ?> rotate<?php echo $video['rotation']; ?>" height="130" />
<?php } ?>
</div>
@ -181,55 +309,54 @@ $totalPages = ceil($total / $_POST['rowCount']);
<span class="label label-<?php echo $value2->type; ?>"><?php echo $value2->text; ?></span>
<?php
}
}
?>
} ?>
</div>
<div>
<i class="fa fa-eye"></i>
<span itemprop="interactionCount">
<?php echo number_format($video['views_count'], 0); ?> <?php echo __("Views"); ?>
</span>
<span itemprop="interactionCount"><?php echo number_format($video['views_count'], 0); ?> <?php echo __("Views"); ?></span>
</div>
<?php if(empty($_GET['catName'])) { ?>
<div>
<a class="label label-default" href="<?php echo $global['webSiteRootURL']; ?>cat/<?php echo $video['clean_category']; ?>/">
<?php echo $video['category']; ?>
</a>
</div>
<?php } ?>
<div>
<i class="fa fa-clock-o"></i>
<?php
echo humanTiming(strtotime($video['videoCreation'])), " ", __('ago');
?>
<?php echo humanTiming(strtotime($video['videoCreation'])), " ", __('ago'); ?>
</div>
<div>
<i class="fa fa-user"></i>
<a class="text-muted" href="<?php echo $global['webSiteRootURL']; ?>channel/<?php echo $video['users_id']; ?>/">
<?php
echo $name;
?>
<?php echo $name; ?>
</a>
</div>
<?php
if(Video::canEdit($video['id'])){
?>
<?php if (Video::canEdit($video['id'])) { ?>
<div>
<a href="<?php echo $global['webSiteRootURL']; ?>mvideos?video_id=<?php echo $video['id']; ?>" class="text-primary"><i class="fa fa-edit"></i> <?php echo __("Edit Video"); ?></a>
</div>
<?php
<?php } ?>
<?php if ($config->getAllow_download()) {
$ext = ".mp4";
if($value['type']=="audio"){
if(file_exists($global['systemRootPath']."videos/".$value['filename'].".ogg")){
$ext = ".ogg";
} else if(file_exists($global['systemRootPath']."videos/".$value['filename'].".mp3")){
$ext = ".mp3";
}
?>
} ?>
<div><a class="label label-default " role="button" href="<?php echo $global['webSiteRootURL'] . "videos/" . $value['filename'].$ext; ?>" download="<?php echo $value['title'] . $ext; ?>"><?php echo __("Download"); ?></a></div>
<?php } ?>
</div>
</div>
</div>
</div>
<?php }
?>
<?php } ?>
<!-- For Live Videos -->
<div id="liveVideos" class="clear clearfix" style="display: none;">
<h3 class="galleryTitle text-danger">
<i class="fa fa-youtube-play"></i> <?php
echo __("Live");
?>
</h3>
<div class="row extraVideos">
</div>
<h3 class="galleryTitle text-danger"> <i class="fa fa-youtube-play"></i> <?php echo __("Live"); ?></h3>
<div class="row extraVideos"></div>
</div>
<script>
function afterExtraVideos($liveLi){
@ -242,25 +369,23 @@ $totalPages = ceil($total / $_POST['rowCount']);
}
</script>
<!-- For Live Videos End -->
<?php
if ($obj->SortByName) { ?>
<?php if ($obj->SortByName) { ?>
<div class="clear clearfix">
<h3 class="galleryTitle">
<i class="glyphicon glyphicon-list-alt"></i> <?php
if(empty($_GET["sortByNameOrder"])){
$_GET["sortByNameOrder"]="ASC";
<i class="glyphicon glyphicon-list-alt"></i>
<?php if (empty($_GET["sortByNameOrder"])) {
$_GET["sortByNameOrder"] = "ASC";
}
if($obj->sortReverseable){
$info = createOrderInfo("sortByNameOrder","zyx","abc",$orderString);
echo __("Sort by name (".$info[2].")")." (Page " . $_GET['page'] . ") <a href='".$info[0]."' >".$info[1]."</a>";
if ($obj->sortReverseable) {
$info = createOrderInfo("sortByNameOrder", "zyx", "abc", $orderString);
echo __("Sort by name (" . $info[2] . ")") . " (Page " . $_GET['page'] . ") <a href='" . $info[0] . "' >" . $info[1] . "</a>";
} else {
echo __("Sort by name (abc)");
}
?>
</h3>
<div class="row">
<?php
<div class="row"><?php
$countCols = 0;
unset($_POST['sort']);
$_POST['sort']['title'] = $_GET['sortByNameOrder'];
@ -274,10 +399,11 @@ $totalPages = ceil($total / $_POST['rowCount']);
if ($countCols % 6 === 0) {
echo '</div><div class="row aligned-row ">';
}
$countCols++;
$countCols ++;
?>
<div class="col-lg-2 col-md-4 col-sm-4 col-xs-6 galleryVideo thumbsImage fixPadding">
<a href="<?php echo $global['webSiteRootURL']; ?>cat/<?php echo $value['clean_category']; ?>/video/<?php echo $value['clean_title']; ?>" title="<?php echo $value['title']; ?>" >
<a href="<?php echo $global['webSiteRootURL']; ?>cat/<?php echo $value['clean_category']; ?>/video/<?php echo $value['clean_title']; ?>"title="<?php echo $value['title']; ?>">
<?php
$images = Video::getImageFromFilename($value['filename'], $value['type']);
$imgGif = $images->thumbsGif;
@ -285,10 +411,7 @@ $totalPages = ceil($total / $_POST['rowCount']);
?>
<div class="aspectRatio16_9">
<img src="<?php echo $images->thumbsJpgSmall; ?>" data-src="<?php echo $poster; ?>" alt="<?php echo $value['title']; ?>" class="thumbsJPG img img-responsive <?php echo $img_portrait; ?> rotate<?php echo $value['rotation']; ?>" id="thumbsJPG<?php echo $value['id']; ?>" />
<?php
if (!empty($imgGif)) {
?>
<?php if (! empty($imgGif)) { ?>
<img src="<?php echo $global['webSiteRootURL']; ?>img/loading-gif.png" data-src="<?php echo $imgGif; ?>" style="position: absolute; top: 0; display: none;" alt="<?php echo $value['title']; ?>" id="thumbsGIF<?php echo $value['id']; ?>" class="thumbsGIF img-responsive <?php echo $img_portrait; ?> rotate<?php echo $value['rotation']; ?>" height="130" />
<?php } ?>
</div>
@ -308,8 +431,7 @@ $totalPages = ceil($total / $_POST['rowCount']);
<span class="label label-<?php echo $value2->type; ?>"><?php echo $value2->text; ?></span>
<?php
}
}
?>
} ?>
</div>
<div>
<i class="fa fa-eye"></i>
@ -317,69 +439,74 @@ $totalPages = ceil($total / $_POST['rowCount']);
<?php echo number_format($value['views_count'], 0); ?> <?php echo __("Views"); ?>
</span>
</div>
<?php if(empty($_GET['catName'])) { ?>
<div>
<a class="label label-default" href="<?php echo $global['webSiteRootURL']; ?>cat/<?php echo $value['clean_category']; ?>/">
<?php echo $value['category']; ?>
</a>
</div>
<?php } ?>
<div>
<i class="fa fa-clock-o"></i>
<?php
echo humanTiming(strtotime($value['videoCreation'])), " ", __('ago');
?>
<?php echo humanTiming(strtotime($value['videoCreation'])), " ", __('ago'); ?>
</div>
<div>
<i class="fa fa-user"></i>
<a class="text-muted" href="<?php echo $global['webSiteRootURL']; ?>channel/<?php echo $value['users_id']; ?>/">
<?php
echo $name;
?>
<?php echo $name; ?>
</a>
<?php
if ((!empty($value['description'])) && ($obj->Description)) {
?>
<button type="button" data-trigger="focus" class="btn btn-xs" style="background-color: inherit; color: inherit;" data-toggle="popover" data-placement="top" data-html="true" title="<?php echo $value['title']; ?>" data-content="<div><?php echo str_replace('"', '&quot;', nl2br(textToLink($value['description']))); ?></div>">Description</button>
<?php if ((! empty($value['description'])) && ($obj->Description)) { ?>
<button type="button" data-trigger="focus" class="label label-danger" data-toggle="popover" data-placement="top" data-html="true" title="<?php echo $value['title']; ?>" data-content="<div> <?php echo str_replace('"', '&quot;', nl2br(textToLink($value['description']))); ?> </div>" ><?php echo __("Description"); ?></button>
<?php } ?>
</div>
<?php
if(Video::canEdit($value['id'])){
?>
<?php if (Video::canEdit($value['id'])) { ?>
<div>
<a href="<?php echo $global['webSiteRootURL']; ?>mvideos?video_id=<?php echo $value['id']; ?>" class="text-primary"><i class="fa fa-edit"></i> <?php echo __("Edit Video"); ?></a>
<a href="<?php echo $global['webSiteRootURL']; ?>mvideos?video_id=<?php echo $value['id']; ?>" class="text-primary">
<i class="fa fa-edit"></i> <?php echo __("Edit Video"); ?>
</a>
</div>
<?php
<?php } ?>
<?php if ($config->getAllow_download()) {
$ext = ".mp4";
if($value['type']=="audio"){
if(file_exists($global['systemRootPath']."videos/".$value['filename'].".ogg")){
$ext = ".ogg";
} else if(file_exists($global['systemRootPath']."videos/".$value['filename'].".mp3")){
$ext = ".mp3";
}
?>
} ?>
<div><a class="label label-default " role="button" href="<?php echo $global['webSiteRootURL'] . "videos/" . $value['filename'].$ext; ?>" download="<?php echo $value['title'] . $ext; ?>"><?php echo __("Download"); ?></a></div>
<?php } ?>
</div>
</div>
<?php
}
?>
<?php } ?>
</div>
<div class="row">
<ul class="pages">
</ul>
</div>
</div>
<?php } if ($obj->DateAdded) { ?>
<div class="clear clearfix">
<h3 class="galleryTitle">
<i class="glyphicon glyphicon-sort-by-attributes"></i> <?php
if(empty($_GET["dateAddedOrder"])){
$_GET["dateAddedOrder"]="DESC";
<i class="glyphicon glyphicon-sort-by-attributes"></i>
<?php
if (empty($_GET["dateAddedOrder"])) {
$_GET["dateAddedOrder"] = "DESC";
}
if($obj->sortReverseable){
$info = createOrderInfo("dateAddedOrder","newest","oldest",$orderString);
echo __("Date added (".$info[2].")")." (Page " . $_GET['page'] . ") <a href='".$info[0]."' >".$info[1]."</a>";
if ($obj->sortReverseable) {
$info = createOrderInfo("dateAddedOrder", "newest", "oldest", $orderString);
echo __("Date added (" . $info[2] . ")") . " (Page " . $_GET['page'] . ") <a href='" . $info[0] . "' >" . $info[1] . "</a>";
} else {
echo __("Date added (newest)");
}
?>
</h3>
<div class="row">
<?php
<div class="row"><?php
$countCols = 0;
unset($_POST['sort']);
$_POST['sort']['created'] = $_GET['dateAddedOrder'];
@ -392,21 +519,19 @@ $totalPages = ceil($total / $_POST['rowCount']);
if ($countCols % 6 === 0) {
echo '</div><div class="row aligned-row ">';
}
$countCols++;
$countCols ++;
?>
<div class="col-lg-2 col-sm-4 col-xs-6 galleryVideo thumbsImage fixPadding">
<a href="<?php echo $global['webSiteRootURL']; ?>cat/<?php echo $value['clean_category']; ?>/video/<?php echo $value['clean_title']; ?>" title="<?php echo $value['title']; ?>" >
<a href="<?php echo $global['webSiteRootURL']; ?>cat/<?php echo $value['clean_category']; ?>/video/<?php echo $value['clean_title']; ?>" title="<?php echo $value['title']; ?>">
<?php
$images = Video::getImageFromFilename($value['filename'], $value['type']);
$imgGif = $images->thumbsGif;
$poster = $images->thumbsJpg;
?>
<div class="aspectRatio16_9">
<img src="<?php echo $images->thumbsJpgSmall; ?>" data-src="<?php echo $poster; ?>" alt="<?php echo $value['title']; ?>" class="thumbsJPG img img-responsive <?php echo $img_portrait; ?> rotate<?php echo $value['rotation']; ?>" id="thumbsJPG<?php echo $value['id']; ?>"/>
<?php
if (!empty($imgGif)) {
?>
<img src="<?php echo $global['webSiteRootURL']; ?>img/loading-gif.png" data-src="<?php echo $imgGif; ?>" style="position: absolute; top: 0; display: none;" alt="<?php echo $value['title']; ?>" id="thumbsGIF<?php echo $value['id']; ?>" class="thumbsGIF img-responsive <?php echo $img_portrait; ?> rotate<?php echo $value['rotation']; ?>" height="130" />
<img src="<?php echo $images->thumbsJpgSmall; ?>" data-src="<?php echo $poster; ?>" alt="<?php echo $value['title']; ?>" class="thumbsJPG img img-responsive <?php echo $img_portrait; ?> rotate<?php echo $value['rotation']; ?>" id="thumbsJPG<?php echo $value['id']; ?>" />
<?php if (! empty($imgGif)) { ?>
img src="<?php echo $global['webSiteRootURL']; ?>img/loading-gif.png" data-src="<?php echo $imgGif; ?>" style="position: absolute; top: 0; display: none;" alt="<?php echo $value['title']; ?>" id="thumbsGIF<?php echo $value['id']; ?>" class="thumbsGIF img-responsive <?php echo $img_portrait; ?> rotate<?php echo $value['rotation']; ?>" height="130" />
<?php } ?>
</div>
<span class="duration"><?php echo Video::getCleanDuration($value['duration']); ?></span>
@ -424,74 +549,73 @@ $totalPages = ceil($total / $_POST['rowCount']);
<span class="label label-<?php echo $value2->type; ?>"><?php echo $value2->text; ?></span>
<?php
}
}
?>
} ?>
</div>
<div>
<i class="fa fa-eye"></i>
<span itemprop="interactionCount">
<?php echo number_format($value['views_count'], 0); ?> <?php echo __("Views"); ?>
</span>
<span itemprop="interactionCount"><?php echo number_format($value['views_count'], 0); ?> <?php echo __("Views"); ?></span>
</div>
<?php if(empty($_GET['catName'])) { ?>
<div>
<a class="label label-default" href="<?php echo $global['webSiteRootURL']; ?>cat/<?php echo $value['clean_category']; ?>/">
<?php echo $value['category']; ?>
</a>
</div>
<?php } ?>
<div>
<i class="fa fa-clock-o"></i>
<?php
echo humanTiming(strtotime($value['videoCreation'])), " ", __('ago');
?>
<?php echo humanTiming(strtotime($value['videoCreation'])), " ", __('ago'); ?>
</div>
<div>
<i class="fa fa-user"></i>
<a class="text-muted" href="<?php echo $global['webSiteRootURL']; ?>channel/<?php echo $value['users_id']; ?>/">
<?php
echo $name;
?>
<?php echo $name; ?>
</a>
<?php
if ((!empty($value['description'])) && ($obj->Description)) {
?>
<button type="button" class="btn btn-xs" data-toggle="popover" data-trigger="focus" data-placement="top" data-html="true" style="background-color: inherit; color: inherit;" title="<?php echo $value['title']; ?>" data-content="<div><?php echo str_replace('"', '&quot;', nl2br(textToLink($value['description']))); ?></div>">Description</button>
<?php if ((!empty($value['description'])) && ($obj->Description)) { ?>
<button type="button" class="label label-danger" data-toggle="popover" data-trigger="focus" data-placement="top" data-html="true" title="<?php echo $value['title']; ?>" data-content="<div> <?php echo str_replace('"', '&quot;', nl2br(textToLink($value['description']))); ?></div>"><?php echo __("Description"); ?></button>
<?php } ?>
</div>
<?php
if(Video::canEdit($value['id'])){
?>
<?php if (Video::canEdit($value['id'])) { ?>
<div>
<a href="<?php echo $global['webSiteRootURL']; ?>mvideos?video_id=<?php echo $value['id']; ?>" class="text-primary"><i class="fa fa-edit"></i> <?php echo __("Edit Video"); ?></a>
<a href="<?php echo $global['webSiteRootURL']; ?>mvideos?video_id=<?php echo $value['id']; ?>" class="text-primary">
<i class="fa fa-edit"></i> <?php echo __("Edit Video"); ?>
</a>
</div>
<?php
<?php } ?>
<?php if ($config->getAllow_download()) {
$ext = ".mp4";
if($value['type']=="audio"){
if(file_exists($global['systemRootPath']."videos/".$value['filename'].".ogg")){
$ext = ".ogg";
} else if(file_exists($global['systemRootPath']."videos/".$value['filename'].".mp3")){
$ext = ".mp3";
}
?>
} ?>
<div><a class="label label-default " role="button" href="<?php echo $global['webSiteRootURL'] . "videos/" . $value['filename'].$ext; ?>" download="<?php echo $value['title'] . $ext; ?>"><?php echo __("Download"); ?></a></div>
<?php } ?>
</div>
</div>
<?php
}
?>
<?php } ?>
</div>
<div class="row">
<ul class="pages">
</ul>
</div>
</div>
<?php } if ($obj->MostWatched) { ?>
<div class="clear clearfix">
<h3 class="galleryTitle">
<i class="glyphicon glyphicon-eye-open"></i> <?php
if(empty($_GET['mostWatchedOrder'])){
$_GET['mostWatchedOrder']="DESC";
<i class="glyphicon glyphicon-eye-open"></i>
<?php
if (empty($_GET['mostWatchedOrder'])) {
$_GET['mostWatchedOrder'] = "DESC";
}
if($obj->sortReverseable){
$info = createOrderInfo("mostWatchedOrder","Most","Lessest",$orderString);
echo __($info[2]." watched")." (Page " . $_GET['page'] . ") <a href='".$info[0]."' >".$info[1]."</a>";
if ($obj->sortReverseable) {
$info = createOrderInfo("mostWatchedOrder", "Most", "Lessest", $orderString);
echo __($info[2] . " watched") . " (Page " . $_GET['page'] . ") <a href='" . $info[0] . "' >" . $info[1] . "</a>";
} else {
echo __("Most watched");
}
?>
} ?>
</h3>
<div class="row">
<?php
@ -503,14 +627,17 @@ $totalPages = ceil($total / $_POST['rowCount']);
$videos = Video::getAllVideos();
foreach ($videos as $value) {
$name = User::getNameIdentificationById($value['users_id']);
// make a row each 6 cols
if ($countCols % 6 === 0) {
echo '</div><div class="row aligned-row ">';
}
$countCols++;
$countCols ++;
?>
<div class="col-lg-2 col-sm-4 col-xs-6 galleryVideo thumbsImage fixPadding">
<a href="<?php echo $global['webSiteRootURL']; ?>cat/<?php echo $value['clean_category']; ?>/video/<?php echo $value['clean_title']; ?>" title="<?php echo $value['title']; ?>" >
<a href="<?php echo $global['webSiteRootURL']; ?>cat/<?php echo $value['clean_category']; ?>/video/<?php echo $value['clean_title']; ?>" title="<?php echo $value['title']; ?>">
<?php
$images = Video::getImageFromFilename($value['filename'], $value['type']);
$imgGif = $images->thumbsGif;
@ -519,9 +646,7 @@ $totalPages = ceil($total / $_POST['rowCount']);
<div class="aspectRatio16_9">
<img src="<?php echo $images->thumbsJpgSmall; ?>" data-src="<?php echo $poster; ?>" alt="<?php echo $value['title']; ?>" class="thumbsJPG img img-responsive <?php echo $img_portrait; ?> rotate<?php echo $value['rotation']; ?>" id="thumbsJPG<?php echo $value['id']; ?>" />
<?php
if (!empty($imgGif)) {
?>
<?php if (! empty($imgGif)) { ?>
<img src="<?php echo $global['webSiteRootURL']; ?>img/loading-gif.png" data-src="<?php echo $imgGif; ?>" style="position: absolute; top: 0; display: none;" alt="<?php echo $value['title']; ?>" id="thumbsGIF<?php echo $value['id']; ?>" class="thumbsGIF img-responsive <?php echo $img_portrait; ?> rotate<?php echo $value['rotation']; ?>" height="130" />
<?php } ?>
</div>
@ -550,41 +675,47 @@ $totalPages = ceil($total / $_POST['rowCount']);
<?php echo number_format($value['views_count'], 0); ?> <?php echo __("Views"); ?>
</span>
</div>
<?php if(empty($_GET['catName'])) { ?>
<div>
<a class="label label-default" href="<?php echo $global['webSiteRootURL']; ?>cat/<?php echo $value['clean_category']; ?>/">
<?php echo $value['category']; ?>
</a>
</div>
<?php } ?>
<div>
<i class="fa fa-clock-o"></i>
<?php
echo humanTiming(strtotime($value['videoCreation'])), " ", __('ago');
?>
<?php echo humanTiming(strtotime($value['videoCreation'])), " ", __('ago'); ?>
</div>
<div>
<i class="fa fa-user"></i>
<a class="text-muted" href="<?php echo $global['webSiteRootURL']; ?>channel/<?php echo $value['users_id']; ?>/">
<?php
echo $name;
?>
<?php echo $name; ?>
</a>
<?php
if ((!empty($value['description'])) && ($obj->Description)) {
?>
<button type="button" class="btn btn-xs" data-trigger="focus" data-toggle="popover" data-placement="top" data-html="true" style="background-color: inherit; color: inherit;" title="<?php echo $value['title']; ?>" data-content="<div style='color: white;' ><?php echo str_replace('"', '&quot;', nl2br(textToLink($value['description']))); ?></div>">Description</button>
<?php if ((! empty($value['description'])) && ($obj->Description)) { ?>
<button type="button" class="label label-danger" data-trigger="focus" data-toggle="popover" data-placement="top" data-html="true" title="<?php echo $value['title']; ?>" data-content="<div><?php echo str_replace('"', '&quot;', nl2br(textToLink($value['description']))); ?></div>"><?php echo __("Description"); ?></button>
<?php } ?>
</div>
<?php
if(Video::canEdit($value['id'])){
?>
<?php if (Video::canEdit($value['id'])) { ?>
<div>
<a href="<?php echo $global['webSiteRootURL']; ?>mvideos?video_id=<?php echo $value['id']; ?>" class="text-primary"><i class="fa fa-edit"></i> <?php echo __("Edit Video"); ?></a>
<a href="<?php echo $global['webSiteRootURL']; ?>mvideos?video_id=<?php echo $value['id']; ?>" class="text-primary">
<i class="fa fa-edit"></i> <?php echo __("Edit Video"); ?>
</a>
</div>
<?php
<?php } ?>
<?php if ($config->getAllow_download()) {
$ext = ".mp4";
if($value['type']=="audio"){
if(file_exists($global['systemRootPath']."videos/".$value['filename'].".ogg")){
$ext = ".ogg";
} else if(file_exists($global['systemRootPath']."videos/".$value['filename'].".mp3")){
$ext = ".mp3";
}
?>
} ?>
<div><a class="label label-default " role="button" href="<?php echo $global['webSiteRootURL'] . "videos/" . $value['filename'].$ext; ?>" download="<?php echo $value['title'] . $ext; ?>"><?php echo __("Download"); ?></a></div>
<?php } ?>
</div>
</div>
<?php
}
?>
<?php } ?>
</div>
<div class="row">
<ul class="pages">
@ -594,13 +725,14 @@ $totalPages = ceil($total / $_POST['rowCount']);
<?php } if ($obj->MostPopular) { ?>
<div class="clear clearfix">
<h3 class="galleryTitle">
<i class="glyphicon glyphicon-thumbs-up"></i> <?php
if(empty($_GET['mostPopularOrder'])){
$_GET['mostPopularOrder']="DESC";
<i class="glyphicon glyphicon-thumbs-up"></i>
<?php
if (empty($_GET['mostPopularOrder'])) {
$_GET['mostPopularOrder'] = "DESC";
}
if($obj->sortReverseable){
$info = createOrderInfo("mostPopularOrder","Most","Lessest",$orderString);
echo __($info[2]." popular")." (Page " . $_GET['page'] . ") <a href='".$info[0]."' >".$info[1]."</a>";
if ($obj->sortReverseable) {
$info = createOrderInfo("mostPopularOrder", "Most", "Lessest", $orderString);
echo __($info[2] . " popular") . " (Page " . $_GET['page'] . ") <a href='" . $info[0] . "' >" . $info[1] . "</a>";
} else {
echo __("Most popular");
}
@ -620,10 +752,10 @@ $totalPages = ceil($total / $_POST['rowCount']);
if ($countCols % 6 === 0) {
echo '</div><div class="row aligned-row ">';
}
$countCols++;
$countCols ++;
?>
<div class="col-lg-2 col-sm-4 col-xs-6 galleryVideo thumbsImage fixPadding">
<a href="<?php echo $global['webSiteRootURL']; ?>cat/<?php echo $value['clean_category']; ?>/video/<?php echo $value['clean_title']; ?>" title="<?php echo $value['title']; ?>" >
<a href="<?php echo $global['webSiteRootURL']; ?>cat/<?php echo $value['clean_category']; ?>/video/<?php echo $value['clean_title']; ?>" title="<?php echo $value['title']; ?>">
<?php
$images = Video::getImageFromFilename($value['filename'], $value['type']);
$imgGif = $images->thumbsGif;
@ -631,10 +763,7 @@ $totalPages = ceil($total / $_POST['rowCount']);
?>
<div class="aspectRatio16_9">
<img src="<?php echo $images->thumbsJpgSmall; ?>" data-src="<?php echo $poster; ?>" alt="<?php echo $value['title']; ?>" class="thumbsJPG img img-responsive <?php echo $img_portrait; ?> rotate<?php echo $value['rotation']; ?>" id="thumbsJPG<?php echo $value['id']; ?>" />
<?php
if (!empty($imgGif)) {
?>
<?php if (! empty($imgGif)) { ?>
<img src="<?php echo $global['webSiteRootURL']; ?>img/loading-gif.png" data-src="<?php echo $imgGif; ?>" style="position: absolute; top: 0; display: none;" alt="<?php echo $value['title']; ?>" id="thumbsGIF<?php echo $value['id']; ?>" class="thumbsGIF img-responsive <?php echo $img_portrait; ?> rotate<?php echo $value['rotation']; ?>" height="130" />
<?php } ?>
</div>
@ -649,13 +778,10 @@ $totalPages = ceil($total / $_POST['rowCount']);
<?php
$value['tags'] = Video::getTags($value['id']);
foreach ($value['tags'] as $value2) {
if ($value2->label === __("Group")) {
?>
if ($value2->label === __("Group")) { ?>
<span class="label label-<?php echo $value2->type; ?>"><?php echo $value2->text; ?></span>
<?php
}
}
?>
<?php }
} ?>
</div>
<div>
<i class="fa fa-eye"></i>
@ -663,41 +789,46 @@ $totalPages = ceil($total / $_POST['rowCount']);
<?php echo number_format($value['views_count'], 0); ?> <?php echo __("Views"); ?>
</span>
</div>
<?php if(empty($_GET['catName'])) { ?>
<div>
<a class="label label-default" href="<?php echo $global['webSiteRootURL']; ?>cat/<?php echo $value['clean_category']; ?>/">
<?php echo $value['category']; ?>
</a>
</div>
<?php } ?>
<div>
<i class="fa fa-clock-o"></i>
<?php
echo humanTiming(strtotime($value['videoCreation'])), " ", __('ago');
?>
<?php echo humanTiming(strtotime($value['videoCreation'])), " ", __('ago'); ?>
</div>
<div>
<i class="fa fa-user"></i>
<a class="text-muted" href="<?php echo $global['webSiteRootURL']; ?>channel/<?php echo $value['users_id']; ?>/">
<?php
echo $name;
?>
<?php echo $name; ?>
</a>
<?php
if ((!empty($value['description'])) && ($obj->Description)) {
?>
<button type="button" class="btn btn-xs" data-trigger="focus" data-toggle="popover" data-placement="top" data-html="true" style="background-color: inherit; color: inherit;" title="<?php echo $value['title']; ?>" data-content="<div><?php echo str_replace('"', '&quot;', nl2br(textToLink($value['description']))); ?></div>">Description</button>
<?php if ((! empty($value['description'])) && ($obj->Description)) { ?>
<button type="button" class="label label-danger" data-trigger="focus" data-toggle="popover" data-placement="top" data-html="true" title="<?php echo $value['title']; ?>" data-content="<div><?php echo str_replace('"', '&quot;', nl2br(textToLink($value['description']))); ?></div>"><?php echo __("Description"); ?></button>
<?php } ?>
</div>
<?php
if(Video::canEdit($value['id'])){
?>
<?php if (Video::canEdit($value['id'])) { ?>
<div>
<a href="<?php echo $global['webSiteRootURL']; ?>mvideos?video_id=<?php echo $value['id']; ?>" class="text-primary"><i class="fa fa-edit"></i> <?php echo __("Edit Video"); ?></a>
</div>
<?php
<?php } ?>
<?php if ($config->getAllow_download()) {
$ext = ".mp4";
if($value['type']=="audio"){
if(file_exists($global['systemRootPath']."videos/".$value['filename'].".ogg")){
$ext = ".ogg";
} else if(file_exists($global['systemRootPath']."videos/".$value['filename'].".mp3")){
$ext = ".mp3";
}
?>
} ?>
<div><a class="label label-defaut " role="button" href="<?php echo $global['webSiteRootURL'] . "videos/" . $value['filename'].$ext; ?>" download="<?php echo $value['title'] . $ext; ?>"><?php echo __("Download"); ?></a></div>
<?php } ?>
</div>
</div>
<?php
}
?>
<?php } ?>
</div>
<div class="row">
<ul class="pages">
@ -705,26 +836,18 @@ $totalPages = ceil($total / $_POST['rowCount']);
</div>
</div>
<?php } ?>
</div>
<?php
} else {
?>
</div>
<?php } else { ?>
<div class="alert alert-warning">
<span class="glyphicon glyphicon-facetime-video"></span> <strong><?php echo __("Warning"); ?>!</strong> <?php echo __("We have not found any videos or audios to show"); ?>.
<span class="glyphicon glyphicon-facetime-video"></span>
<strong><?php echo __("Warning"); ?>!</strong>
<?php echo __("We have not found any videos or audios to show"); ?>.
</div>
<?php } ?>
</div>
</div>
</div>
</div>
<?php
include 'include/footer.php';
?>
<?php include 'include/footer.php'; ?>
</body>
</html>
<?php
include $global['systemRootPath'] . 'objects/include_end.php';
?>
<?php include $global['systemRootPath'] . 'objects/include_end.php'; ?>

View file

@ -47,12 +47,13 @@ class Hotkeys extends PluginAbstract {
$catUrlResult;
preg_match("/cat\/(.*)\/video\/(.*)/", $url, $catUrlResult);
if((strpos($url,substr($global['webSiteRootURL'],$httpSpacer)."video/")!==false)||(sizeof($catUrlResult)>0)){
$tmp = "<script src=\"{$global['webSiteRootURL']}plugin/Hotkeys/videojs.hotkeys.min.js\"> </script>
<script>
videojs('mainVideo').ready(function() {
this.hotkeys({
seekStep: 5,";
$tmp = "<script src=\"{$global['webSiteRootURL']}plugin/Hotkeys/videojs.hotkeys.min.js\"> </script><script>";
if($_SESSION['type']=="audio"){
$tmp .= "videojs('mainAudio').ready(function() {";
} else {
$tmp .= "videojs('mainVideo').ready(function() {";
}
$tmp .= "this.hotkeys({ seekStep: 5,";
if($obj->Volume){
$tmp .= "enableVolumeScroll: true,";

View file

@ -20,7 +20,11 @@ class NextButton extends PluginAbstract {
public function getFooterCode() {
global $global, $autoPlayVideo;
if (!empty($autoPlayVideo['url'])) {
$js = '<script>autoPlayVideoURL="'.$autoPlayVideo['url'].'"</script>';
$tmp = "mainVideo";
if($_SESSION['type']=="audio"){
$tmp = "mainAudio";
}
$js = '<script>var autoPlayVideoURL="'.$autoPlayVideo['url'].'"; var videoJsId = "'.$tmp.'";</script>';
$js .= '<script src="' . $global['webSiteRootURL'] . 'plugin/NextButton/script.js" type="text/javascript"></script>';
return $js;

View file

@ -1,5 +1,5 @@
// Extend default
if(typeof player == 'undefined'){player = videojs('mainVideo');}
if(typeof player == 'undefined'){player = videojs(videoJsId);}
var Button = videojs.getComponent('Button');
var nextButton = videojs.extend(Button, {
//constructor: function(player, options) {

View file

@ -40,10 +40,12 @@ class SeekButton extends PluginAbstract {
if (!empty($_GET['videoName'])) {
$obj = $this->getDataObject();
$js = '<script src="' . $global['webSiteRootURL'] . 'plugin/SeekButton/videojs-seek-buttons/videojs-seek-buttons.min.js" type="text/javascript"></script>';
$js .= '<script>if(typeof player == \'undefined\'){player = videojs(\'mainVideo\');}'
. 'player.seekButtons({forward: '.$obj->forward.',back: '.$obj->back.' });'
. '</script>';
if($_SESSION['type']=="audio"){
$js .= '<script>if(typeof player == \'undefined\'){player = videojs(\'mainAudio\');}';
} else {
$js .= '<script>if(typeof player == \'undefined\'){player = videojs(\'mainVideo\');}';
}
$js .= 'player.seekButtons({forward: '.$obj->forward.',back: '.$obj->back.' });'. '</script>';
return $js;
}
}

View file

@ -42,7 +42,11 @@ class TheaterButton extends PluginAbstract {
}
$obj = $this->getDataObject();
$js = '<script src="' . $global['webSiteRootURL'] . 'plugin/TheaterButton/script.js" type="text/javascript"></script>';
$tmp = "mainVideo";
if($_SESSION['type']=="audio"){
$tmp = "mainAudio";
}
$js .= '<script>var videoJsId = "'.$tmp.'";</script>';
if(!empty($obj->show_switch_button)){
$js .= '<script src="' . $global['webSiteRootURL'] . 'plugin/TheaterButton/addButton.js" type="text/javascript"></script>';
}else{

View file

@ -1,7 +1,7 @@
$(document).ready(function () {
// Extend default
if (typeof player == 'undefined') {
player = videojs('mainVideo');
player = videojs(videoJsId);
}
// Extend default
var Button = videojs.getComponent('Button');

View file

@ -0,0 +1,44 @@
<?php
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
/**
*
* @author daniel
*/
abstract class YPTWalletPlugin {
//put your code here
private $invoiceNumber, $value, $currency;
abstract function getAprovalButton();
abstract function getEmptyDataObject();
function getValue(){
return $this->value;
}
function setValue($value){
$this->value = floatval($value);
}
function getInvoiceNumber() {
return $this->invoiceNumber;
}
function setInvoiceNumber($invoiceNumber) {
$this->invoiceNumber = $invoiceNumber;
}
function getCurrency() {
return $this->currency;
}
function setCurrency($currency) {
$this->currency = $currency;
}
}

View file

@ -0,0 +1,27 @@
<?php
if (empty($global['systemRootPath'])) {
$global['systemRootPath'] = '../../../';
}
require_once $global['systemRootPath'] . 'videos/configuration.php';
require_once $global['systemRootPath'] . 'plugin/YPTWallet/Objects/Wallet_log.php';
if (!User::isLogged()) {
header("Location: {$global['webSiteRootURL']}?error=" . __("You can not do this"));
exit;
}
if(!empty($_GET['users_id']) && User::isAdmin()){
$users_id = $_GET['users_id'];
}else{
$users_id = User::getId();
}
header('Content-Type: application/json');
if(!empty($_POST['sort']['valueText'])){
$_POST['sort']['value'] = $_POST['sort']['valueText'];
unset($_POST['sort']['valueText']);
}
$row = WalletLog::getAllFromUser($users_id);
$total = WalletLog::getTotalFromUser($users_id);
echo '{ "current": '.$_POST['current'].',"rowCount": '.$_POST['rowCount'].', "total": '.$total.', "rows":'. json_encode($row).'}';

View file

@ -0,0 +1,35 @@
<?php
if (empty($global['systemRootPath'])) {
$global['systemRootPath'] = '../../../';
}
require_once $global['systemRootPath'] . 'videos/configuration.php';
require_once $global['systemRootPath'] . 'objects/user.php';
$obj = new stdClass();
$obj->error = true;
$obj->msg = "";
$obj->walletBalance = 0;
if (!User::isAdmin()) {
$obj->msg = ("Is not admin");
die(json_encode($obj));
}
$plugin = YouPHPTubePlugin::loadPluginIfEnabled("YPTWallet");
if(empty($plugin)){
$obj->msg = ("Plugin not enabled");
die(json_encode($obj));
}
if(empty($_POST['users_id'])){
$obj->msg = ("User Not defined");
die(json_encode($obj));
}
$_POST['balance'] = floatval($_POST['balance']);
header('Content-Type: application/json');
$resp = $plugin->saveBalance($_POST['users_id'], $_POST['balance']);
$obj->error = false;
$obj->walletBalance = $plugin->getBalanceFormated(User::getId());
echo json_encode($obj);

View file

@ -0,0 +1,27 @@
<?php
if (empty($global['systemRootPath'])) {
$global['systemRootPath'] = '../../../';
}
require_once $global['systemRootPath'] . 'videos/configuration.php';
require_once $global['systemRootPath'] . 'objects/user.php';
if (!User::isAdmin()) {
die("Is not admin");
}
$plugin = YouPHPTubePlugin::loadPluginIfEnabled("YPTWallet");
if(empty($plugin)){
die("Plugin not enabled");
}
header('Content-Type: application/json');
$users = User::getAllUsers();
foreach ($users as $key => $value) {
$users[$key]['balance'] = $plugin->getBalance($value['id']);
$users[$key]['photo'] = User::getPhoto($value['id']);
}
$total = User::getTotalUsers();
echo '{ "current": '.$_POST['current'].',"rowCount": '.$_POST['rowCount'].', "total": '.$total.', "rows":'. json_encode($users).'}';

View file

@ -31,6 +31,8 @@ class YouPHPFlix extends PluginAbstract {
$obj->DateAdded = true;
$obj->LiteDesignGenericNrOfRows = 10;
$obj->SortByName = false;
$obj->separateAudio = false;
$obj->SubCategorys = false;
return $obj;
}

File diff suppressed because it is too large Load diff

View file

@ -25,7 +25,7 @@ class YouPHPFlixHybrid extends PluginAbstract {
public function getFirstPage(){
global $global;
$url = $_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'];
if(("http://".$url===$global['webSiteRootURL'])||("https://".$url===$global['webSiteRootURL'])){
if(("http://".$url===$global['webSiteRootURL'])||("https://".$url===$global['webSiteRootURL'])||("http://".$url===$global['webSiteRootURL']."audioOnly")||("https://".$url===$global['webSiteRootURL']."audioOnly")||("http://".$url===$global['webSiteRootURL']."videoOnly")||("https://".$url===$global['webSiteRootURL']."videoOnly")||("https://".$url===$global['webSiteRootURL']."?type=all")||("http://".$url===$global['webSiteRootURL']."?type=all")){
return $global['systemRootPath'].'plugin/YouPHPFlix/view/firstPage.php';
}
else {

View file

@ -14,7 +14,6 @@ ADD `description` TEXT NULL AFTER `clean_name`;
ALTER TABLE `categories`
ADD `nextVideoOrder` INT(2) NOT NULL DEFAULT '0' AFTER `description`;
SET SQL_MODE=@OLD_SQL_MODE;
SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS;
SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS;

23
update/updateDb.v5.01.sql Normal file
View file

@ -0,0 +1,23 @@
SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0;
SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0;
SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='TRADITIONAL,ALLOW_INVALID_DATES';
ALTER TABLE `categories`
ADD `parentId` INT NOT NULL DEFAULT '0' AFTER `nextVideoOrder`;
CREATE TABLE `category_type_cache` (
`categoryId` int(11) NOT NULL,
`type` int(2) NOT NULL COMMENT '0=both, 1=audio, 2=video' DEFAULT 0,
`manualSet` int(1) NOT NULL COMMENT '0 = auto, 1 = manual' DEFAULT 0
) ENGINE=InnoDB;
ALTER TABLE `category_type_cache`
ADD UNIQUE KEY `categoryId` (`categoryId`);
COMMIT;
SET SQL_MODE=@OLD_SQL_MODE;
SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS;
SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS;
UPDATE configurations SET version = '5.01', modified = now() WHERE id = 1;

View file

@ -1,13 +1,81 @@
<div class="row main-video" style="padding: 10px;">
<div class="col-xs-12 col-sm-12 col-lg-2"></div>
<div class="col-xs-12 col-sm-12 col-lg-8 ">
<audio controls class="center-block video-js vjs-default-skin " id="mainAudio" autoplay data-setup='{}'
poster="<?php echo $global['webSiteRootURL']; ?>img/recorder.gif">
<div class="row main-video" style="padding: 10px;" id="mvideo">
<div class="col-xs-12 col-sm-12 col-lg-2 firstC"></div>
<div class="col-xs-12 col-sm-12 col-lg-8 secC">
<?php
$poster = $global['webSiteRootURL']."img/recorder.gif";
if(file_exists($global['systemRootPath']."videos/".$video['filename'].".jpg")){
$poster = $global['webSiteRootURL']."videos/".$video['filename'].".jpg";
}
?>
<audio controls class="center-block video-js vjs-default-skin " id="mainAudio" autoplay data-setup='{}' poster="<?php echo $poster; ?>">
<?php
$ext = "";
if(file_exists($global['systemRootPath']."videos/".$video['filename'].".ogg")){ ?>
<source src="<?php echo $global['webSiteRootURL']; ?>videos/<?php echo $video['filename']; ?>.ogg" type="audio/ogg" />
<a href="<?php echo $global['webSiteRootURL']; ?>videos/<?php echo $video['filename']; ?>.ogg">horse</a>
<?php
$ext = ".ogg";
} else { ?>
<source src="<?php echo $global['webSiteRootURL']; ?>videos/<?php echo $video['filename']; ?>.mp3" type="audio/mpeg" />
<a href="<?php echo $global['webSiteRootURL']; ?>videos/<?php echo $video['filename']; ?>.mp3">horse</a>
<?php
$ext = ".mp3";
} ?>
</audio>
<?php if ($config->getAllow_download()) { ?>
<a class="btn btn-xs btn-default " role="button" href="<?php echo $global['webSiteRootURL'] . "videos/" . $video['filename'].$ext; ?>" download="<?php echo $video['title'] . $ext; ?>"><?php echo __("Download audio"); ?></a>
<?php } ?>
</div>
<script>
$(document).ready(function () {
$(".vjs-big-play-button").hide();
player = videojs('mainAudio');
player.ready(function () {
<?php
if ($config->getAutoplay()) {
echo "setTimeout(function () { if(typeof player === 'undefined'){ player = videojs('mainAudio');}player.play();}, 150);";
} else {
?>
if (Cookies.get('autoplay') && Cookies.get('autoplay') !== 'false') {
setTimeout(function () { if(typeof player === 'undefined'){ player = videojs('mainAudio');} player.play();}, 150);
}
<?php } ?>
<?php if (!empty($logId)) { ?>
isPlayingAd = true;
this.on('ended', function () {
console.log("Finish Audio");
if (isPlayingAd) {
isPlayingAd = false;
$('#adButton').trigger("click");
}
<?php // if autoplay play next video
if (!empty($autoPlayVideo)) { ?>
else if (Cookies.get('autoplay') && Cookies.get('autoplay') !== 'false') {
document.location = '<?php echo $autoPlayVideo['url']; ?>';
}
<?php } ?>
});
this.on('timeupdate', function () {
var durationLeft = fullDuration - this.currentTime();
$("#adUrl .time").text(secondsToStr(durationLeft + 1, 2));
<?php if (!empty($ad['skip_after_seconds'])) { ?>
if (isPlayingAd && this.currentTime() ><?php echo intval($ad['skip_after_seconds']); ?>) {
$('#adButton').fadeIn();
}
<?php } ?>
});
<?php } else { ?>
this.on('ended', function () {
console.log("Finish Audio");
<?php // if autoplay play next video
if (!empty($autoPlayVideo)) { ?>
if (Cookies.get('autoplay') && Cookies.get('autoplay') !== 'false') {
document.location = '<?php echo $autoPlayVideo['url']; ?>';
}
<?php } ?>
});
<?php } ?>
}); });
</script>
<div class="col-xs-12 col-sm-12 col-lg-2"></div>
</div><!--/row-->

View file

@ -36,6 +36,13 @@
}
</script>
<script>
window.onerror = function myErrorHandler(errorMsg, url, lineNumber) {
alert("<?php echo __('A Javascript-error happend. Please tell your admin to clear the folder videos/cache. \r\n If this doesn\'t help, attach these infos to a github-pull-request:'); ?> \r\n Msg:" + errorMsg+" \r\n Url: "+url+ ", line: "+lineNumber);//or any message
return false;
}
// Just for testing
//throw "A Bug";
$(function () {
<?php
if (!empty($_GET['error'])) {
@ -61,6 +68,7 @@ if (!empty($_GET['error'])) {
$jsFiles[] = "{$global['webSiteRootURL']}js/jquery.lazy/jquery.lazy.min.js";
$jsFiles[] = "{$global['webSiteRootURL']}js/jquery.lazy/jquery.lazy.plugins.min.js";
$jsURL = combineFiles($jsFiles, "js");
?>
<script src="<?php echo $jsURL; ?>" type="text/javascript"></script>
<?php

View file

@ -1,6 +1,7 @@
<?php
require_once $global['systemRootPath'] . 'objects/user.php';
require_once $global['systemRootPath'] . 'objects/category.php';
$_GET['parentsOnly']="1";
$categories = Category::getAllCategories();
if (empty($_SESSION['language'])) {
$lang = 'us';
@ -54,7 +55,7 @@ $updateFiles = getUpdatesFilesArray();
<form class="navbar-form navbar-left" id="searchForm" action="<?php echo $global['webSiteRootURL']; ?>" >
<div class="input-group" >
<div class="form-inline">
<input class="form-control" type="text" name="search" placeholder="<?php echo __("Search"); ?>">
<input class="form-control" type="text" value="<?php if(!empty($_GET['search'])) { echo $_GET['search']; } ?>" name="search" placeholder="<?php echo __("Search"); ?>">
<button class="input-group-addon form-control hidden-xs" style="width: 50px;" type="submit"><span class="glyphicon glyphicon-search"></span></button>
</div>
</div>
@ -104,7 +105,7 @@ $updateFiles = getUpdatesFilesArray();
?>
<li>
<a href="<?php echo $global['webSiteRootURL']; ?>upload" >
<span class="fa fa-upload"></span> <?php echo __("Upload a MP4 video"); ?>
<span class="fa fa-upload"></span> <?php echo __("Direct upload"); ?>
</a>
</li>
<?php
@ -383,10 +384,31 @@ $updateFiles = getUpdatesFilesArray();
<h3 class="text-danger"><?php echo __("Categories"); ?></h3>
</li>
<?php
function mkSub($catId){
global $global;
unset($_GET['parentsOnly']);
$subcats = Category::getChildCategories($catId);
if(!empty($subcats)){
echo "<ul style='margin-bottom: 0px; list-style-type: none;'>";
foreach($subcats as $subcat){
echo '<li class="' . ($subcat['clean_name'] == @$_GET['catName'] ? "active" : "") . '">'
. '<a href="' . $global['webSiteRootURL'] . 'cat/' . $subcat['clean_name'] . '" >'
. '<span class="' . (empty($subcat['iconClass']) ? "fa fa-folder" : $subcat['iconClass']) . '"></span> ' . $subcat['name'] . '</a></li>';
mkSub($subcat['id']);
}
echo "</ul>";
}
}
foreach ($categories as $value) {
echo '<li class="' . ($value['clean_name'] == @$_GET['catName'] ? "active" : "") . '">'
. '<a href="' . $global['webSiteRootURL'] . 'cat/' . $value['clean_name'] . '" >'
. '<span class="' . (empty($value['iconClass']) ? "fa fa-folder" : $value['iconClass']) . '"></span> ' . $value['name'] . '</a></li>';
. '<span class="' . (empty($value['iconClass']) ? "fa fa-folder" : $value['iconClass']) . '"></span> ' . $value['name'] . '</a>';
mkSub($value['id']);
echo '</li>';
}
?>

View file

@ -1,20 +1,21 @@
<?php
$playNowVideo = $video;
$transformation = "{rotate:" . $video['rotation'] . ", zoom: " . $video['zoom'] . "}";
if ($video['rotation'] === "90" || $video['rotation'] === "270") {
$aspectRatio = "9:16";
$vjsClass = "vjs-9-16";
$embedResponsiveClass = "embed-responsive-9by16";
} else {
} else {
$aspectRatio = "16:9";
$vjsClass = "vjs-16-9";
$embedResponsiveClass = "embed-responsive-16by9";
}
}
if (!empty($ad)) {
$playNowVideo = $ad;
$logId = Video_ad::log($ad['id']);
}
}
?>
<div class="row main-video" id="mvideo">
<div class="col-sm-2 col-md-2 firstC"></div>
@ -24,62 +25,39 @@ if (!empty($ad)) {
<p class="btn btn-outline btn-xs move">
<i class="fa fa-arrows"></i>
</p>
<button type="button" class="btn btn-outline btn-xs" onclick="closeFloatVideo();floatClosed = 1;">
<button type="button" class="btn btn-outline btn-xs"
onclick="closeFloatVideo();floatClosed = 1;">
<i class="fa fa-close"></i>
</button>
</div>
<div id="main-video" class="embed-responsive <?php
echo $embedResponsiveClass;
if (!empty($logId)) {
echo " ad";
}
?>">
<video preload="auto" poster="<?php echo $poster; ?>" controls
class="embed-responsive-item video-js vjs-default-skin <?php echo $vjsClass; ?> vjs-big-play-centered"
id="mainVideo" data-setup='{ "aspectRatio": "<?php echo $aspectRatio; ?>" }'>
<div id="main-video" class="embed-responsive <?php echo $embedResponsiveClass; if (!empty($logId)) { echo " ad"; } ?>">
<video preload="auto" poster="<?php echo $poster; ?>" controls class="embed-responsive-item video-js vjs-default-skin <?php echo $vjsClass; ?> vjs-big-play-centered" id="mainVideo" data-setup='{ "aspectRatio": "<?php echo $aspectRatio; ?>" }'>
<!-- <?php echo $playNowVideo['title'], " ", $playNowVideo['filename']; ?> -->
<?php
echo getSources($playNowVideo['filename']);
?>
<?php echo getSources($playNowVideo['filename']); ?>
<p><?php echo __("If you can't view this video, your browser does not support HTML5 videos"); ?></p>
<p class="vjs-no-js">
<?php echo __("To view this video please enable JavaScript, and consider upgrading to a web browser that"); ?>
<p class="vjs-no-js"><?php echo __("To view this video please enable JavaScript, and consider upgrading to a web browser that"); ?>
<a href="http://videojs.com/html5-video-support/" target="_blank">supports HTML5 video</a>
</p>
</video>
<?php
require_once $global['systemRootPath'] . 'plugin/YouPHPTubePlugin.php';
<?php require_once $global['systemRootPath'] . 'plugin/YouPHPTubePlugin.php';
// the live users plugin
if (YouPHPTubePlugin::isEnabled("0e225f8e-15e2-43d4-8ff7-0cb07c2a2b3b")) {
if (YouPHPTubePlugin::isEnabled("0e225f8e-15e2-43d4-8ff7-0cb07c2a2b3b")) {
require_once $global['systemRootPath'] . 'plugin/VideoLogoOverlay/VideoLogoOverlay.php';
$style = VideoLogoOverlay::getStyle();
$url = VideoLogoOverlay::getLink();
?>
$url = VideoLogoOverlay::getLink(); ?>
<div style="<?php echo $style; ?>">
<a href="<?php echo $url; ?>">
<img src="<?php echo $global['webSiteRootURL']; ?>videos/logoOverlay.png">
<a href="<?php echo $url; ?>"> <img src="<?php echo $global['webSiteRootURL']; ?>videos/logoOverlay.png"></a>
</div>
<?php } if (!empty($logId)) { ?>
<div id="adUrl" class="adControl"><?php echo __("Ad"); ?> <span class="time">0:00</span> <i class="fa fa-info-circle"></i>
<a href="<?php echo $global['webSiteRootURL']; ?>adClickLog?video_ads_logs_id=<?php echo $logId; ?>&adId=<?php echo $ad['id']; ?>" target="_blank"><?php $url = parse_url($ad['redirect']); echo $url['host'];?>
<i class="fa fa-external-link"></i>
</a>
</div>
<?php
}
?>
<?php if (!empty($logId)) { ?>
<div id="adUrl" class="adControl" ><?php echo __("Ad"); ?> <span class="time">0:00</span> <i class="fa fa-info-circle"></i>
<a href="<?php echo $global['webSiteRootURL']; ?>adClickLog?video_ads_logs_id=<?php echo $logId; ?>&adId=<?php echo $ad['id']; ?>" target="_blank" ><?php
$url = parse_url($ad['redirect']);
echo $url['host'];
?> <i class="fa fa-external-link"></i>
</a>
</div>
<a id="adButton" href="#" class="adControl" <?php if (!empty($ad['skip_after_seconds'])) { ?> style="display: none;" <?php } ?>><?php echo __("Skip Ad"); ?> <span class="fa fa-step-forward"></span></a>
<a id="adButton" href="#" class="adControl" <?php if (!empty($ad['skip_after_seconds'])) { ?> style="display: none;" <?php } ?>>
<?php echo __("Skip Ad"); ?> <span class="fa fa-step-forward"></span></a>
<?php } ?>
</div>
</div>
<?php if ($config->getAllow_download()) { ?>
<a class="btn btn-xs btn-default pull-right " role="button" href="<?php echo $global['webSiteRootURL']."videos/".$playNowVideo['filename']; ?>.mp4" download="<?php echo $playNowVideo['title'].".mp4"; ?>" >
@ -88,7 +66,6 @@ if (!empty($ad)) {
</a>
<?php } ?>
</div>
<div class="col-sm-2 col-md-2"></div>
</div>
<!--/row-->
@ -96,37 +73,27 @@ if (!empty($ad)) {
var player;
$(document).ready(function () {
<?php if (!$config->getAllow_download()) { ?>
//Prevent HTML5 video from being downloaded (right-click saved)?
// Prevent HTML5 video from being downloaded (right-click saved)?
$('#mainVideo').bind('contextmenu', function () {
return false;
});
<?php } /* else { ?>
$('#mainVideo').bind('contextmenu', function (event) {
event.preventDefault();
return '<a href="blubb">Hallo Welt!</a>';
});
<?php } */ ?>
<?php } ?>
fullDuration = strToSeconds('<?php echo @$ad['duration']; ?>');
player = videojs('mainVideo');
player.zoomrotate(<?php echo $transformation; ?>);
player.on('play', function () {
addView(<?php echo $playNowVideo['id']; ?>);
});
player.ready(function () {
<?php
if ($config->getAutoplay()) {
<?php if ($config->getAutoplay()) {
echo "setTimeout(function () { if(typeof player === 'undefined'){ player = videojs('mainVideo');}player.play();}, 150);";
} else {
?>
} else { ?>
if (Cookies.get('autoplay') && Cookies.get('autoplay') !== 'false') {
setTimeout(function () { if(typeof player === 'undefined'){ player = videojs('mainVideo');} player.play();}, 150);
}
<?php }
?>
<?php if (!empty($logId)) { ?>
if (!empty($logId))
{ ?>
isPlayingAd = true;
this.on('ended', function () {
console.log("Finish Video");
@ -136,53 +103,42 @@ if ($config->getAutoplay()) {
}
<?php
// if autoplay play next video
if (!empty($autoPlayVideo)) {
?>
if (!empty($autoPlayVideo)) { ?>
else if (Cookies.get('autoplay') && Cookies.get('autoplay') !== 'false') {
document.location = '<?php echo $autoPlayVideo['url']; ?>';
}
<?php
}
?>
<?php } ?>
});
this.on('timeupdate', function () {
var durationLeft = fullDuration - this.currentTime();
$("#adUrl .time").text(secondsToStr(durationLeft + 1, 2));
<?php if (!empty($ad['skip_after_seconds'])) {
?>
if (isPlayingAd && this.currentTime() ><?php echo intval($ad['skip_after_seconds']); ?>) {
<?php if (!empty($ad['skip_after_seconds'])) { ?>
if (isPlayingAd && this.currentTime() ><?php
echo intval($ad['skip_after_seconds']); ?>) {
$('#adButton').fadeIn();
}
<?php }
?>
<?php } ?>
});
<?php } else {
?>
<?php } else { ?>
this.on('ended', function () {
console.log("Finish Video");
<?php
// if autoplay play next video
if (!empty($autoPlayVideo)) {
?>
<?php // if autoplay play next video
if (!empty($autoPlayVideo)) { ?>
if (Cookies.get('autoplay') && Cookies.get('autoplay') !== 'false') {
document.location = '<?php echo $autoPlayVideo['url']; ?>';
document.location = '<?php
echo $autoPlayVideo['url']; ?>';
}
<?php
}
?>
<?php } ?>
});
<?php }
?>
<?php } ?>
});
player.persistvolume({
namespace: "YouPHPTube"
});
<?php
if (!empty($logId)) {
$sources = getSources($video['filename'], true);
?>
if (!empty($logId)){
$sources = getSources($video['filename'], true); ?>
$('#adButton').click(function () {
isPlayingAd = false;
console.log("Change Video");

View file

@ -5,29 +5,21 @@ if (!User::isAdmin()) {
header("Location: {$global['webSiteRootURL']}?error=" . __("You can not manage categories"));
exit;
}
require_once $global['systemRootPath'] . 'objects/category.php';
?>
require_once $global['systemRootPath'] . 'objects/category.php'; ?>
<!DOCTYPE html>
<html lang="<?php echo $_SESSION['language']; ?>">
<head>
<title><?php echo $config->getWebSiteTitle(); ?> :: <?php echo __("Category"); ?></title>
<?php
include $global['systemRootPath'] . 'view/include/head.php';
?>
<?php include $global['systemRootPath'] . 'view/include/head.php'; ?>
<script src="<?php echo $global['webSiteRootURL']; ?>css/fontawesome-iconpicker/dist/js/fontawesome-iconpicker.min.js" type="text/javascript"></script>
<link href="<?php echo $global['webSiteRootURL']; ?>css/fontawesome-iconpicker/dist/css/fontawesome-iconpicker.min.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<?php
include 'include/navbar.php';
?>
<?php include 'include/navbar.php'; ?>
<div class="container">
<?php
include 'include/updateCheck.php';
?>
<?php include 'include/updateCheck.php'; ?>
<button type="button" class="btn btn-default" id="addCategoryBtn">
<span class="glyphicon glyphicon-plus" aria-hidden="true"></span> <?php echo __("New Category"); ?>
</button>
@ -41,6 +33,8 @@ require_once $global['systemRootPath'] . 'objects/category.php';
<th data-column-id="clean_name"><?php echo __("Clean Name"); ?></th>
<th data-column-id="description"><?php echo __("Description"); ?></th>
<th data-column-id="nextVideoOrder" data-formatter="nextVideoOrder"><?php echo __("Next video order"); ?></th>
<th data-column-id="parentId" data-formatter="parentId" ><?php echo __("Parent ID"); ?></th>
<th data-column-id="type" data-formatter="type"><?php echo __("Type"); ?></th>
<th data-column-id="commands" data-formatter="commands" data-sortable="false"></th>
</tr>
</thead>
@ -62,13 +56,23 @@ require_once $global['systemRootPath'] . 'objects/category.php';
<input type="text" id="inputCleanName" class="form-control last" placeholder="<?php echo __("Clean Name"); ?>" required>
<label class="sr-only" for="inputDescription"><?php echo __("Description"); ?></label>
<textarea class="form-control" rows="5" id="inputDescription" placeholder="<?php echo __("Description"); ?>"></textarea>
<label for="inputNextVideoOrder"><?php echo __("Autoplay next-video-order"); ?></label>
<label><?php echo __("Autoplay next-video-order"); ?></label>
<select class="form-control" id="inputNextVideoOrder">
<option value="0"><?php echo __("Random"); ?></option>
<option value="1"><?php echo __("By name"); ?></option>
</select>
<div><label><?php echo __("Parent-Category"); ?></label>
<select class="form-control" id="inputParentId">
</select>
</div>
<div><label for="inputType"><?php echo __("Type"); ?></label>
<select class="form-control" id="inputType">
<option value="3"><?php echo __("Auto"); ?></option>
<option value="0"><?php echo __("Both"); ?></option>
<option value="1"><?php echo __("Audio"); ?></option>
<option value="2"><?php echo __("Video"); ?></option>
</select>
</div>
<div class="btn-group">
<button data-selected="graduation-cap" type="button" class="icp iconCat btn btn-default dropdown-toggle iconpicker-component" data-toggle="dropdown">
<?php echo __("Select an icon for the category"); ?> <i class="fa fa-fw"></i>
@ -86,21 +90,34 @@ require_once $global['systemRootPath'] . 'objects/category.php';
</div><!-- /.modal-dialog -->
</div><!-- /.modal -->
</div><!--/.container-->
<?php
include 'include/footer.php';
?>
<?php include 'include/footer.php'; ?>
<script>
var fullCatList;
$(document).ready(function () {
$('.iconCat').iconpicker({
//searchInFooter: true, // If true, the search will be added to the footer instead of the title
//inputSearch:true,
//showFooter:true
});
function refreshSubCategoryList(){
$.getJSON( "<?php echo $global['webSiteRootURL'] . "categories.json"; ?>", function( data ) {
var tmpHtml = "<option value='0' ><?php echo __("None (Parent)"); ?></option>";
fullCatList = data;
$.each( data.rows, function( key, val ) {
console.log(val.id+" "+val.name)
tmpHtml += "<option id='subcat"+val.id+"' value='"+val.id+"' >"+val.name+"</option>";
});
$("#inputParentId").html(tmpHtml);
});
}
$('#categoryFormModal').on('hidden.bs.modal', function () {
// when modal is closed in any way, get the new list - show old entry again (hidden by edit) + if a name was changed, it's corrected with this reload.
refreshSubCategoryList();
})
refreshSubCategoryList();
var grid = $("#grid").bootgrid({
ajax: true,
@ -113,6 +130,42 @@ require_once $global['systemRootPath'] . 'objects/category.php';
return "<?php echo __("By name"); ?>";
}
},
"parentId": function(column, row){
//if(fullCatList==undefined){
// refreshSubCategoryList();
// }
if(fullCatList!=undefined){
var returnValue;
$.each( fullCatList.rows, function( key, val ) {
//console.log(val.id + " = "+row.id);
if(val.id==row.parentId){
console.log("found sub "+val.name);
returnValue = val.name;
} else if((row.parentId=="0")||(row.parentId=="-1")){
console.log("found parent");
returnValue = "<?php echo __("None (Parent)"); ?>";
}
});
if(returnValue!=undefined){
return returnValue;
}
}
return <?php __("Not loaded yet"); ?>;
},
"type": function(column, row){
if(row.type=='3'){
return "<?php echo __("Auto"); ?>";
} else if(row.type=='0'){
return "<?php echo __("Both"); ?>";
} else if(row.type=='1'){
return "<?php echo __("Audio"); ?>";
} else if(row.type=='2'){
return "<?php echo __("Video"); ?>";
} else {
return "<?php echo __("Invalid"); ?>";
}
},
"commands": function (column, row)
{
var editBtn = '<button type="button" class="btn btn-xs btn-default command-edit" data-row-id="' + row.id + '" data-toggle="tooltip" data-placement="left" title="Edit"><span class="glyphicon glyphicon-edit" aria-hidden="true"></span></button>'
@ -121,17 +174,18 @@ require_once $global['systemRootPath'] . 'objects/category.php';
}
}
}).on("loaded.rs.jquery.bootgrid", function () {
/* Executes after data is loaded and rendered */
grid.find(".command-edit").on("click", function (e) {
var row_index = $(this).closest('tr').index();
var row = $("#grid").bootgrid("getCurrentRows")[row_index];
console.log(row);
// console.log(row);
$("#subcat"+row.id).hide(); // hide own entry
$('#inputCategoryId').val(row.id);
$('#inputName').val(row.name);
$('#inputCleanName').val(row.clean_name);
$('#inputDescription').val(row.description);
$('#inputNextVideoOrder').val(row.nextVideoOrder);
$('#inputParentId').val(row.parentId);
$('#inputType').val(row.type);
$(".iconCat i").attr("class", row.iconClass);
$('#categoryFormModal').modal();
@ -184,7 +238,8 @@ require_once $global['systemRootPath'] . 'objects/category.php';
$('#inputName').val('');
$('#inputCleanName').val('');
$('#inputDescription').val('');
$('#inputParentId').val('0');
$('#inputType').val('3');
$('#categoryFormModal').modal();
});
@ -197,7 +252,7 @@ require_once $global['systemRootPath'] . 'objects/category.php';
modal.showPleaseWait();
$.ajax({
url: 'addNewCategory',
data: {"id": $('#inputCategoryId').val(), "name": $('#inputName').val(), "clean_name": $('#inputCleanName').val(),"description": $('#inputDescription').val(),"nextVideoOrder": $('#inputNextVideoOrder').val(), "iconClass": $(".iconCat i").attr("class")},
data: {"id": $('#inputCategoryId').val(), "name": $('#inputName').val(), "clean_name": $('#inputCleanName').val(),"description": $('#inputDescription').val(),"nextVideoOrder": $('#inputNextVideoOrder').val(),"parentId": $('#inputParentId').val(),"type": $('#inputType').val(), "iconClass": $(".iconCat i").attr("class")},
type: 'post',
success: function (response) {
if (response.status === "1") {

View file

@ -7,17 +7,16 @@ if (!User::canUpload()) {
}
require_once $global['systemRootPath'] . 'objects/category.php';
require_once $global['systemRootPath'] . 'objects/video.php';
$categories = Category::getAllCategories();
require_once $global['systemRootPath'] . 'objects/userGroups.php';
$userGroups = UserGroups::getAllUsersGroups();
unset($_SESSION['type']);
if (!empty($_GET['video_id'])) {
if (Video::canEdit($_GET['video_id'])) {
$row = Video::getVideo($_GET['video_id']);
}
}
?>
<!DOCTYPE html>
<html lang="<?php echo $_SESSION['language']; ?>">
@ -53,14 +52,9 @@ if (!empty($_GET['video_id'])) {
</head>
<body>
<?php
include 'include/navbar.php';
?>
<?php include 'include/navbar.php'; ?>
<div class="container">
<?php
include 'include/updateCheck.php';
?>
<?php include 'include/updateCheck.php'; ?>
<div class="btn-group" >
<a href="<?php echo $global['webSiteRootURL']; ?>usersGroups" class="btn btn-warning">
<span class="fa fa-users"></span> <?php echo __("User Groups"); ?>
@ -73,6 +67,7 @@ if (!empty($_GET['video_id'])) {
<?php echo __("Video Chart"); ?>
</a>
<?php
$categories = Category::getAllCategories();
if (empty($advancedCustom->doNotShowEncoderButton)) {
if (!empty($config->getEncoderURL())) {
?>
@ -829,6 +824,7 @@ if (!empty($row)) {
}
tags += "<span class='label label-primary fix-width'>" + row.tags[i].label + ": </span><span class=\"label label-" + row.tags[i].type + " fix-width\">" + row.tags[i].text + "</span><br>";
}
tags += "<span class='label label-primary fix-width'><?php echo __("Type").":"; ?> </span><span class=\"label label-default fix-width\">" + row.type + "</span><br>";
return tags;
},
"checkbox": function (column, row) {
@ -862,7 +858,7 @@ if (!empty($row)) {
var type, img, is_portrait;
if (row.type === "audio") {
type = "<span class='fa fa-headphones' style='font-size:14px;'></span> ";
img = "<img class='img img-responsive img-thumbnail pull-left rotate" + row.rotation + "' src='<?php echo $global['webSiteRootURL']; ?>view/img/audio_wave.jpg' style='max-height:80px; margin-right: 5px;'> ";
img = "<img class='img img-responsive img-thumbnail pull-left rotate" + row.rotation + "' src='<?php echo $global['webSiteRootURL']; ?>videos/"+row.filename+".jpg' style='max-height:80px; margin-right: 5px;'> ";
} else {
type = "<span class='fa fa-film' style='font-size:14px;'></span> ";
is_portrait = (row.rotation === "90" || row.rotation === "270") ? "img-portrait" : "";

View file

@ -60,7 +60,7 @@ if (!User::canUpload()) {
<div class="alert alert-warning">
<h1>
<span class="glyphicon glyphicon-warning-sign" style="font-size:1em;"></span>
<?php echo __("This page works only with a MP4 File, if you have or need any other format, try to install your own <a href='https://github.com/DanielnetoDotCom/YouPHPTube-Encoder' class='btn btn-warning btn-xs'>encoder</a> or use the <a href='https://encoder.youphptube.com/' class='btn btn-warning btn-xs'>public</a> one"); ?>
<?php echo __("This page works only with MP4,MP3 and OGG-files, if you have or need any other format, try to install your own <a href='https://github.com/DanielnetoDotCom/YouPHPTube-Encoder' class='btn btn-warning btn-xs'>encoder</a> or use the <a href='https://encoder.youphptube.com/' class='btn btn-warning btn-xs'>public</a> one"); ?>
</h1>
</div>
<?php

View file

@ -1,71 +1,107 @@
<?php
$configFile = '../../videos/configuration.php';
if (!file_exists($configFile)) {
if (!file_exists($configFile))
{
$configFile = '../videos/configuration.php';
}
session_write_close();
$obj = new stdClass();
$obj->error = true;
require_once $configFile;
if (!User::canUpload()) {
if (!User::canUpload())
{
$obj->msg = "Only logged users can upload";
die(json_encode($obj));
}
header('Content-Type: application/json');
// A list of permitted file extensions
$allowed = array('mp4');
if (isset($_FILES['upl']) && $_FILES['upl']['error'] == 0) {
$allowed = array(
'mp4',
'ogg',
'mp3'
);
if (isset($_FILES['upl']) && $_FILES['upl']['error'] == 0)
{
$extension = pathinfo($_FILES['upl']['name'], PATHINFO_EXTENSION);
if (!in_array(strtolower($extension), $allowed)) {
if (!in_array(strtolower($extension) , $allowed))
{
$obj->msg = "File extension error [{$_FILES['upl']['name']}], we allow only (" . implode(",", $allowed) . ")";
die(json_encode($obj));
}
//var_dump($extension, $type);exit;
require_once $global['systemRootPath'] . 'objects/video.php';
$duration = Video::getDurationFromFile($_FILES['upl']['tmp_name']);
$path_parts = pathinfo($_FILES['upl']['name']);
$mainName = preg_replace("/[^A-Za-z0-9]/", "", cleanString($path_parts['filename']));
$filename = uniqid($mainName . "_", true);
$video = new Video(substr(preg_replace("/_+/", " ", $_FILES['upl']['name']), 0, -4), $filename, @$_FILES['upl']['videoId']);
$video = new Video(substr(preg_replace("/_+/", " ", $_FILES['upl']['name']) , 0, -4) , $filename, @$_FILES['upl']['videoId']);
$video->setDuration($duration);
if ($extension == "mp4")
{
$video->setType("video");
}
else
if (($extension == "mp3") || ($extension == "ogg"))
{
$video->setType("audio");
}
$advancedCustom = YouPHPTubePlugin::getObjectDataIfEnabled("CustomizeAdvanced");
if (empty($advancedCustom->makeVideosInactiveAfterEncode)) {
if (empty($advancedCustom->makeVideosInactiveAfterEncode))
{
// set active
$video->setStatus('a');
} else {
}
else
{
$video->setStatus('i');
}
$id = $video->save();
$id = $video->save();
/**
* This is when is using in a non uploaded movie
*/
$aws_s3 = YouPHPTubePlugin::loadPluginIfEnabled('AWS_S3');
$tmp_name = $_FILES['upl']['tmp_name'];
$filenameMP4 = $filename . ".mp4";
$filenameMP4 = $filename . "." . $extension;
decideMoveUploadedToVideos($tmp_name, $filenameMP4);
if (YouPHPTubePlugin::isEnabled("996c9afb-b90e-40ca-90cb-934856180bb9")) {
if ((YouPHPTubePlugin::isEnabled("996c9afb-b90e-40ca-90cb-934856180bb9")) && ($extension == "mp4"))
{
require_once $global['systemRootPath'] . 'plugin/MP4ThumbsAndGif/MP4ThumbsAndGif.php';
$videoFileName = $video->getFilename();
MP4ThumbsAndGif::getImage($videoFileName, 'jpg');
MP4ThumbsAndGif::getImage($videoFileName, 'gif');
} else if(YouPHPTubePlugin::isEnabled("916c9afb-css90e-26fa-97fd-864856180cc9")) {
}
else
if ((YouPHPTubePlugin::isEnabled("916c9afb-css90e-26fa-97fd-864856180cc9")) && ($extension == "mp4"))
{
require_once $global['systemRootPath'] . 'plugin/MP4ThumbsAndGifLocal/MP4ThumbsAndGifLocal.php';
$videoFileName = $video->getFilename();
MP4ThumbsAndGifLocal::getImage($videoFileName, 'jpg');
MP4ThumbsAndGifLocal::getImage($videoFileName, 'gif');
}
// } else if(($extension=="mp3")||($extension=="ogg")){
// }
$obj->error = false;
$obj->filename = $filename;
$obj->duration = $duration;
die(json_encode($obj));
}
$obj->msg = "\$_FILES Error";
$obj->FILES = $_FILES;
die(json_encode($obj));

View file

@ -5,7 +5,6 @@ if (!file_exists('../videos/configuration.php')) {
}
header("Location: install/index.php");
}
require_once '../videos/configuration.php';
session_write_close();
require_once $global['systemRootPath'] . 'objects/user.php';
@ -20,37 +19,53 @@ $imgh = 720;
if (!empty($_GET['type'])) {
if ($_GET['type'] == 'audio') {
$_SESSION['type'] = 'audio';
} else if ($_GET['type'] == 'video') {
}
else
if ($_GET['type'] == 'video') {
$_SESSION['type'] = 'video';
} else {
}
else {
$_SESSION['type'] = "";
unset($_SESSION['type']);
}
} else {
unset($_SESSION['type']);
}
require_once $global['systemRootPath'] . 'objects/video.php';
require_once $global['systemRootPath'] . 'objects/video_ad.php';
$catLink = "";
if (!empty($_GET['catName'])) {
$catLink = "cat/{$_GET['catName']}/";
}
$video = Video::getVideo("", "viewableNotAd", false, false, true);
if (empty($video)) {
$video = Video::getVideo("", "viewableNotAd");
}
if (empty($_GET['videoName'])) {
$_GET['videoName'] = $video['clean_title'];
}
$obj = new Video("", "", $video['id']);
//$resp = $obj->addView();
if(empty($_SESSION['type'])){
$_SESSION['type'] = $video['type'];
}
// $resp = $obj->addView();
if (!empty($_GET['playlist_id'])) {
$playlist_id = $_GET['playlist_id'];
if (!empty($_GET['playlist_index'])) {
$playlist_index = $_GET['playlist_index'];
} else {
}
else {
$playlist_index = 0;
}
$videosArrayId = PlayList::getVideosIdFromPlaylist($_GET['playlist_id']);
$videosPlayList = Video::getAllVideos("viewableNotAd");
$videosPlayList = PlayList::sortVideos($videosPlayList, $videosArrayId);
@ -59,34 +74,40 @@ if (!empty($_GET['playlist_id'])) {
$autoPlayVideo = Video::getVideo($videosPlayList[$playlist_index + 1]['id']);
$autoPlayVideo['url'] = $global['webSiteRootURL'] . "playlist/{$playlist_id}/" . ($playlist_index + 1);
}
unset($_GET['playlist_id']);
} else {
}
else {
if (!empty($video['next_videos_id'])) {
$autoPlayVideo = Video::getVideo($video['next_videos_id']);
} else {
if($video['category_order']==1){
}
else {
if ($video['category_order'] == 1) {
unset($_POST['sort']);
$category = Category::getAllCategories();
$_POST['sort']['title'] = "ASC";
// maybe there's a more slim method?
$videos = Video::getAllVideos();
$videoFound = false;
$autoPlayVideo;
foreach ($videos as $value) {
if($videoFound){
foreach($videos as $value) {
if ($videoFound) {
$autoPlayVideo = $value;
break;
}
if($value['id']==$video['id']){
// if the video is found, make another round to have the next video properly.
$videoFound=true;
}
}
} else {
if ($value['id'] == $video['id']) {
// if the video is found, make another round to have the next video properly.
$videoFound = true;
}
}
}
else {
$autoPlayVideo = Video::getRandom($video['id']);
}
}
if (!empty($autoPlayVideo)) {
$name2 = User::getNameIdentificationById($autoPlayVideo['users_id']);
$autoPlayVideo['creator'] = '<div class="pull-left"><img src="' . User::getPhoto($autoPlayVideo['users_id']) . '" alt="" class="img img-responsive img-circle zoom" style="max-width: 40px;"/></div><div class="commentDetails" style="margin-left:45px;"><div class="commenterName"><strong>' . $name2 . '</strong> <small>' . humanTiming(strtotime($autoPlayVideo['videoCreation'])) . '</small></div></div>';
@ -100,16 +121,18 @@ if (!empty($video)) {
$name = User::getNameIdentificationById($video['users_id']);
$name = "<a href='{$global['webSiteRootURL']}channel/{$video['users_id']}/' class='btn btn-xs btn-default'>{$name}</a>";
$subscribe = Subscribe::getButton($video['users_id']);
$video['creator'] = '<div class="pull-left"><img src="' . User::getPhoto($video['users_id']) . '" alt="" class="img img-responsive img-circle zoom" style="max-width: 40px;"/></div><div class="commentDetails" style="margin-left:45px;"><div class="commenterName text-muted"><strong>' . $name . '</strong><br>' . $subscribe . '<br><small>' . humanTiming(strtotime($video['videoCreation'])) . '</small></div></div>';
$video['creator'] = '<div class="pull-left"><img src="' . User::getPhoto($video['users_id']) . '" alt="" class="img img-responsive img-circle zoom" style="max-width: 40px;"/></div><div class="commentDetails" style="margin-left:45px;"><div class="commenterName text-muted"><strong>' . $name . '</strong><br />' . $subscribe . '<br /><small>' . humanTiming(strtotime($video['videoCreation'])) . '</small></div></div>';
$obj = new Video("", "", $video['id']);
// dont need because have one embeded video on this page
//$resp = $obj->addView();
// $resp = $obj->addView();
}
if ($video['type'] !== "audio") {
$poster = "{$global['webSiteRootURL']}videos/{$video['filename']}.jpg";
} else {
}
else {
$poster = "{$global['webSiteRootURL']}view/img/audio_wave.jpg";
}
@ -120,7 +143,8 @@ if (!empty($video)) {
$data = getimgsize($source['path']);
$imgw = $data[0];
$imgh = $data[1];
} else {
}
else {
$img = "{$global['webSiteRootURL']}view/img/audio_wave.jpg";
}
}
@ -128,13 +152,12 @@ if (!empty($video)) {
$advancedCustom = YouPHPTubePlugin::getObjectDataIfEnabled("CustomizeAdvanced");
?>
<!DOCTYPE html>
<html lang="<?php echo $_SESSION['language']; ?>">
<html lang="<?php
echo $_SESSION['language']; ?>">
<head>
<title><?php echo $video['title']; ?> - <?php echo $config->getWebSiteTitle(); ?></title>
<meta name="generator" content="YouPHPTube - A Free Youtube Clone Script" />
<?php
include $global['systemRootPath'] . 'view/include/head.php';
?>
<?php include $global['systemRootPath'] . 'view/include/head.php'; ?>
<link rel="image_src" href="<?php echo $img; ?>" />
<link href="<?php echo $global['webSiteRootURL']; ?>js/video.js/video-js.min.css" rel="stylesheet" type="text/css"/>
<link href="<?php echo $global['webSiteRootURL']; ?>js/videojs-contrib-ads/videojs.ads.css" rel="stylesheet" type="text/css"/>
@ -150,15 +173,12 @@ $advancedCustom = YouPHPTubePlugin::getObjectDataIfEnabled("CustomizeAdvanced");
<meta property="og:image" content="<?php echo $img; ?>" />
<meta property="og:image:width" content="<?php echo $imgw; ?>" />
<meta property="og:image:height" content="<?php echo $imgh; ?>" />
<meta property="video:duration" content="<?php echo Video::getItemDurationSeconds($video['duration']); ?>" />
<meta property="duration" content="<?php echo Video::getItemDurationSeconds($video['duration']); ?>" />
</head>
<body>
<?php
include 'include/navbar.php';
?>
<?php include 'include/navbar.php'; ?>
<div class="container-fluid principalContainer" itemscope itemtype="http://schema.org/VideoObject">
<?php
if (!empty($video)) {
@ -166,7 +186,6 @@ $advancedCustom = YouPHPTubePlugin::getObjectDataIfEnabled("CustomizeAdvanced");
$video['type'] = "video";
}
$img_portrait = ($video['rotation'] === "90" || $video['rotation'] === "270") ? "img-portrait" : "";
if (!empty($advancedCustom->showAdsenseBannerOnTop)) {
?>
<style>
@ -203,14 +222,12 @@ $advancedCustom = YouPHPTubePlugin::getObjectDataIfEnabled("CustomizeAdvanced");
</div>
<div class="col-xs-8 col-sm-8 col-md-8">
<h1 itemprop="name">
<?php echo $video['title']; ?>
<?php
if(Video::canEdit($video['id'])){
echo $video['title'];
if (Video::canEdit($video['id'])) {
?>
<a href="<?php echo $global['webSiteRootURL']; ?>mvideos?video_id=<?php echo $video['id']; ?>" class="btn btn-primary btn-xs" data-toggle="tooltip" title="<?php echo __("Edit Video"); ?>"><i class="fa fa-edit"></i> <?php echo __("Edit Video"); ?></a>
<?php
}
?>
<?php } ?>
<small>
<?php
if (!empty($video['id'])) {
@ -218,9 +235,8 @@ $advancedCustom = YouPHPTubePlugin::getObjectDataIfEnabled("CustomizeAdvanced");
} else {
$video['tags'] = array();
}
foreach ($video['tags'] as $value) {
if ($value->label === __("Group")) {
?>
foreach($video['tags'] as $value) {
if ($value->label === __("Group")) { ?>
<span class="label label-<?php echo $value->type; ?>"><?php echo $value->text; ?></span>
<?php
}
@ -241,18 +257,15 @@ $advancedCustom = YouPHPTubePlugin::getObjectDataIfEnabled("CustomizeAdvanced");
<span class="fa fa-plus"></span> <?php echo __("Add to"); ?>
</button>
<div class="webui-popover-content">
<?php
if (User::isLogged()) {
?>
<?php if (User::isLogged()) { ?>
<form role="form">
<div class="form-group">
<input class="form-control" id="searchinput" type="search" placeholder="Search..." />
</div>
<div id="searchlist" class="list-group">
</div>
</form>
<div >
<div>
<hr>
<div class="form-group">
<input id="playListName" class="form-control" placeholder="<?php echo __("Create a New Play List"); ?>" >
@ -268,9 +281,7 @@ $advancedCustom = YouPHPTubePlugin::getObjectDataIfEnabled("CustomizeAdvanced");
<button class="btn btn-success btn-block" id="addPlayList" ><?php echo __("Create a New Play List"); ?></button>
</div>
</div>
<?php
} else {
?>
<?php } else { ?>
<h5>Want to watch this again later?</h5>
Sign in to add this video to a playlist.
@ -279,9 +290,7 @@ $advancedCustom = YouPHPTubePlugin::getObjectDataIfEnabled("CustomizeAdvanced");
<span class="glyphicon glyphicon-log-in"></span>
<?php echo __("Login"); ?>
</a>
<?php
}
?>
<?php } ?>
</div>
<script>
function loadPlayLists() {
@ -367,31 +376,17 @@ $advancedCustom = YouPHPTubePlugin::getObjectDataIfEnabled("CustomizeAdvanced");
<a href="#" class="btn btn-default no-outline" id="shareBtn">
<span class="fa fa-share"></span> <?php echo __("Share"); ?>
</a>
<?php
echo YouPHPTubePlugin::getWatchActionButton();
?>
<a href="#" class="btn btn-default no-outline pull-right <?php echo ($video['myVote'] == -1) ? "myVote" : "" ?>" id="dislikeBtn"
<?php
if (!User::isLogged()) {
?>
data-toggle="tooltip" title="<?php echo __("Don´t like this video? Sign in to make your opinion count."); ?>"
<?php } ?>>
<?php echo YouPHPTubePlugin::getWatchActionButton(); ?>
<a href="#" class="btn btn-default no-outline pull-right <?php echo ($video['myVote'] == - 1) ? "myVote" : "" ?>" id="dislikeBtn" <?php if (!User::isLogged()) { ?> data-toggle="tooltip" title="<?php echo __("Don´t like this video? Sign in to make your opinion count."); ?>" <?php } ?>>
<span class="fa fa-thumbs-down"></span> <small><?php echo $video['dislikes']; ?></small>
</a>
<a href="#" class="btn btn-default no-outline pull-right <?php echo ($video['myVote'] == 1) ? "myVote" : "" ?>" id="likeBtn"
<?php
if (!User::isLogged()) {
?>
data-toggle="tooltip" title="<?php echo __("Like this video? Sign in to make your opinion count."); ?>"
<?php } ?>>
<span class="fa fa-thumbs-up"></span> <small><?php echo $video['likes']; ?></small>
<a href="#" class="btn btn-default no-outline pull-right <?php echo ($video['myVote'] == 1) ? "myVote" : "" ?>" id="likeBtn" <?php if (!User::isLogged()) { ?> data-toggle="tooltip" title="<?php echo __("Like this video? Sign in to make your opinion count."); ?>" <?php } ?>>
<span class="fa fa-thumbs-up"></span>
<small><?php echo $video['likes']; ?></small>
</a>
<script>
$(document).ready(function () {
<?php
if (User::isLogged()) {
?>
<?php if (User::isLogged()) { ?>
$("#dislikeBtn, #likeBtn").click(function () {
$.ajax({
url: '<?php echo $global['webSiteRootURL']; ?>' + ($(this).attr("id") == "dislikeBtn" ? "dislike" : "like"),
@ -410,18 +405,12 @@ $advancedCustom = YouPHPTubePlugin::getObjectDataIfEnabled("CustomizeAdvanced");
});
return false;
});
<?php
} else {
?>
<?php } else { ?>
$("#dislikeBtn, #likeBtn").click(function () {
$(this).tooltip("show");
return false;
});
<?php
}
?>
<?php } ?>
});
</script>
</div>
@ -463,29 +452,28 @@ $advancedCustom = YouPHPTubePlugin::getObjectDataIfEnabled("CustomizeAdvanced");
$url = urlencode($global['webSiteRootURL'] . "{$catLink}video/" . $video['clean_title']);
$title = urlencode($video['title']);
include './include/social.php';
?>
</div>
<div class="tab-pane" id="tabEmbed">
<h4><span class="glyphicon glyphicon-share"></span> <?php echo __("Share Video"); ?>:</h4>
<textarea class="form-control" style="min-width: 100%" rows="5"><?php
<textarea class="form-control" style="min-width: 100%" rows="5">
<?php
if ($video['type'] == 'video' || $video['type'] == 'embed') {
$code = '<iframe width="640" height="480" style="max-width: 100%;max-height: 100%;" src="' . Video::getLink($video['id'], $video['clean_title'], true) . '" frameborder="0" allowfullscreen="allowfullscreen" class="YouPHPTubeIframe"></iframe>';
} else {
}
else {
$code = '<iframe width="350" height="40" style="max-width: 100%;max-height: 100%;" src="' . Video::getLink($video['id'], $video['clean_title'], true) . '" frameborder="0" allowfullscreen="allowfullscreen" class="YouPHPTubeIframe"></iframe>';
}
echo htmlentities($code);
?></textarea>
echo htmlentities($code); ?>
</textarea>
</div>
<div class="tab-pane" id="tabEmail">
<?php
if (!User::isLogged()) {
?>
<?php if (!User::isLogged()) { ?>
<strong>
<a href="<?php echo $global['webSiteRootURL']; ?>user"><?php echo __("Sign in now!"); ?></a>
</strong>
<?php
} else {
?>
<?php } else { ?>
<form class="well form-horizontal" action="<?php echo $global['webSiteRootURL']; ?>sendEmail" method="post" id="contact_form">
<fieldset>
<!-- Text input-->
@ -510,8 +498,6 @@ $advancedCustom = YouPHPTubePlugin::getObjectDataIfEnabled("CustomizeAdvanced");
</div>
</div>
</div>
<div class="form-group">
<label class="col-md-4 control-label"><?php echo __("Type the code"); ?></label>
<div class="col-md-8 inputGroupContainer">
@ -559,9 +545,7 @@ $advancedCustom = YouPHPTubePlugin::getObjectDataIfEnabled("CustomizeAdvanced");
});
});
</script>
<?php
}
?>
<?php } ?>
</div>
<div class="tab-pane" id="tabPermaLink">
@ -576,8 +560,6 @@ $advancedCustom = YouPHPTubePlugin::getObjectDataIfEnabled("CustomizeAdvanced");
<div class="col-xs-12 col-sm-12 col-lg-12">
<div class="col-xs-4 col-sm-2 col-lg-2 text-right"><strong><?php echo __("Category"); ?>:</strong></div>
<div class="col-xs-8 col-sm-10 col-lg-10"><a class="btn btn-xs btn-default" href="<?php echo $global['webSiteRootURL']; ?>cat/<?php echo $video['clean_category']; ?>"><span class="<?php echo $video['iconClass']; ?>"></span> <?php echo $video['category']; ?></a></div>
<div class="col-xs-4 col-sm-2 col-lg-2 text-right"><strong><?php echo __("Description"); ?>:</strong></div>
<div class="col-xs-8 col-sm-10 col-lg-10" itemprop="description"><?php echo nl2br(textToLink($video['description'])); ?></div>
</div>
@ -594,9 +576,7 @@ $advancedCustom = YouPHPTubePlugin::getObjectDataIfEnabled("CustomizeAdvanced");
});
</script>
<div class="row bgWhite list-group-item">
<?php
include './videoComments.php';
?>
<?php include './videoComments.php'; ?>
</div>
</div>
<div class="col-sm-4 col-md-4 bgWhite list-group-item rightBar">
@ -612,41 +592,23 @@ $advancedCustom = YouPHPTubePlugin::getObjectDataIfEnabled("CustomizeAdvanced");
});
});
</script>
<?php
} else if (empty($autoPlayVideo)) { ?>
<div class="col-lg-12 col-sm-12 col-xs-12 autoplay text-muted" >
<strong>
<?php
echo __("Autoplay ended");
?>
</strong>
<strong><?php echo __("Autoplay ended"); ?></strong>
<span class="pull-right">
<span>
<?php
echo __("Autoplay");
?>
</span>
<span><?php echo __("Autoplay"); ?></span>
<span>
<i class="fa fa-info-circle" data-toggle="tooltip" data-placement="bottom" title="<?php echo __("When autoplay is enabled, a suggested video will automatically play next."); ?>"></i>
</span>
<input type="checkbox" data-toggle="toggle" data-size="mini" class="saveCookie" name="autoplay">
</span>
</div>
<?php } else if (!empty($autoPlayVideo)) {
?>
<?php } else if (!empty($autoPlayVideo)) { ?>
<div class="col-lg-12 col-sm-12 col-xs-12 autoplay text-muted" style="display: none;">
<strong>
<?php
echo __("Up Next");
?>
</strong>
<strong><?php echo __("Up Next"); ?></strong>
<span class="pull-right">
<span>
<?php
echo __("Autoplay");
?>
</span>
<span><?php echo __("Autoplay"); ?></span>
<span>
<i class="fa fa-info-circle" data-toggle="tooltip" data-placement="bottom" title="<?php echo __("When autoplay is enabled, a suggested video will automatically play next."); ?>"></i>
</span>
@ -664,22 +626,20 @@ $advancedCustom = YouPHPTubePlugin::getObjectDataIfEnabled("CustomizeAdvanced");
if ($autoPlayVideo['type'] !== "audio") {
$img = "{$global['webSiteRootURL']}videos/{$autoPlayVideo['filename']}.jpg";
$img_portrait = ($autoPlayVideo['rotation'] === "90" || $autoPlayVideo['rotation'] === "270") ? "img-portrait" : "";
} else {
}
else {
$img = "{$global['webSiteRootURL']}view/img/audio_wave.jpg";
$img_portrait = "";
}
?>
<img src="<?php echo $img; ?>" alt="<?php echo str_replace('"', '', $autoPlayVideo['title']); ?>" class="img-responsive <?php echo $img_portrait; ?> rotate<?php echo $autoPlayVideo['rotation']; ?>" height="130" itemprop="thumbnail" />
<?php
if (!empty($imgGif)) {
?>
<?php if (!empty($imgGif)) { ?>
<img src="<?php echo $imgGif; ?>" style="position: absolute; top: 0; display: none;" alt="<?php echo str_replace('"', '', $autoPlayVideo['title']); ?>" id="thumbsGIF<?php echo $autoPlayVideo['id']; ?>" class="thumbsGIF img-responsive <?php echo $img_portrait; ?> rotate<?php echo $autoPlayVideo['rotation']; ?>" height="130" />
<?php } ?>
<meta itemprop="thumbnailUrl" content="<?php echo $img; ?>" />
<meta itemprop="contentURL" content="<?php echo Video::getLink($autoPlayVideo['id'], $autoPlayVideo['clean_title']); ?>" />
<meta itemprop="embedURL" content="<?php echo Video::getLink($autoPlayVideo['id'], $autoPlayVideo['clean_title'], true); ?>" />
<meta itemprop="uploadDate" content="<?php echo $autoPlayVideo['created']; ?>" />
<time class="duration" itemprop="duration" datetime="<?php echo Video::getItemPropDuration($autoPlayVideo['duration']); ?>"><?php echo Video::getCleanDuration($autoPlayVideo['duration']); ?></time>
</div>
<div class="col-lg-7 col-sm-7 col-xs-7 videosDetails">
@ -695,39 +655,28 @@ $advancedCustom = YouPHPTubePlugin::getObjectDataIfEnabled("CustomizeAdvanced");
<?php echo __("Views"); ?>
</div>
<div><?php echo $autoPlayVideo['creator']; ?></div>
</div>
<div class="row">
<?php
if (!empty($autoPlayVideo['tags'])) {
foreach ($autoPlayVideo['tags'] as $autoPlayVideo2) {
foreach($autoPlayVideo['tags'] as $autoPlayVideo2) {
if ($autoPlayVideo2->label === __("Group")) {
?>
<span class="label label-<?php echo $autoPlayVideo2->type; ?>"><?php echo $autoPlayVideo2->text; ?></span>
<?php
<?php }
}
}
}
?>
} ?>
</div>
</div>
</a>
</div>
<?php
}
if (!empty($advancedCustom->showAdsenseBannerOnLeft)) {
?>
} if (!empty($advancedCustom->showAdsenseBannerOnLeft)) { ?>
<div class="col-lg-12 col-sm-12 col-xs-12">
<?php
echo $config->getAdsense();
?>
</div>
<?php
}
?>
<div class="col-lg-12 col-sm-12 col-xs-12 extraVideos nopadding">
<?php echo $config->getAdsense(); ?>
</div>
<?php } ?>
<div class="col-lg-12 col-sm-12 col-xs-12 extraVideos nopadding"></div>
<!-- videos List -->
<div id="videosList">
<?php include './videosList.php'; ?>
@ -737,7 +686,6 @@ $advancedCustom = YouPHPTubePlugin::getObjectDataIfEnabled("CustomizeAdvanced");
<script>
var fading = false;
$(document).ready(function () {
$("input.saveCookie").each(function () {
var mycookie = Cookies.get($(this).attr('name'));
console.log($(this).attr('name'));
@ -764,21 +712,16 @@ $advancedCustom = YouPHPTubePlugin::getObjectDataIfEnabled("CustomizeAdvanced");
setTimeout(function () {
$('.autoplay').slideDown();
}, 1000);
// Total Itens <?php echo $total; ?>
});
</script>
</div>
<div class="col-sm-1 col-md-1"></div>
</div>
<?php
} else {
?>
<?php } else { ?>
<div class="alert alert-warning">
<span class="glyphicon glyphicon-facetime-video"></span> <strong><?php echo __("Warning"); ?>!</strong> <?php echo __("We have not found any videos or audios to show"); ?>.
</div>
<?php } ?>
</div>
<script src="<?php echo $global['webSiteRootURL']; ?>js/jquery-ui/jquery-ui.min.js" type="text/javascript"></script>
<script>
@ -788,17 +731,11 @@ $advancedCustom = YouPHPTubePlugin::getObjectDataIfEnabled("CustomizeAdvanced");
</script>
<script src="<?php echo $global['webSiteRootURL']; ?>js/video.js/video.js" type="text/javascript"></script>
<script src="<?php echo $global['webSiteRootURL']; ?>js/videojs-contrib-ads/videojs.ads.min.js" type="text/javascript"></script>
<?php
include 'include/footer.php';
?>
<?php include 'include/footer.php'; ?>
<script src="<?php echo $global['webSiteRootURL']; ?>js/videojs-rotatezoom/videojs.zoomrotate.js" type="text/javascript"></script>
<script src="<?php echo $global['webSiteRootURL']; ?>js/videojs-persistvolume/videojs.persistvolume.js" type="text/javascript"></script>
<script src="<?php echo $global['webSiteRootURL']; ?>js/webui-popover/jquery.webui-popover.min.js" type="text/javascript"></script>
<script src="<?php echo $global['webSiteRootURL']; ?>js/bootstrap-list-filter/bootstrap-list-filter.min.js" type="text/javascript"></script>
</body>
</html>
<?php
include $global['systemRootPath'] . 'objects/include_end.php';
?>
<?php include $global['systemRootPath'] . 'objects/include_end.php'; ?>

View file

@ -352,6 +352,11 @@ $advancedCustom = json_decode($json_file);
?>
swal("<?php echo __("Sorry!"); ?>", "<?php echo addslashes($_GET['error']); ?>", "error");
<?php
}
$refererUrl = $_SERVER["HTTP_REFERER"];
if(strpos($_SERVER["HTTP_REFERER"],"?error=".__("You%20can%20not%20manage"))!=false){
$refererUrl = substr($_SERVER["HTTP_REFERER"],0,strpos($_SERVER["HTTP_REFERER"],"?"));
}
?>
$('#loginForm').submit(function (evt) {
@ -366,7 +371,7 @@ $advancedCustom = json_decode($json_file);
modal.hidePleaseWait();
swal("<?php echo __("Sorry!"); ?>", "<?php echo __("Your user or password is wrong!"); ?>", "error");
} else {
document.location = '<?php echo!empty($_SERVER["HTTP_REFERER"]) ? $_SERVER["HTTP_REFERER"] : $global['webSiteRootURL']; ?>'
document.location = '<?php echo!empty($_SERVER["HTTP_REFERER"]) ? $refererUrl : $global['webSiteRootURL']; ?>'
}
}
});