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, `clean_name` VARCHAR(45) NOT NULL,
`description` TEXT NULL, `description` TEXT NULL,
`nextVideoOrder` INT(2) NOT NULL DEFAULT '0', `nextVideoOrder` INT(2) NOT NULL DEFAULT '0',
`parentId` INT NOT NULL DEFAULT '0',
`created` DATETIME NOT NULL, `created` DATETIME NOT NULL,
`modified` DATETIME NOT NULL, `modified` DATETIME NOT NULL,
`iconClass` VARCHAR(45) NOT NULL DEFAULT 'fa fa-folder', `iconClass` VARCHAR(45) NOT NULL DEFAULT 'fa fa-folder',
@ -473,6 +474,19 @@ CREATE TABLE IF NOT EXISTS `comments_likes` (
ON UPDATE CASCADE) ON UPDATE CASCADE)
ENGINE = InnoDB; 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 SQL_MODE=@OLD_SQL_MODE;
SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS; 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 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 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 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 This Video'] = "Du kannst das Videos nicht managen";
$t['You can not manage ads'] = "Du kannst keine Werbung managen"; $t['You can not manage ads'] = "Du kannst keine Werbung managen";
$t['You can not manage categories'] = "Du kannst keine Kategorien managen"; $t['You can not manage categories'] = "Du kannst keine Kategorien managen";

View file

@ -1,4 +1,5 @@
<?php <?php
error_reporting(0);
require_once 'category.php'; require_once 'category.php';
header('Content-Type: application/json'); header('Content-Type: application/json');
$categories = Category::getAllCategories(); $categories = Category::getAllCategories();
@ -7,5 +8,17 @@ $breaks = array("<br />","<br>","<br/>");
foreach ($categories as $key => $value) { foreach ($categories as $key => $value) {
$categories[$key]['iconHtml'] = "<span class='$value[iconClass]'></span>"; $categories[$key]['iconHtml'] = "<span class='$value[iconClass]'></span>";
$categories[$key]['description'] = str_ireplace($breaks, "\r\n", $value['description']); $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).'}'; echo '{ "current": '.$_POST['current'].',"rowCount": '.$_POST['rowCount'].', "total": '.$total.', "rows":'. json_encode($categories).'}';

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -1,5 +1,5 @@
<?php <?php
error_reporting(0);
require_once '../videos/configuration.php'; require_once '../videos/configuration.php';
require_once 'video.php'; require_once 'video.php';
$obj = new stdClass(); $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->DateAdded = true;
$obj->DateAddedRowCount = 12; $obj->DateAddedRowCount = 12;
$obj->sortReverseable = false; $obj->sortReverseable = false;
$obj->SubCategorys = false;
return $obj; 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 <?php
if (!file_exists('../videos/configuration.php')) { if (! file_exists('../videos/configuration.php')) {
if (!file_exists('../install/index.php')) { if (! file_exists('../install/index.php')) {
die("No Configuration and no Installation"); die("No Configuration and no Installation");
} }
header("Location: install/index.php"); header("Location: install/index.php");
} }
require_once '../videos/configuration.php'; require_once '../videos/configuration.php';
require_once $global['systemRootPath'] . 'objects/user.php'; require_once $global['systemRootPath'] . 'objects/user.php';
require_once $global['systemRootPath'] . 'objects/functions.php'; require_once $global['systemRootPath'] . 'objects/functions.php';
$obj = YouPHPTubePlugin::getObjectData("Gallery"); $obj = YouPHPTubePlugin::getObjectData("Gallery");
if (!empty($_GET['type'])) { if (! empty($_GET['type'])) {
if ($_GET['type'] == 'audio') { if ($_GET['type'] == 'audio') {
$_SESSION['type'] = 'audio'; $_SESSION['type'] = 'audio';
} else if ($_GET['type'] == 'video') { } else if ($_GET['type'] == 'video') {
$_SESSION['type'] = 'video'; $_SESSION['type'] = 'video';
} else { } else {
$_SESSION['type'] = "";
unset($_SESSION['type']); unset($_SESSION['type']);
} }
} }
require_once $global['systemRootPath'] . 'objects/video.php'; require_once $global['systemRootPath'] . 'objects/category.php';
if($obj->sortReverseable){ $currentCat;
if(strpos($_SERVER['REQUEST_URI'],"?")!=false){ $currentCatType;
$orderString = $_SERVER['REQUEST_URI']."&"; 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 { } 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 = ""; $upDown = "";
$mostLess = ""; $mostLess = "";
$tmpOrderString = $orderString; $tmpOrderString = $orderString;
if($_GET[$getName]=="DESC"){ if ($_GET[$getName] == "DESC") {
if(strpos($orderString,$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)); $tmpOrderString = substr($orderString, 0, strpos($orderString, $getName . "=DESC")) . $getName . "=ASC" . substr($orderString, strpos($orderString, $getName . "=DESC") + strlen($getName . "=DESC"), strlen($orderString));
} else { } 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; $mostLess = $mostWord;
} else { } else {
if(strpos($orderString,$getName."=ASC")){ 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)); $tmpOrderString = substr($orderString, 0, strpos($orderString, $getName . "=ASC")) . $getName . "=DESC" . substr($orderString, strpos($orderString, $getName . "=ASC") + strlen($getName . "=ASC"), strlen($orderString));
} else { } 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; $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); $video = Video::getVideo("", "viewableNotAd", false, false, true);
if (empty($video)) { if (empty($video)) {
$video = Video::getVideo("", "viewableNotAd"); $video = Video::getVideo("", "viewableNotAd");
} }
@ -71,29 +93,32 @@ if (empty($_GET['page'])) {
} else { } else {
$_GET['page'] = intval($_GET['page']); $_GET['page'] = intval($_GET['page']);
} }
$_POST['rowCount'] = 24; $_POST['rowCount'] = 24;
$_POST['current'] = $_GET['page']; $_POST['current'] = $_GET['page'];
$_POST['sort']['created'] = 'desc'; $_POST['sort']['created'] = 'desc';
$videos = Video::getAllVideos("viewableNotAd"); $videos = Video::getAllVideos("viewableNotAd");
unset($_POST['sort']);
foreach ($videos as $key => $value) { foreach ($videos as $key => $value) {
$name = empty($value['name']) ? $value['user'] : $value['name']; $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>'; $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"); $total = Video::getTotalVideos("viewableNotAd");
$totalPages = ceil($total / $_POST['rowCount']); $totalPages = ceil($total / $_POST['rowCount']);
?> ?>
<!DOCTYPE html> <!DOCTYPE html>
<html lang="<?php echo $_SESSION['language']; ?>"> <html lang="<?php echo $_SESSION['language']; ?>">
<head> <head>
<title><?php echo $config->getWebSiteTitle(); ?></title> <title><?php
<meta name="generator" content="YouPHPTube - A Free Youtube Clone Script" /> echo $config->getWebSiteTitle();
<?php ?></title>
include $global['systemRootPath'] . 'view/include/head.php'; <meta name="generator"
content="YouPHPTube - A Free Youtube Clone Script" />
<?php include $global['systemRootPath'] . 'view/include/head.php';
?> ?>
<script> <script>
$(document).ready(function () { $(document).ready(function () {
// Total Itens <?php echo $total; ?>
$('.pages').bootpag({ $('.pages').bootpag({
total: <?php echo $totalPages; ?>, total: <?php echo $totalPages; ?>,
page: <?php echo $_GET['page']; ?>, page: <?php echo $_GET['page']; ?>,
@ -102,10 +127,12 @@ $totalPages = ceil($total / $_POST['rowCount']);
<?php <?php
$url = ''; $url = '';
$args = ''; $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) { if (strpos($_SERVER['REQUEST_URI'], "/cat/") === false) {
$url = $global['webSiteRootURL'] . "page/"; $url = $global['webSiteRootURL'] . "page/";
} else { } else {
@ -116,48 +143,149 @@ $totalPages = ceil($total / $_POST['rowCount']);
}); });
}); });
</script> </script>
</head> </head>
<body> <body>
<?php <?php include 'include/navbar.php'; ?>
include 'include/navbar.php';
?>
<div class="container-fluid gallery" itemscope itemtype="http://schema.org/VideoObject"> <div class="container-fluid gallery" itemscope itemtype="http://schema.org/VideoObject">
<div class="row text-center" style="padding: 10px;"> <div class="row text-center" style="padding: 10px;">
<?php <?php echo $config->getAdsense(); ?>
echo $config->getAdsense();
?>
</div> </div>
<div class="col-sm-10 col-sm-offset-1 list-group-item"> <div class="col-sm-10 col-sm-offset-1 list-group-item">
<?php <?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)) { 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']); $name = User::getNameIdentificationById($video['users_id']);
$img_portrait = ($video['rotation'] === "90" || $video['rotation'] === "270") ? "img-portrait" : ""; $img_portrait = ($video['rotation'] === "90" || $video['rotation'] === "270") ? "img-portrait" : "";
?> ?>
<?php if (($obj->CategoryDescription)&&(!empty($_GET['catName']))) { ?> <?php if ($obj->SubCategorys == false) { ?>
<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 } ?>
<div class="row mainArea"> <div class="row mainArea">
<?php } if ($obj->BigVideo) { ?>
<?php if ($obj->BigVideo) { ?> <div class="clear clearfix">
<div class="clear clearfix firstRow">
<div class="row thumbsImage"> <div class="row thumbsImage">
<div class="col-sm-6"> <div class="col-sm-6">
<a href="<?php echo $global['webSiteRootURL']; ?>cat/<?php echo $video['clean_category']; ?>/video/<?php echo $video['clean_title']; ?>" <a href="<?php echo $global['webSiteRootURL']; ?>cat/<?php echo $video['clean_category']; ?>/video/<?php echo $video['clean_title']; ?>" title="<?php echo $video['title']; ?>" style="">
title="<?php echo $video['title']; ?>" style="" >
<?php <?php
$images = Video::getImageFromFilename($video['filename'], $video['type']); $images = Video::getImageFromFilename($video['filename'], $video['type']);
$imgGif = $images->thumbsGif; $imgGif = $images->thumbsGif;
$poster = $images->poster; $poster = $images->poster;
?> ?>
<div class="aspectRatio16_9"> <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']; ?>" /> <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)) { ?>
<?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" /> <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 } ?> <?php } ?>
</div> </div>
@ -181,55 +309,54 @@ $totalPages = ceil($total / $_POST['rowCount']);
<span class="label label-<?php echo $value2->type; ?>"><?php echo $value2->text; ?></span> <span class="label label-<?php echo $value2->type; ?>"><?php echo $value2->text; ?></span>
<?php <?php
} }
} } ?>
?>
</div> </div>
<div> <div>
<i class="fa fa-eye"></i> <i class="fa fa-eye"></i>
<span itemprop="interactionCount"> <span itemprop="interactionCount"><?php echo number_format($video['views_count'], 0); ?> <?php echo __("Views"); ?></span>
<?php echo number_format($video['views_count'], 0); ?> <?php echo __("Views"); ?>
</span>
</div> </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> <div>
<i class="fa fa-clock-o"></i> <i class="fa fa-clock-o"></i>
<?php <?php echo humanTiming(strtotime($video['videoCreation'])), " ", __('ago'); ?>
echo humanTiming(strtotime($video['videoCreation'])), " ", __('ago');
?>
</div> </div>
<div> <div>
<i class="fa fa-user"></i> <i class="fa fa-user"></i>
<a class="text-muted" href="<?php echo $global['webSiteRootURL']; ?>channel/<?php echo $video['users_id']; ?>/"> <a class="text-muted" href="<?php echo $global['webSiteRootURL']; ?>channel/<?php echo $video['users_id']; ?>/">
<?php <?php echo $name; ?>
echo $name;
?>
</a> </a>
</div> </div>
<?php <?php if (Video::canEdit($video['id'])) { ?>
if(Video::canEdit($video['id'])){
?>
<div> <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> <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> </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>
</div> </div>
</div> </div>
<?php } ?>
<?php }
?>
<!-- For Live Videos --> <!-- For Live Videos -->
<div id="liveVideos" class="clear clearfix" style="display: none;"> <div id="liveVideos" class="clear clearfix" style="display: none;">
<h3 class="galleryTitle text-danger"> <h3 class="galleryTitle text-danger"> <i class="fa fa-youtube-play"></i> <?php echo __("Live"); ?></h3>
<i class="fa fa-youtube-play"></i> <?php <div class="row extraVideos"></div>
echo __("Live");
?>
</h3>
<div class="row extraVideos">
</div>
</div> </div>
<script> <script>
function afterExtraVideos($liveLi){ function afterExtraVideos($liveLi){
@ -242,25 +369,23 @@ $totalPages = ceil($total / $_POST['rowCount']);
} }
</script> </script>
<!-- For Live Videos End --> <!-- For Live Videos End -->
<?php <?php if ($obj->SortByName) { ?>
if ($obj->SortByName) { ?>
<div class="clear clearfix"> <div class="clear clearfix">
<h3 class="galleryTitle"> <h3 class="galleryTitle">
<i class="glyphicon glyphicon-list-alt"></i> <?php <i class="glyphicon glyphicon-list-alt"></i>
if(empty($_GET["sortByNameOrder"])){ <?php if (empty($_GET["sortByNameOrder"])) {
$_GET["sortByNameOrder"]="ASC"; $_GET["sortByNameOrder"] = "ASC";
} }
if($obj->sortReverseable){
$info = createOrderInfo("sortByNameOrder","zyx","abc",$orderString); if ($obj->sortReverseable) {
echo __("Sort by name (".$info[2].")")." (Page " . $_GET['page'] . ") <a href='".$info[0]."' >".$info[1]."</a>"; $info = createOrderInfo("sortByNameOrder", "zyx", "abc", $orderString);
echo __("Sort by name (" . $info[2] . ")") . " (Page " . $_GET['page'] . ") <a href='" . $info[0] . "' >" . $info[1] . "</a>";
} else { } else {
echo __("Sort by name (abc)"); echo __("Sort by name (abc)");
} }
?> ?>
</h3> </h3>
<div class="row"> <div class="row"><?php
<?php
$countCols = 0; $countCols = 0;
unset($_POST['sort']); unset($_POST['sort']);
$_POST['sort']['title'] = $_GET['sortByNameOrder']; $_POST['sort']['title'] = $_GET['sortByNameOrder'];
@ -274,10 +399,11 @@ $totalPages = ceil($total / $_POST['rowCount']);
if ($countCols % 6 === 0) { if ($countCols % 6 === 0) {
echo '</div><div class="row aligned-row ">'; 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"> <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 <?php
$images = Video::getImageFromFilename($value['filename'], $value['type']); $images = Video::getImageFromFilename($value['filename'], $value['type']);
$imgGif = $images->thumbsGif; $imgGif = $images->thumbsGif;
@ -285,10 +411,7 @@ $totalPages = ceil($total / $_POST['rowCount']);
?> ?>
<div class="aspectRatio16_9"> <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']; ?>" /> <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" /> <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 } ?> <?php } ?>
</div> </div>
@ -308,8 +431,7 @@ $totalPages = ceil($total / $_POST['rowCount']);
<span class="label label-<?php echo $value2->type; ?>"><?php echo $value2->text; ?></span> <span class="label label-<?php echo $value2->type; ?>"><?php echo $value2->text; ?></span>
<?php <?php
} }
} } ?>
?>
</div> </div>
<div> <div>
<i class="fa fa-eye"></i> <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"); ?> <?php echo number_format($value['views_count'], 0); ?> <?php echo __("Views"); ?>
</span> </span>
</div> </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> <div>
<i class="fa fa-clock-o"></i> <i class="fa fa-clock-o"></i>
<?php <?php echo humanTiming(strtotime($value['videoCreation'])), " ", __('ago'); ?>
echo humanTiming(strtotime($value['videoCreation'])), " ", __('ago');
?>
</div> </div>
<div> <div>
<i class="fa fa-user"></i> <i class="fa fa-user"></i>
<a class="text-muted" href="<?php echo $global['webSiteRootURL']; ?>channel/<?php echo $value['users_id']; ?>/"> <a class="text-muted" href="<?php echo $global['webSiteRootURL']; ?>channel/<?php echo $value['users_id']; ?>/">
<?php <?php echo $name; ?>
echo $name;
?>
</a> </a>
<?php <?php if ((! empty($value['description'])) && ($obj->Description)) { ?>
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>
?>
<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 } ?> <?php } ?>
</div> </div>
<?php <?php if (Video::canEdit($value['id'])) { ?>
if(Video::canEdit($value['id'])){
?>
<div> <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> </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
}
?>
</div> </div>
<div class="row"> <div class="row">
<ul class="pages"> <ul class="pages">
</ul> </ul>
</div> </div>
</div> </div>
<?php } if ($obj->DateAdded) { ?> <?php } if ($obj->DateAdded) { ?>
<div class="clear clearfix"> <div class="clear clearfix">
<h3 class="galleryTitle"> <h3 class="galleryTitle">
<i class="glyphicon glyphicon-sort-by-attributes"></i> <?php <i class="glyphicon glyphicon-sort-by-attributes"></i>
if(empty($_GET["dateAddedOrder"])){ <?php
$_GET["dateAddedOrder"]="DESC"; if (empty($_GET["dateAddedOrder"])) {
$_GET["dateAddedOrder"] = "DESC";
} }
if($obj->sortReverseable){
$info = createOrderInfo("dateAddedOrder","newest","oldest",$orderString); if ($obj->sortReverseable) {
echo __("Date added (".$info[2].")")." (Page " . $_GET['page'] . ") <a href='".$info[0]."' >".$info[1]."</a>"; $info = createOrderInfo("dateAddedOrder", "newest", "oldest", $orderString);
echo __("Date added (" . $info[2] . ")") . " (Page " . $_GET['page'] . ") <a href='" . $info[0] . "' >" . $info[1] . "</a>";
} else { } else {
echo __("Date added (newest)"); echo __("Date added (newest)");
} }
?> ?>
</h3> </h3>
<div class="row"> <div class="row"><?php
<?php
$countCols = 0; $countCols = 0;
unset($_POST['sort']); unset($_POST['sort']);
$_POST['sort']['created'] = $_GET['dateAddedOrder']; $_POST['sort']['created'] = $_GET['dateAddedOrder'];
@ -392,21 +519,19 @@ $totalPages = ceil($total / $_POST['rowCount']);
if ($countCols % 6 === 0) { if ($countCols % 6 === 0) {
echo '</div><div class="row aligned-row ">'; echo '</div><div class="row aligned-row ">';
} }
$countCols++; $countCols ++;
?> ?>
<div class="col-lg-2 col-sm-4 col-xs-6 galleryVideo thumbsImage fixPadding"> <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 <?php
$images = Video::getImageFromFilename($value['filename'], $value['type']); $images = Video::getImageFromFilename($value['filename'], $value['type']);
$imgGif = $images->thumbsGif; $imgGif = $images->thumbsGif;
$poster = $images->thumbsJpg; $poster = $images->thumbsJpg;
?> ?>
<div class="aspectRatio16_9"> <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']; ?>"/> <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 <?php if (! empty($imgGif)) { ?>
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 $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 } ?> <?php } ?>
</div> </div>
<span class="duration"><?php echo Video::getCleanDuration($value['duration']); ?></span> <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> <span class="label label-<?php echo $value2->type; ?>"><?php echo $value2->text; ?></span>
<?php <?php
} }
} } ?>
?>
</div> </div>
<div> <div>
<i class="fa fa-eye"></i> <i class="fa fa-eye"></i>
<span itemprop="interactionCount"> <span itemprop="interactionCount"><?php echo number_format($value['views_count'], 0); ?> <?php echo __("Views"); ?></span>
<?php echo number_format($value['views_count'], 0); ?> <?php echo __("Views"); ?>
</span>
</div> </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> <div>
<i class="fa fa-clock-o"></i> <i class="fa fa-clock-o"></i>
<?php <?php echo humanTiming(strtotime($value['videoCreation'])), " ", __('ago'); ?>
echo humanTiming(strtotime($value['videoCreation'])), " ", __('ago');
?>
</div> </div>
<div> <div>
<i class="fa fa-user"></i> <i class="fa fa-user"></i>
<a class="text-muted" href="<?php echo $global['webSiteRootURL']; ?>channel/<?php echo $value['users_id']; ?>/"> <a class="text-muted" href="<?php echo $global['webSiteRootURL']; ?>channel/<?php echo $value['users_id']; ?>/">
<?php <?php echo $name; ?>
echo $name;
?>
</a> </a>
<?php <?php if ((!empty($value['description'])) && ($obj->Description)) { ?>
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>
?>
<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 } ?> <?php } ?>
</div> </div>
<?php <?php if (Video::canEdit($value['id'])) { ?>
if(Video::canEdit($value['id'])){
?>
<div> <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> </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 } ?>
}
?>
</div> </div>
<div class="row"> <div class="row">
<ul class="pages"> <ul class="pages">
</ul> </ul>
</div> </div>
</div> </div>
<?php } if ($obj->MostWatched) { ?> <?php } if ($obj->MostWatched) { ?>
<div class="clear clearfix"> <div class="clear clearfix">
<h3 class="galleryTitle"> <h3 class="galleryTitle">
<i class="glyphicon glyphicon-eye-open"></i> <?php <i class="glyphicon glyphicon-eye-open"></i>
<?php
if(empty($_GET['mostWatchedOrder'])){ if (empty($_GET['mostWatchedOrder'])) {
$_GET['mostWatchedOrder']="DESC"; $_GET['mostWatchedOrder'] = "DESC";
} }
if($obj->sortReverseable){ if ($obj->sortReverseable) {
$info = createOrderInfo("mostWatchedOrder","Most","Lessest",$orderString); $info = createOrderInfo("mostWatchedOrder", "Most", "Lessest", $orderString);
echo __($info[2]." watched")." (Page " . $_GET['page'] . ") <a href='".$info[0]."' >".$info[1]."</a>"; echo __($info[2] . " watched") . " (Page " . $_GET['page'] . ") <a href='" . $info[0] . "' >" . $info[1] . "</a>";
} else { } else {
echo __("Most watched"); echo __("Most watched");
} } ?>
?>
</h3> </h3>
<div class="row"> <div class="row">
<?php <?php
@ -503,14 +627,17 @@ $totalPages = ceil($total / $_POST['rowCount']);
$videos = Video::getAllVideos(); $videos = Video::getAllVideos();
foreach ($videos as $value) { foreach ($videos as $value) {
$name = User::getNameIdentificationById($value['users_id']); $name = User::getNameIdentificationById($value['users_id']);
// make a row each 6 cols // make a row each 6 cols
if ($countCols % 6 === 0) { if ($countCols % 6 === 0) {
echo '</div><div class="row aligned-row ">'; echo '</div><div class="row aligned-row ">';
} }
$countCols++;
$countCols ++;
?> ?>
<div class="col-lg-2 col-sm-4 col-xs-6 galleryVideo thumbsImage fixPadding"> <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 <?php
$images = Video::getImageFromFilename($value['filename'], $value['type']); $images = Video::getImageFromFilename($value['filename'], $value['type']);
$imgGif = $images->thumbsGif; $imgGif = $images->thumbsGif;
@ -519,9 +646,7 @@ $totalPages = ceil($total / $_POST['rowCount']);
<div class="aspectRatio16_9"> <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']; ?>" /> <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 <?php if (! empty($imgGif)) { ?>
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 $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 } ?> <?php } ?>
</div> </div>
@ -550,41 +675,47 @@ $totalPages = ceil($total / $_POST['rowCount']);
<?php echo number_format($value['views_count'], 0); ?> <?php echo __("Views"); ?> <?php echo number_format($value['views_count'], 0); ?> <?php echo __("Views"); ?>
</span> </span>
</div> </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> <div>
<i class="fa fa-clock-o"></i> <i class="fa fa-clock-o"></i>
<?php <?php echo humanTiming(strtotime($value['videoCreation'])), " ", __('ago'); ?>
echo humanTiming(strtotime($value['videoCreation'])), " ", __('ago');
?>
</div> </div>
<div> <div>
<i class="fa fa-user"></i> <i class="fa fa-user"></i>
<a class="text-muted" href="<?php echo $global['webSiteRootURL']; ?>channel/<?php echo $value['users_id']; ?>/"> <a class="text-muted" href="<?php echo $global['webSiteRootURL']; ?>channel/<?php echo $value['users_id']; ?>/">
<?php <?php echo $name; ?>
echo $name;
?>
</a> </a>
<?php <?php if ((! empty($value['description'])) && ($obj->Description)) { ?>
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>
?>
<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 } ?> <?php } ?>
</div> </div>
<?php <?php if (Video::canEdit($value['id'])) { ?>
if(Video::canEdit($value['id'])){
?>
<div> <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> </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
}
?>
</div> </div>
<div class="row"> <div class="row">
<ul class="pages"> <ul class="pages">
@ -594,13 +725,14 @@ $totalPages = ceil($total / $_POST['rowCount']);
<?php } if ($obj->MostPopular) { ?> <?php } if ($obj->MostPopular) { ?>
<div class="clear clearfix"> <div class="clear clearfix">
<h3 class="galleryTitle"> <h3 class="galleryTitle">
<i class="glyphicon glyphicon-thumbs-up"></i> <?php <i class="glyphicon glyphicon-thumbs-up"></i>
if(empty($_GET['mostPopularOrder'])){ <?php
$_GET['mostPopularOrder']="DESC"; if (empty($_GET['mostPopularOrder'])) {
$_GET['mostPopularOrder'] = "DESC";
} }
if($obj->sortReverseable){ if ($obj->sortReverseable) {
$info = createOrderInfo("mostPopularOrder","Most","Lessest",$orderString); $info = createOrderInfo("mostPopularOrder", "Most", "Lessest", $orderString);
echo __($info[2]." popular")." (Page " . $_GET['page'] . ") <a href='".$info[0]."' >".$info[1]."</a>"; echo __($info[2] . " popular") . " (Page " . $_GET['page'] . ") <a href='" . $info[0] . "' >" . $info[1] . "</a>";
} else { } else {
echo __("Most popular"); echo __("Most popular");
} }
@ -620,10 +752,10 @@ $totalPages = ceil($total / $_POST['rowCount']);
if ($countCols % 6 === 0) { if ($countCols % 6 === 0) {
echo '</div><div class="row aligned-row ">'; echo '</div><div class="row aligned-row ">';
} }
$countCols++; $countCols ++;
?> ?>
<div class="col-lg-2 col-sm-4 col-xs-6 galleryVideo thumbsImage fixPadding"> <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 <?php
$images = Video::getImageFromFilename($value['filename'], $value['type']); $images = Video::getImageFromFilename($value['filename'], $value['type']);
$imgGif = $images->thumbsGif; $imgGif = $images->thumbsGif;
@ -631,10 +763,7 @@ $totalPages = ceil($total / $_POST['rowCount']);
?> ?>
<div class="aspectRatio16_9"> <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']; ?>" /> <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" /> <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 } ?> <?php } ?>
</div> </div>
@ -649,13 +778,10 @@ $totalPages = ceil($total / $_POST['rowCount']);
<?php <?php
$value['tags'] = Video::getTags($value['id']); $value['tags'] = Video::getTags($value['id']);
foreach ($value['tags'] as $value2) { 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> <span class="label label-<?php echo $value2->type; ?>"><?php echo $value2->text; ?></span>
<?php <?php }
} } ?>
}
?>
</div> </div>
<div> <div>
<i class="fa fa-eye"></i> <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"); ?> <?php echo number_format($value['views_count'], 0); ?> <?php echo __("Views"); ?>
</span> </span>
</div> </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> <div>
<i class="fa fa-clock-o"></i> <i class="fa fa-clock-o"></i>
<?php <?php echo humanTiming(strtotime($value['videoCreation'])), " ", __('ago'); ?>
echo humanTiming(strtotime($value['videoCreation'])), " ", __('ago');
?>
</div> </div>
<div> <div>
<i class="fa fa-user"></i> <i class="fa fa-user"></i>
<a class="text-muted" href="<?php echo $global['webSiteRootURL']; ?>channel/<?php echo $value['users_id']; ?>/"> <a class="text-muted" href="<?php echo $global['webSiteRootURL']; ?>channel/<?php echo $value['users_id']; ?>/">
<?php <?php echo $name; ?>
echo $name;
?>
</a> </a>
<?php <?php if ((! empty($value['description'])) && ($obj->Description)) { ?>
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>
?>
<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 } ?> <?php } ?>
</div> </div>
<?php <?php if (Video::canEdit($value['id'])) { ?>
if(Video::canEdit($value['id'])){
?>
<div> <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> </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>
</div> </div>
<?php } ?>
<?php
}
?>
</div> </div>
<div class="row"> <div class="row">
<ul class="pages"> <ul class="pages">
@ -705,26 +836,18 @@ $totalPages = ceil($total / $_POST['rowCount']);
</div> </div>
</div> </div>
<?php } ?> <?php } ?>
</div> </div>
<?php <?php } else { ?>
} else {
?>
<div class="alert alert-warning"> <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> </div>
<?php } ?> <?php } ?>
</div>
</div>
</div> </div>
<?php include 'include/footer.php'; ?>
</div>
<?php
include 'include/footer.php';
?>
</body> </body>
</html> </html>
<?php <?php include $global['systemRootPath'] . 'objects/include_end.php'; ?>
include $global['systemRootPath'] . 'objects/include_end.php';
?>

View file

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

View file

@ -20,7 +20,11 @@ class NextButton extends PluginAbstract {
public function getFooterCode() { public function getFooterCode() {
global $global, $autoPlayVideo; global $global, $autoPlayVideo;
if (!empty($autoPlayVideo['url'])) { 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>'; $js .= '<script src="' . $global['webSiteRootURL'] . 'plugin/NextButton/script.js" type="text/javascript"></script>';
return $js; return $js;

View file

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

View file

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

View file

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

View file

@ -1,7 +1,7 @@
$(document).ready(function () { $(document).ready(function () {
// Extend default // Extend default
if (typeof player == 'undefined') { if (typeof player == 'undefined') {
player = videojs('mainVideo'); player = videojs(videoJsId);
} }
// Extend default // Extend default
var Button = videojs.getComponent('Button'); 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->DateAdded = true;
$obj->LiteDesignGenericNrOfRows = 10; $obj->LiteDesignGenericNrOfRows = 10;
$obj->SortByName = false; $obj->SortByName = false;
$obj->separateAudio = false;
$obj->SubCategorys = false;
return $obj; 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(){ public function getFirstPage(){
global $global; global $global;
$url = $_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']; $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'; return $global['systemRootPath'].'plugin/YouPHPFlix/view/firstPage.php';
} }
else { else {

View file

@ -14,7 +14,6 @@ ADD `description` TEXT NULL AFTER `clean_name`;
ALTER TABLE `categories` ALTER TABLE `categories`
ADD `nextVideoOrder` INT(2) NOT NULL DEFAULT '0' AFTER `description`; ADD `nextVideoOrder` INT(2) NOT NULL DEFAULT '0' AFTER `description`;
SET SQL_MODE=@OLD_SQL_MODE; SET SQL_MODE=@OLD_SQL_MODE;
SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS; SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS;
SET UNIQUE_CHECKS=@OLD_UNIQUE_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="row main-video" style="padding: 10px;" id="mvideo">
<div class="col-xs-12 col-sm-12 col-lg-2"></div> <div class="col-xs-12 col-sm-12 col-lg-2 firstC"></div>
<div class="col-xs-12 col-sm-12 col-lg-8 "> <div class="col-xs-12 col-sm-12 col-lg-8 secC">
<audio controls class="center-block video-js vjs-default-skin " id="mainAudio" autoplay data-setup='{}' <?php
poster="<?php echo $global['webSiteRootURL']; ?>img/recorder.gif"> $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" /> <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" /> <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> <a href="<?php echo $global['webSiteRootURL']; ?>videos/<?php echo $video['filename']; ?>.mp3">horse</a>
<?php
$ext = ".mp3";
} ?>
</audio> </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> </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 class="col-xs-12 col-sm-12 col-lg-2"></div>
</div><!--/row--> </div><!--/row-->

View file

@ -36,6 +36,13 @@
} }
</script> </script>
<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 () { $(function () {
<?php <?php
if (!empty($_GET['error'])) { 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.min.js";
$jsFiles[] = "{$global['webSiteRootURL']}js/jquery.lazy/jquery.lazy.plugins.min.js"; $jsFiles[] = "{$global['webSiteRootURL']}js/jquery.lazy/jquery.lazy.plugins.min.js";
$jsURL = combineFiles($jsFiles, "js"); $jsURL = combineFiles($jsFiles, "js");
?> ?>
<script src="<?php echo $jsURL; ?>" type="text/javascript"></script> <script src="<?php echo $jsURL; ?>" type="text/javascript"></script>
<?php <?php

View file

@ -1,6 +1,7 @@
<?php <?php
require_once $global['systemRootPath'] . 'objects/user.php'; require_once $global['systemRootPath'] . 'objects/user.php';
require_once $global['systemRootPath'] . 'objects/category.php'; require_once $global['systemRootPath'] . 'objects/category.php';
$_GET['parentsOnly']="1";
$categories = Category::getAllCategories(); $categories = Category::getAllCategories();
if (empty($_SESSION['language'])) { if (empty($_SESSION['language'])) {
$lang = 'us'; $lang = 'us';
@ -54,7 +55,7 @@ $updateFiles = getUpdatesFilesArray();
<form class="navbar-form navbar-left" id="searchForm" action="<?php echo $global['webSiteRootURL']; ?>" > <form class="navbar-form navbar-left" id="searchForm" action="<?php echo $global['webSiteRootURL']; ?>" >
<div class="input-group" > <div class="input-group" >
<div class="form-inline"> <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> <button class="input-group-addon form-control hidden-xs" style="width: 50px;" type="submit"><span class="glyphicon glyphicon-search"></span></button>
</div> </div>
</div> </div>
@ -104,7 +105,7 @@ $updateFiles = getUpdatesFilesArray();
?> ?>
<li> <li>
<a href="<?php echo $global['webSiteRootURL']; ?>upload" > <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> </a>
</li> </li>
<?php <?php
@ -383,10 +384,31 @@ $updateFiles = getUpdatesFilesArray();
<h3 class="text-danger"><?php echo __("Categories"); ?></h3> <h3 class="text-danger"><?php echo __("Categories"); ?></h3>
</li> </li>
<?php <?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) { foreach ($categories as $value) {
echo '<li class="' . ($value['clean_name'] == @$_GET['catName'] ? "active" : "") . '">' echo '<li class="' . ($value['clean_name'] == @$_GET['catName'] ? "active" : "") . '">'
. '<a href="' . $global['webSiteRootURL'] . 'cat/' . $value['clean_name'] . '" >' . '<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 <?php
$playNowVideo = $video; $playNowVideo = $video;
$transformation = "{rotate:" . $video['rotation'] . ", zoom: " . $video['zoom'] . "}"; $transformation = "{rotate:" . $video['rotation'] . ", zoom: " . $video['zoom'] . "}";
if ($video['rotation'] === "90" || $video['rotation'] === "270") { if ($video['rotation'] === "90" || $video['rotation'] === "270") {
$aspectRatio = "9:16"; $aspectRatio = "9:16";
$vjsClass = "vjs-9-16"; $vjsClass = "vjs-9-16";
$embedResponsiveClass = "embed-responsive-9by16"; $embedResponsiveClass = "embed-responsive-9by16";
} else { } else {
$aspectRatio = "16:9"; $aspectRatio = "16:9";
$vjsClass = "vjs-16-9"; $vjsClass = "vjs-16-9";
$embedResponsiveClass = "embed-responsive-16by9"; $embedResponsiveClass = "embed-responsive-16by9";
} }
if (!empty($ad)) { if (!empty($ad)) {
$playNowVideo = $ad; $playNowVideo = $ad;
$logId = Video_ad::log($ad['id']); $logId = Video_ad::log($ad['id']);
} }
?> ?>
<div class="row main-video" id="mvideo"> <div class="row main-video" id="mvideo">
<div class="col-sm-2 col-md-2 firstC"></div> <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"> <p class="btn btn-outline btn-xs move">
<i class="fa fa-arrows"></i> <i class="fa fa-arrows"></i>
</p> </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> <i class="fa fa-close"></i>
</button> </button>
</div> </div>
<div id="main-video" class="embed-responsive <?php <div id="main-video" class="embed-responsive <?php echo $embedResponsiveClass; if (!empty($logId)) { echo " ad"; } ?>">
echo $embedResponsiveClass; <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; ?>" }'>
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 $playNowVideo['title'], " ", $playNowVideo['filename']; ?> -->
<?php <?php echo getSources($playNowVideo['filename']); ?>
echo getSources($playNowVideo['filename']);
?>
<p><?php echo __("If you can't view this video, your browser does not support HTML5 videos"); ?></p> <p><?php echo __("If you can't view this video, your browser does not support HTML5 videos"); ?></p>
<p class="vjs-no-js"> <p class="vjs-no-js"><?php echo __("To view this video please enable JavaScript, and consider upgrading to a web browser that"); ?>
<?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> <a href="http://videojs.com/html5-video-support/" target="_blank">supports HTML5 video</a>
</p> </p>
</video> </video>
<?php require_once $global['systemRootPath'] . 'plugin/YouPHPTubePlugin.php';
<?php
require_once $global['systemRootPath'] . 'plugin/YouPHPTubePlugin.php';
// the live users plugin // 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'; require_once $global['systemRootPath'] . 'plugin/VideoLogoOverlay/VideoLogoOverlay.php';
$style = VideoLogoOverlay::getStyle(); $style = VideoLogoOverlay::getStyle();
$url = VideoLogoOverlay::getLink(); $url = VideoLogoOverlay::getLink(); ?>
?>
<div style="<?php echo $style; ?>"> <div style="<?php echo $style; ?>">
<a href="<?php echo $url; ?>"> <a href="<?php echo $url; ?>"> <img src="<?php echo $global['webSiteRootURL']; ?>videos/logoOverlay.png"></a>
<img src="<?php echo $global['webSiteRootURL']; ?>videos/logoOverlay.png"> </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> </a>
</div> </div>
<?php <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 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>
<?php } ?> <?php } ?>
</div> </div>
</div> </div>
<?php if ($config->getAllow_download()) { ?> <?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"; ?>" > <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> </a>
<?php } ?> <?php } ?>
</div> </div>
<div class="col-sm-2 col-md-2"></div> <div class="col-sm-2 col-md-2"></div>
</div> </div>
<!--/row--> <!--/row-->
@ -96,37 +73,27 @@ if (!empty($ad)) {
var player; var player;
$(document).ready(function () { $(document).ready(function () {
<?php if (!$config->getAllow_download()) { ?> <?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 () { $('#mainVideo').bind('contextmenu', function () {
return false; return false;
}); });
<?php } /* else { ?> <?php } ?>
$('#mainVideo').bind('contextmenu', function (event) {
event.preventDefault();
return '<a href="blubb">Hallo Welt!</a>';
});
<?php } */ ?>
fullDuration = strToSeconds('<?php echo @$ad['duration']; ?>'); fullDuration = strToSeconds('<?php echo @$ad['duration']; ?>');
player = videojs('mainVideo'); player = videojs('mainVideo');
player.zoomrotate(<?php echo $transformation; ?>); player.zoomrotate(<?php echo $transformation; ?>);
player.on('play', function () { player.on('play', function () {
addView(<?php echo $playNowVideo['id']; ?>); addView(<?php echo $playNowVideo['id']; ?>);
}); });
player.ready(function () { player.ready(function () {
<?php <?php if ($config->getAutoplay()) {
if ($config->getAutoplay()) {
echo "setTimeout(function () { if(typeof player === 'undefined'){ player = videojs('mainVideo');}player.play();}, 150);"; echo "setTimeout(function () { if(typeof player === 'undefined'){ player = videojs('mainVideo');}player.play();}, 150);";
} else { } else { ?>
?>
if (Cookies.get('autoplay') && Cookies.get('autoplay') !== 'false') { if (Cookies.get('autoplay') && Cookies.get('autoplay') !== 'false') {
setTimeout(function () { if(typeof player === 'undefined'){ player = videojs('mainVideo');} player.play();}, 150); setTimeout(function () { if(typeof player === 'undefined'){ player = videojs('mainVideo');} player.play();}, 150);
} }
<?php } <?php }
?> if (!empty($logId))
<?php if (!empty($logId)) { ?> { ?>
isPlayingAd = true; isPlayingAd = true;
this.on('ended', function () { this.on('ended', function () {
console.log("Finish Video"); console.log("Finish Video");
@ -136,53 +103,42 @@ if ($config->getAutoplay()) {
} }
<?php <?php
// if autoplay play next video // if autoplay play next video
if (!empty($autoPlayVideo)) { if (!empty($autoPlayVideo)) { ?>
?>
else if (Cookies.get('autoplay') && Cookies.get('autoplay') !== 'false') { else if (Cookies.get('autoplay') && Cookies.get('autoplay') !== 'false') {
document.location = '<?php echo $autoPlayVideo['url']; ?>'; document.location = '<?php echo $autoPlayVideo['url']; ?>';
} }
<?php <?php } ?>
}
?>
}); });
this.on('timeupdate', function () { this.on('timeupdate', function () {
var durationLeft = fullDuration - this.currentTime(); var durationLeft = fullDuration - this.currentTime();
$("#adUrl .time").text(secondsToStr(durationLeft + 1, 2)); $("#adUrl .time").text(secondsToStr(durationLeft + 1, 2));
<?php if (!empty($ad['skip_after_seconds'])) { <?php if (!empty($ad['skip_after_seconds'])) { ?>
?> if (isPlayingAd && this.currentTime() ><?php
if (isPlayingAd && this.currentTime() ><?php echo intval($ad['skip_after_seconds']); ?>) { echo intval($ad['skip_after_seconds']); ?>) {
$('#adButton').fadeIn(); $('#adButton').fadeIn();
} }
<?php } <?php } ?>
?>
}); });
<?php } else { <?php } else { ?>
?>
this.on('ended', function () { this.on('ended', function () {
console.log("Finish Video"); console.log("Finish Video");
<?php <?php // if autoplay play next video
// if autoplay play next video if (!empty($autoPlayVideo)) { ?>
if (!empty($autoPlayVideo)) {
?>
if (Cookies.get('autoplay') && Cookies.get('autoplay') !== 'false') { 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({ player.persistvolume({
namespace: "YouPHPTube" namespace: "YouPHPTube"
}); });
<?php <?php
if (!empty($logId)) { if (!empty($logId)){
$sources = getSources($video['filename'], true); $sources = getSources($video['filename'], true); ?>
?>
$('#adButton').click(function () { $('#adButton').click(function () {
isPlayingAd = false; isPlayingAd = false;
console.log("Change Video"); console.log("Change Video");

View file

@ -5,29 +5,21 @@ if (!User::isAdmin()) {
header("Location: {$global['webSiteRootURL']}?error=" . __("You can not manage categories")); header("Location: {$global['webSiteRootURL']}?error=" . __("You can not manage categories"));
exit; exit;
} }
require_once $global['systemRootPath'] . 'objects/category.php'; require_once $global['systemRootPath'] . 'objects/category.php'; ?>
?>
<!DOCTYPE html> <!DOCTYPE html>
<html lang="<?php echo $_SESSION['language']; ?>"> <html lang="<?php echo $_SESSION['language']; ?>">
<head> <head>
<title><?php echo $config->getWebSiteTitle(); ?> :: <?php echo __("Category"); ?></title> <title><?php echo $config->getWebSiteTitle(); ?> :: <?php echo __("Category"); ?></title>
<?php <?php include $global['systemRootPath'] . 'view/include/head.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> <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"/> <link href="<?php echo $global['webSiteRootURL']; ?>css/fontawesome-iconpicker/dist/css/fontawesome-iconpicker.min.css" rel="stylesheet" type="text/css"/>
</head> </head>
<body> <body>
<?php <?php include 'include/navbar.php'; ?>
include 'include/navbar.php';
?>
<div class="container"> <div class="container">
<?php <?php include 'include/updateCheck.php'; ?>
include 'include/updateCheck.php';
?>
<button type="button" class="btn btn-default" id="addCategoryBtn"> <button type="button" class="btn btn-default" id="addCategoryBtn">
<span class="glyphicon glyphicon-plus" aria-hidden="true"></span> <?php echo __("New Category"); ?> <span class="glyphicon glyphicon-plus" aria-hidden="true"></span> <?php echo __("New Category"); ?>
</button> </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="clean_name"><?php echo __("Clean Name"); ?></th>
<th data-column-id="description"><?php echo __("Description"); ?></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="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> <th data-column-id="commands" data-formatter="commands" data-sortable="false"></th>
</tr> </tr>
</thead> </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> <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> <label class="sr-only" for="inputDescription"><?php echo __("Description"); ?></label>
<textarea class="form-control" rows="5" id="inputDescription" placeholder="<?php echo __("Description"); ?>"></textarea> <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"> <select class="form-control" id="inputNextVideoOrder">
<option value="0"><?php echo __("Random"); ?></option> <option value="0"><?php echo __("Random"); ?></option>
<option value="1"><?php echo __("By name"); ?></option> <option value="1"><?php echo __("By name"); ?></option>
</select> </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"> <div class="btn-group">
<button data-selected="graduation-cap" type="button" class="icp iconCat btn btn-default dropdown-toggle iconpicker-component" data-toggle="dropdown"> <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> <?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-dialog -->
</div><!-- /.modal --> </div><!-- /.modal -->
</div><!--/.container--> </div><!--/.container-->
<?php <?php include 'include/footer.php'; ?>
include 'include/footer.php';
?>
<script> <script>
var fullCatList;
$(document).ready(function () { $(document).ready(function () {
$('.iconCat').iconpicker({ $('.iconCat').iconpicker({
//searchInFooter: true, // If true, the search will be added to the footer instead of the title //searchInFooter: true, // If true, the search will be added to the footer instead of the title
//inputSearch:true, //inputSearch:true,
//showFooter: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({ var grid = $("#grid").bootgrid({
ajax: true, ajax: true,
@ -113,6 +130,42 @@ require_once $global['systemRootPath'] . 'objects/category.php';
return "<?php echo __("By name"); ?>"; 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) "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>' 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 () { }).on("loaded.rs.jquery.bootgrid", function () {
/* Executes after data is loaded and rendered */
grid.find(".command-edit").on("click", function (e) { grid.find(".command-edit").on("click", function (e) {
var row_index = $(this).closest('tr').index(); var row_index = $(this).closest('tr').index();
var row = $("#grid").bootgrid("getCurrentRows")[row_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); $('#inputCategoryId').val(row.id);
$('#inputName').val(row.name); $('#inputName').val(row.name);
$('#inputCleanName').val(row.clean_name); $('#inputCleanName').val(row.clean_name);
$('#inputDescription').val(row.description); $('#inputDescription').val(row.description);
$('#inputNextVideoOrder').val(row.nextVideoOrder); $('#inputNextVideoOrder').val(row.nextVideoOrder);
$('#inputParentId').val(row.parentId);
$('#inputType').val(row.type);
$(".iconCat i").attr("class", row.iconClass); $(".iconCat i").attr("class", row.iconClass);
$('#categoryFormModal').modal(); $('#categoryFormModal').modal();
@ -184,7 +238,8 @@ require_once $global['systemRootPath'] . 'objects/category.php';
$('#inputName').val(''); $('#inputName').val('');
$('#inputCleanName').val(''); $('#inputCleanName').val('');
$('#inputDescription').val(''); $('#inputDescription').val('');
$('#inputParentId').val('0');
$('#inputType').val('3');
$('#categoryFormModal').modal(); $('#categoryFormModal').modal();
}); });
@ -197,7 +252,7 @@ require_once $global['systemRootPath'] . 'objects/category.php';
modal.showPleaseWait(); modal.showPleaseWait();
$.ajax({ $.ajax({
url: 'addNewCategory', 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', type: 'post',
success: function (response) { success: function (response) {
if (response.status === "1") { 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/category.php';
require_once $global['systemRootPath'] . 'objects/video.php'; require_once $global['systemRootPath'] . 'objects/video.php';
$categories = Category::getAllCategories();
require_once $global['systemRootPath'] . 'objects/userGroups.php'; require_once $global['systemRootPath'] . 'objects/userGroups.php';
$userGroups = UserGroups::getAllUsersGroups(); $userGroups = UserGroups::getAllUsersGroups();
unset($_SESSION['type']);
if (!empty($_GET['video_id'])) { if (!empty($_GET['video_id'])) {
if (Video::canEdit($_GET['video_id'])) { if (Video::canEdit($_GET['video_id'])) {
$row = Video::getVideo($_GET['video_id']); $row = Video::getVideo($_GET['video_id']);
} }
} }
?> ?>
<!DOCTYPE html> <!DOCTYPE html>
<html lang="<?php echo $_SESSION['language']; ?>"> <html lang="<?php echo $_SESSION['language']; ?>">
@ -53,14 +52,9 @@ if (!empty($_GET['video_id'])) {
</head> </head>
<body> <body>
<?php <?php include 'include/navbar.php'; ?>
include 'include/navbar.php';
?>
<div class="container"> <div class="container">
<?php <?php include 'include/updateCheck.php'; ?>
include 'include/updateCheck.php';
?>
<div class="btn-group" > <div class="btn-group" >
<a href="<?php echo $global['webSiteRootURL']; ?>usersGroups" class="btn btn-warning"> <a href="<?php echo $global['webSiteRootURL']; ?>usersGroups" class="btn btn-warning">
<span class="fa fa-users"></span> <?php echo __("User Groups"); ?> <span class="fa fa-users"></span> <?php echo __("User Groups"); ?>
@ -73,6 +67,7 @@ if (!empty($_GET['video_id'])) {
<?php echo __("Video Chart"); ?> <?php echo __("Video Chart"); ?>
</a> </a>
<?php <?php
$categories = Category::getAllCategories();
if (empty($advancedCustom->doNotShowEncoderButton)) { if (empty($advancedCustom->doNotShowEncoderButton)) {
if (!empty($config->getEncoderURL())) { 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'>" + 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; return tags;
}, },
"checkbox": function (column, row) { "checkbox": function (column, row) {
@ -862,7 +858,7 @@ if (!empty($row)) {
var type, img, is_portrait; var type, img, is_portrait;
if (row.type === "audio") { if (row.type === "audio") {
type = "<span class='fa fa-headphones' style='font-size:14px;'></span> "; 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 { } else {
type = "<span class='fa fa-film' style='font-size:14px;'></span> "; type = "<span class='fa fa-film' style='font-size:14px;'></span> ";
is_portrait = (row.rotation === "90" || row.rotation === "270") ? "img-portrait" : ""; is_portrait = (row.rotation === "90" || row.rotation === "270") ? "img-portrait" : "";

View file

@ -60,7 +60,7 @@ if (!User::canUpload()) {
<div class="alert alert-warning"> <div class="alert alert-warning">
<h1> <h1>
<span class="glyphicon glyphicon-warning-sign" style="font-size:1em;"></span> <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> </h1>
</div> </div>
<?php <?php

View file

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

View file

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