1
0
Fork 0
mirror of https://github.com/DanielnetoDotCom/YouPHPTube synced 2025-10-06 03:50:04 +02:00

Options to enable and disable functions

thumbs for ads manager
temporary thumbs when it is not done
session time out
encode mpeg and webm option
encode mp3 and spectrum option
This commit is contained in:
daniel 2017-06-01 15:37:22 -03:00
parent e4bafe4dab
commit b45fb760de
76 changed files with 1139 additions and 148 deletions

View file

@ -97,4 +97,10 @@
RewriteRule ^charts$ view/charts.php [NC,L]
# if image do not exists
RewriteCond %{REQUEST_URI} \.(jpg|jpeg|gif|png|ico)$ [NC]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule .*$ img/static.gif [L]
</IfModule>

View file

@ -1,6 +1,6 @@
<?php
$installationVersion = "2.7";
$installationVersion = "2.8";
header('Content-Type: application/json');
@ -128,10 +128,7 @@ $content = "<?php
/**
* Do NOT change from here
*/
session_start();
\$global['mysqli'] = new mysqli(\$mysqlHost, \$mysqlUser,\$mysqlPass,\$mysqlDatabase);
require_once \$global['systemRootPath'].'locale/function.php';
require_once \$global['systemRootPath'].'objects/include_config.php';
";

View file

@ -4,6 +4,7 @@ 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';
-- -----------------------------------------------------
-- Table `users`
-- -----------------------------------------------------
@ -131,6 +132,7 @@ CREATE TABLE IF NOT EXISTS `configurations` (
`ffmpegWebm` VARCHAR(400) NULL,
`ffmpegWebmPortrait` VARCHAR(400) NULL,
`ffmpegMp3` VARCHAR(400) NULL,
`ffmpegSpectrum` VARCHAR(400) NULL,
`ffmpegOgg` VARCHAR(400) NULL,
`youtubeDl` VARCHAR(400) NULL,
`ffmpegPath` VARCHAR(255) NULL,
@ -142,6 +144,12 @@ CREATE TABLE IF NOT EXISTS `configurations` (
`logo_small` VARCHAR(255) NULL,
`adsense` TEXT NULL,
`mode` ENUM('Youtube', 'Gallery') NULL DEFAULT 'Youtube',
`disable_analytics` TINYINT(1) NULL DEFAULT 0,
`session_timeout` INT NULL DEFAULT 3600,
`encode_mp4` TINYINT(1) NULL DEFAULT 1,
`encode_webm` TINYINT(1) NULL DEFAULT 1,
`encode_mp3spectrum` TINYINT(1) NULL DEFAULT 1,
`autoplay` TINYINT(1) NULL DEFAULT 1,
PRIMARY KEY (`id`),
INDEX `fk_configurations_users1_idx` (`users_id` ASC),
CONSTRAINT `fk_configurations_users1`
@ -319,6 +327,27 @@ CREATE TABLE IF NOT EXISTS `video_ads_logs` (
ENGINE = InnoDB;
-- -----------------------------------------------------
-- Table `video_documents`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `video_documents` (
`id` INT NOT NULL AUTO_INCREMENT,
`doc_name` VARCHAR(255) NOT NULL,
`doc_description` TEXT NULL,
`created` DATETIME NULL,
`modified` DATETIME NULL,
`blob` BLOB NOT NULL,
`videos_id` INT NOT NULL,
PRIMARY KEY (`id`),
INDEX `fk_video_documents_videos1_idx` (`videos_id` ASC),
CONSTRAINT `fk_video_documents_videos1`
FOREIGN KEY (`videos_id`)
REFERENCES `videos` (`id`)
ON DELETE NO ACTION
ON UPDATE NO ACTION)
ENGINE = InnoDB;
SET SQL_MODE=@OLD_SQL_MODE;
SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS;
SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS;
SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS;

View file

@ -177,8 +177,8 @@ require_once '../objects/functions.php';
Update the package list.
<br>
<pre><code>
sudo apt-get update
sudo apt-get dist-upgrade
sudo apt-get update
sudo apt-get dist-upgrade
</code></pre>
<br>
Now FFmpeg is available to be installed with apt:

View file

@ -1,7 +1,7 @@
<?php
require_once $global['systemRootPath'] . 'objects/configuration.php';
$config = new Configuration();
if(empty($config)){
return true;
}
if (empty($_SESSION['language'])) {
$_SESSION['language'] = $config->getLanguage();
}

View file

@ -34,8 +34,6 @@ function listAll($dir) {
listAll($global['systemRootPath']);
sort($vars);
require_once $global['systemRootPath'] . 'objects/configuration.php';
$config = new Configuration();
?>
<!DOCTYPE html>
<html lang="<?php echo $config->getLanguage(); ?>">

View file

@ -5,7 +5,6 @@ if(empty($global['systemRootPath'])){
$global['systemRootPath'] = "../";
}
require_once $global['systemRootPath'].'videos/configuration.php';
require_once $global['systemRootPath'].'locale/function.php';
require_once $global['systemRootPath'] . 'objects/user.php';
if (!User::isAdmin()) {
die('{"error":"'.__("Permission denied").'"}');

View file

@ -4,7 +4,6 @@ if(empty($global['systemRootPath'])){
$global['systemRootPath'] = "../";
}
require_once $global['systemRootPath'].'videos/configuration.php';
require_once $global['systemRootPath'].'locale/function.php';
require_once $global['systemRootPath'] . 'objects/user.php';
if (!User::isAdmin() || empty($_POST['id'])) {
die('{"error":"'.__("Permission denied").'"}');

View file

@ -4,7 +4,6 @@ if(empty($global['systemRootPath'])){
$global['systemRootPath'] = "../";
}
require_once $global['systemRootPath'].'videos/configuration.php';
require_once $global['systemRootPath'].'locale/function.php';
require_once $global['systemRootPath'] . 'objects/user.php';
if (!User::canComment()) {
die('{"error":"'.__("Permission denied").'"}');

View file

@ -47,7 +47,17 @@ class Configuration {
private $adsense;
private $mode;
private $mode;
// version 2.7
private $disable_analytics;
private $session_timeout;
private $encode_mp4;
private $encode_webm;
private $encode_mp3spectrum;
private $ffmpegSpectrum;
private $autoplay;
function __construct($video_resolution="") {
$this->load();
if(!empty($video_resolution)){
@ -110,8 +120,16 @@ class Configuration {
. "adsense = '{$global['mysqli']->real_escape_string($this->getAdsense())}',"
. "mode = '{$this->getMode()}',"
. "logo = '{$global['mysqli']->real_escape_string($this->getLogo())}',"
. "logo_small = '{$global['mysqli']->real_escape_string($this->getLogo_small())}'"
. "logo_small = '{$global['mysqli']->real_escape_string($this->getLogo_small())}',"
. "disable_analytics = '{$this->getDisable_analytics()}',"
. "session_timeout = '{$this->getSession_timeout()}',"
. "encode_mp4 = '{$this->getEncode_mp4()}',"
. "encode_webm = '{$this->getEncode_webm()}',"
. "encode_mp3spectrum = '{$this->getEncode_mp3spectrum()}',"
. "ffmpegSpectrum = '{$global['mysqli']->real_escape_string($this->getFfmpegSpectrum())}',"
. "autoplay = '{$global['mysqli']->real_escape_string($this->getAutoplay())}'"
. "WHERE id = 1";
$insert_row = $global['mysqli']->query($sql);
@ -475,7 +493,68 @@ class Configuration {
$this->mode = $mode;
}
// version 2.7
function getDisable_analytics() {
return $this->disable_analytics;
}
function getSession_timeout() {
return $this->session_timeout;
}
function getEncode_mp4() {
return $this->encode_mp4;
}
function getEncode_webm() {
return $this->encode_webm;
}
function getEncode_mp3spectrum() {
return $this->encode_mp3spectrum;
}
function setDisable_analytics($disable_analytics) {
$this->disable_analytics = $disable_analytics=='true'?1:0;
}
function setSession_timeout($session_timeout) {
$this->session_timeout = $session_timeout;
}
function setEncode_mp4($encode_mp4) {
$this->encode_mp4 = $encode_mp4=='true'?1:0;
}
function setEncode_webm($encode_webm) {
$this->encode_webm = $encode_webm=='true'?1:0;
}
function setEncode_mp3spectrum($encode_mp3spectrum) {
$this->encode_mp3spectrum = $encode_mp3spectrum=='true'?1:0;
}
function getFfmpegSpectrum() {
if(empty($this->ffmpegSpectrum)){
return 'ffmpeg -i {$pathFileName} -filter_complex \'[0:a]showwaves=s=858x480:mode=line,format=yuv420p[v]\' -map \'[v]\' -map 0:a -c:v libx264 -c:a copy {$destinationFile}';
}
return $this->ffmpegSpectrum;
}
function setFfmpegSpectrum($ffmpegSpectrum) {
$this->ffmpegSpectrum = $ffmpegSpectrum;
}
function getAutoplay() {
return $this->autoplay;
}
function setAutoplay($autoplay) {
$this->autoplay = $autoplay=='true'?1:0;
}
// end version 2.7

View file

@ -38,6 +38,13 @@ $config->setHead($_POST['head']);
$config->setAdsense($_POST['adsense']);
$config->setMode($_POST['mode']);
$config->setDisable_analytics($_POST['disable_analytics']);
$config->setSession_timeout($_POST['session_timeout']);
$config->setEncode_mp4($_POST['encode_mp4']);
$config->setEncode_webm($_POST['encode_webm']);
$config->setEncode_mp3spectrum($_POST['encode_mp3spectrum']);
$config->setFfmpegSpectrum($_POST['ffmpegSpectrum']);
$config->setAutoplay($_POST['autoplay']);
$imagePath = "videos/userPhoto/";

View file

@ -11,9 +11,6 @@ if(empty($userId)){
die(json_encode($obj));
}
require_once $global['systemRootPath'] . 'objects/configuration.php';
$config = new Configuration();
header('Content-Type: application/json');
$cmd = "youtube-dl -e {$_POST['videoURL']}";
exec($cmd . " 2>&1", $output, $return_val);

View file

@ -40,14 +40,14 @@ function humanFileSize($size, $unit = "") {
return number_format($size) . " bytes";
}
function get_max_file_size(){
function get_max_file_size() {
return humanFileSize(file_upload_max_size());
}
function humanTiming ($time){
function humanTiming($time) {
$time = time() - $time; // to get the time since that moment
$time = ($time<1)? 1 : $time;
$tokens = array (
$time = ($time < 1) ? 1 : $time;
$tokens = array(
31536000 => __('year'),
2592000 => __('month'),
604800 => __('week'),
@ -58,19 +58,19 @@ function humanTiming ($time){
);
foreach ($tokens as $unit => $text) {
if ($time < $unit) continue;
if ($time < $unit)
continue;
$numberOfUnits = floor($time / $unit);
return $numberOfUnits.' '.$text.(($numberOfUnits>1)?'s':'');
return $numberOfUnits . ' ' . $text . (($numberOfUnits > 1) ? 's' : '');
}
}
function checkVideosDir(){
function checkVideosDir() {
$dir = "../videos";
if (file_exists($dir)) {
if(is_writable($dir)){
if (is_writable($dir)) {
return true;
}else{
} else {
return false;
}
} else {
@ -94,12 +94,21 @@ function isPHP($version = "'7.0.0'") {
}
function modRewriteEnabled() {
return in_array('mod_rewrite', apache_get_modules());
if(!function_exists('apache_get_modules')){
ob_start();
phpinfo(INFO_MODULES);
$contents = ob_get_contents();
ob_end_clean();
return (strpos($contents, 'mod_rewrite') !== false);
}else{
return in_array('mod_rewrite', apache_get_modules());
}
}
function isFFMPEG() {
return trim(shell_exec('which ffmpeg'));
}
function isExifToo() {
return trim(shell_exec('which exiftool'));
}
@ -162,7 +171,7 @@ function check_mysqlnd() {
return function_exists('mysqli_fetch_all');
}
function base64DataToImage($imgBase64){
function base64DataToImage($imgBase64) {
$img = $imgBase64;
$img = str_replace('data:image/png;base64,', '', $img);
$img = str_replace(' ', '+', $img);
@ -178,4 +187,4 @@ function getRealIpAddr() {
$ip = $_SERVER['REMOTE_ADDR'];
}
return $ip;
}
}

View file

@ -1,4 +1,23 @@
<?php
ini_set('error_log', $global['systemRootPath'].'videos/youphptube.log');
global $global;
$global['dont_show_us_flag'] = false;
global $config;
$global['mysqli'] = new mysqli($mysqlHost, $mysqlUser,$mysqlPass,$mysqlDatabase);
require_once $global['systemRootPath'] . 'objects/configuration.php';
$config = new Configuration();
require_once $global['systemRootPath'].'locale/function.php';
$global['dont_show_us_flag'] = false;
// this is for old versions
session_write_close ();
// server should keep session data for AT LEAST 1 hour
ini_set('session.gc_maxlifetime', $config->getSession_timeout());
// each client should remember their session id for EXACTLY 1 hour
session_set_cookie_params($config->getSession_timeout());
session_start();

View file

@ -11,8 +11,6 @@ use Hybridauth\Hybridauth;
use Hybridauth\HttpClient;
if (!empty($_GET['type'])) {
require_once $global['systemRootPath'] . 'objects/configuration.php';
$config = new Configuration();
switch ($_GET['type']) {
case "Google":
if(!$config->getAuthGoogle_enabled()){
@ -85,7 +83,6 @@ if (!empty($_GET['type'])) {
if(empty($_POST['user']) || empty($_POST['pass'])){
die(__("User and Password can not be blank"));
}
require_once $global['systemRootPath'] . 'locale/function.php';
$user = new User(0, $_POST['user'], $_POST['pass']);
$user->login();
$object = new stdClass();

View file

@ -7,8 +7,6 @@ $obj = new stdClass();
if ($valid) {
require_once $global['systemRootPath'] . 'objects/PHPMailer/PHPMailerAutoload.php';
require_once $global['systemRootPath'] . 'objects/configuration.php';
$config = new Configuration();
//Create a new PHPMailer instance
$mail = new PHPMailer;
// Set PHPMailer to use the sendmail transport

View file

@ -403,9 +403,7 @@ class User {
}
static function canUpload() {
global $global;
require_once $global['systemRootPath'] . 'objects/configuration.php';
$config = new Configuration();
global $global, $config;
if ($config->getAuthCanUploadVideos()) {
return self::isLogged();
}
@ -413,9 +411,7 @@ class User {
}
static function canComment() {
global $global;
require_once $global['systemRootPath'] . 'objects/configuration.php';
$config = new Configuration();
global $global, $config;
if ($config->getAuthCanComment()) {
return self::isLogged();
}

View file

@ -4,7 +4,6 @@ if(empty($global['systemRootPath'])){
$global['systemRootPath'] = "../";
}
require_once $global['systemRootPath'].'videos/configuration.php';
require_once $global['systemRootPath'].'locale/function.php';
require_once $global['systemRootPath'] . 'objects/user.php';
if (!User::isAdmin()) {
die('{"error":"'.__("Permission denied").'"}');

View file

@ -4,7 +4,6 @@ if(empty($global['systemRootPath'])){
$global['systemRootPath'] = "../";
}
require_once $global['systemRootPath'].'videos/configuration.php';
require_once $global['systemRootPath'].'locale/function.php';
require_once $global['systemRootPath'] . 'objects/user.php';
// check if user already exists
$userCheck = new User(0, $_POST['user'], false);

View file

@ -4,7 +4,6 @@ if(empty($global['systemRootPath'])){
$global['systemRootPath'] = "../";
}
require_once $global['systemRootPath'].'videos/configuration.php';
require_once $global['systemRootPath'].'locale/function.php';
require_once $global['systemRootPath'] . 'objects/user.php';
require_once $global['systemRootPath'] . 'objects/userGroups.php';
if (!User::isAdmin() || empty($_POST['id'])) {

View file

@ -5,7 +5,6 @@ if(empty($global['systemRootPath'])){
$global['systemRootPath'] = "../";
}
require_once $global['systemRootPath'].'videos/configuration.php';
require_once $global['systemRootPath'].'locale/function.php';
require_once $global['systemRootPath'] . 'objects/user.php';
if (!User::isAdmin()) {
die('{"error":"'.__("Permission denied").'"}');

View file

@ -4,7 +4,6 @@ if(empty($global['systemRootPath'])){
$global['systemRootPath'] = "../";
}
require_once $global['systemRootPath'].'videos/configuration.php';
require_once $global['systemRootPath'].'locale/function.php';
require_once $global['systemRootPath'] . 'objects/user.php';
if (!User::isAdmin() || empty($_POST['id'])) {
die('{"error":"'.__("Permission denied").'"}');

View file

@ -20,8 +20,6 @@ if (!(!empty($_GET['user']) && !empty($_GET['recoverpass']))) {
if ($valid) {
require_once $global['systemRootPath'] . 'objects/PHPMailer/PHPMailerAutoload.php';
require_once $global['systemRootPath'] . 'objects/configuration.php';
$config = new Configuration();
//Create a new PHPMailer instance
$mail = new PHPMailer;
// Set PHPMailer to use the sendmail transport

View file

@ -4,7 +4,6 @@ if(empty($global['systemRootPath'])){
$global['systemRootPath'] = "../";
}
require_once $global['systemRootPath'].'videos/configuration.php';
require_once $global['systemRootPath'].'locale/function.php';
require_once $global['systemRootPath'] . 'objects/user.php';
$user = new User(0);
$user->loadSelfUser();

View file

@ -4,7 +4,6 @@ if(empty($global['systemRootPath'])){
$global['systemRootPath'] = "../";
}
require_once $global['systemRootPath'].'videos/configuration.php';
require_once $global['systemRootPath'].'locale/function.php';
require_once $global['systemRootPath'] . 'objects/user.php';
header('Content-Type: application/json');
$users = User::getAllUsers();

View file

@ -4,7 +4,6 @@ if(empty($global['systemRootPath'])){
$global['systemRootPath'] = "../";
}
require_once $global['systemRootPath'].'videos/configuration.php';
require_once $global['systemRootPath'].'locale/function.php';
require_once $global['systemRootPath'] . 'objects/userGroups.php';
header('Content-Type: application/json');
$users = UserGroups::getAllUsersGroups();

View file

@ -553,12 +553,12 @@ class Video {
}
static function getDurationFromFile($file) {
global $config;
// get movie duration HOURS:MM:SS.MICROSECONDS
if (!file_exists($file)) {
error_log('{"status":"error", "msg":"getDurationFromFile ERROR, File (' . $file . ') Not Found"}');
return "EE:EE:EE";
}
$config = new Configuration();
//$cmd = 'ffprobe -i ' . $file . ' -sexagesimal -show_entries format=duration -v quiet -of csv="p=0"';
eval('$cmd="' . $config->getFfprobeDuration() . '";');
exec($cmd . ' 2>&1', $output, $return_val);
@ -617,12 +617,12 @@ class Video {
}
static function isLandscape($pathFileName) {
global $config;
// get movie duration HOURS:MM:SS.MICROSECONDS
if (!file_exists($pathFileName)) {
echo '{"status":"error", "msg":"getDurationFromFile ERROR, File (' . $pathFileName . ') Not Found"}';
exit;
}
$config = new Configuration();
eval('$cmd="' . $config->getExiftool() . '";');
$resp = true; // is landscape by default
exec($cmd . ' 2>&1', $output, $return_val);
@ -695,7 +695,7 @@ class Video {
if (empty($type) || $type === "ad") {
$obj = new stdClass();
$obj->label = __("Is a video Ad");
$obj->label = __("Is Ad");
if ($video->getIsAd()) {
$obj->type = "success";
$obj->text = __("Yes");

View file

@ -4,7 +4,6 @@ if(empty($global['systemRootPath'])){
$global['systemRootPath'] = "../";
}
require_once $global['systemRootPath'].'videos/configuration.php';
require_once $global['systemRootPath'].'locale/function.php';
require_once $global['systemRootPath'] . 'objects/user.php';
if (!User::canUpload() || empty($_POST['id'])) {
die('{"error":"'.__("Permission denied").'"}');
@ -19,7 +18,7 @@ $obj->setVideoGroups(empty($_POST['videoGroups'])?array():$_POST['videoGroups'])
$resp = $obj->save(true);
// make an ad
if ($resp && User::isAdmin() && !empty($_POST['isAd'])) {
if ($resp && User::isAdmin() && !empty($_POST['isAd']) && $_POST['isAd']!=='false') {
$msg = "Create a ad";
require 'video_ad.php';
$va = new Video_ad($_POST['id'], $_POST["adElements"]["categories_id"]);

View file

@ -4,7 +4,6 @@ if(empty($global['systemRootPath'])){
$global['systemRootPath'] = "../";
}
require_once $global['systemRootPath'].'videos/configuration.php';
require_once $global['systemRootPath'].'locale/function.php';
require_once $global['systemRootPath'] . 'objects/user.php';
if (!User::canUpload() || empty($_POST['id'])) {
die('{"error":"'.__("Permission denied").'"}');

View file

@ -5,7 +5,6 @@ if(empty($global['systemRootPath'])){
$global['systemRootPath'] = "../";
}
require_once $global['systemRootPath'].'videos/configuration.php';
require_once $global['systemRootPath'].'locale/function.php';
require_once $global['systemRootPath'] . 'objects/user.php';
if (!User::isAdmin() || empty($_POST['id'])) {
die('{"error":"'.__("Permission denied").'"}');

View file

@ -4,7 +4,6 @@ if(empty($global['systemRootPath'])){
$global['systemRootPath'] = "../";
}
require_once $global['systemRootPath'].'videos/configuration.php';
require_once $global['systemRootPath'].'locale/function.php';
require_once $global['systemRootPath'] . 'objects/user.php';
if (!User::isAdmin() || empty($_POST['id'])) {
die('{"error":"'.__("Permission denied").'"}');

View file

@ -4,7 +4,6 @@ if(empty($global['systemRootPath'])){
$global['systemRootPath'] = "../";
}
require_once $global['systemRootPath'].'videos/configuration.php';
require_once $global['systemRootPath'].'locale/function.php';
require_once $global['systemRootPath'] . 'objects/user.php';
if (!User::isAdmin() || empty($_POST['id'])) {
die('{"error":"'.__("Permission denied").'"}');

View file

@ -4,7 +4,6 @@ if(empty($global['systemRootPath'])){
$global['systemRootPath'] = "../";
}
require_once $global['systemRootPath'].'videos/configuration.php';
require_once $global['systemRootPath'].'locale/function.php';
require_once $global['systemRootPath'] . 'objects/user.php';
require 'video_ad.php';
Video_ad::clickLog($_GET['video_ads_logs_id']);

View file

@ -4,7 +4,6 @@ if(empty($global['systemRootPath'])){
$global['systemRootPath'] = "../";
}
require_once $global['systemRootPath'].'videos/configuration.php';
require_once $global['systemRootPath'].'locale/function.php';
require_once $global['systemRootPath'] . 'objects/user.php';
if (!User::isAdmin() || empty($_POST['id'])) {
die('{"error":"'.__("Permission denied").'"}');

View file

@ -4,7 +4,6 @@ if(empty($global['systemRootPath'])){
$global['systemRootPath'] = "../";
}
require_once $global['systemRootPath'].'videos/configuration.php';
require_once $global['systemRootPath'].'locale/function.php';
require_once $global['systemRootPath'] . 'objects/user.php';
if (!User::isAdmin() || empty($_POST['id'])) {
die('{"error":"'.__("Permission denied").'"}');

View file

@ -3,9 +3,6 @@
require_once '../videos/configuration.php';
require_once $global['systemRootPath'] . 'objects/user.php';
require_once $global['systemRootPath'] . 'objects/configuration.php';
$config = new Configuration();
$filename = $argv[1];
$videoURL = $argv[2];
$userId = $argv[3];

View file

@ -7,9 +7,6 @@ if (!User::isAdmin()) {
exit;
}
require_once $global['systemRootPath'] . 'objects/configuration.php';
$config = new Configuration();
?>
<!DOCTYPE html>
<html lang="<?php echo $config->getLanguage(); ?>">

27
update/updateDb.v2.8.sql Normal file
View file

@ -0,0 +1,27 @@
-- MySQL Workbench Synchronization
-- Generated: 2017-06-01 09:30
-- 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';
ALTER TABLE `youPHPTube`.`configurations`
ADD COLUMN `ffmpegSpectrum` VARCHAR(400) NULL DEFAULT NULL AFTER `ffmpegMp3`,
ADD COLUMN `disable_analytics` TINYINT(1) NULL DEFAULT 0 AFTER `mode`,
ADD COLUMN `session_timeout` INT(11) NULL DEFAULT 3600 AFTER `disable_analytics`,
ADD COLUMN `encode_mp4` TINYINT(1) NULL DEFAULT 1 AFTER `session_timeout`,
ADD COLUMN `encode_webm` TINYINT(1) NULL DEFAULT 1 AFTER `encode_mp4`,
ADD COLUMN `autoplay` TINYINT(1) NULL DEFAULT 1 AFTER `encode_webm`,
ADD COLUMN `encode_mp3spectrum` TINYINT(1) NULL DEFAULT 1 AFTER `autoplay`;
SET SQL_MODE=@OLD_SQL_MODE;
SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS;
SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS;
UPDATE configurations SET version = '2.8', modified = now() WHERE id = 1;

View file

@ -1,7 +1,5 @@
<?php
require_once '../videos/configuration.php';
require_once $global['systemRootPath'] . 'objects/configuration.php';
$config = new Configuration();
?>
<!DOCTYPE html>
<html lang="<?php echo $config->getLanguage(); ?>">

View file

@ -10,8 +10,6 @@ require_once '../videos/configuration.php';
require_once $global['systemRootPath'] . 'objects/user.php';
require_once $global['systemRootPath'] . 'objects/functions.php';
require_once $global['systemRootPath'] . 'objects/configuration.php';
$config = new Configuration();
?>
<!DOCTYPE html>
<html lang="<?php echo $_SESSION['language']; ?>">

View file

@ -1,9 +1,7 @@
<?php
require_once '../videos/configuration.php';
require_once $global['systemRootPath'] . 'objects/user.php';
require_once $global['systemRootPath'] . 'objects/configuration.php';
require_once $global['systemRootPath'] . 'objects/functions.php';
$config = new Configuration();
//var_dump($config);exit;
?>
<!DOCTYPE html>
@ -435,7 +433,15 @@ $config = new Configuration();
</select>
</div>
</div>
</div>
<div class="form-group">
<label class="col-md-4 control-label"><?php echo __("Autoplay Video on Load Page"); ?></label>
<div class="col-md-8">
<input data-toggle="toggle" type="checkbox" name="autoplay" id="autoplay" value="1" <?php if(!empty($config->getAutoplay())){echo "checked";} ?>>
</div>
</div>
<div class="form-group">
<label class="col-md-4 control-label"><?php echo __("Enable Facebook Login"); ?></label>
@ -578,6 +584,13 @@ $config = new Configuration();
<input id="ffmpegMp3" class="form-control" type="text" value="<?php echo $config->getFfmpegMp3(); ?>" >
</div>
</div>
<div class="form-group">
<label class="col-md-2"><?php echo __("FFMPEG MP3 Spectrum"); ?></label>
<div class="col-md-10">
<input id="ffmpegSpectrum" class="form-control" type="text" value="<?php echo $config->getFfmpegSpectrum(); ?>" >
</div>
</div>
<div class="form-group">
<label class="col-md-2"><?php echo __("FFMPEG Ogg"); ?></label>
@ -592,6 +605,42 @@ $config = new Configuration();
<input id="youtubeDl" class="form-control" type="text" value="<?php echo $config->getYoutubedl(); ?>" >
</div>
</div>
<div class="form-group">
<label class="col-md-2"><?php echo __("Session Timeout in seconds"); ?></label>
<div class="col-md-10">
<input id="session_timeout" class="form-control" type="number" value="<?php echo $config->getSession_timeout(); ?>" >
</div>
</div>
<div class="form-group">
<label class="col-md-2"><?php echo __("Encode video in MP4 Format"); ?></label>
<div class="col-md-10">
<input data-toggle="toggle" type="checkbox" name="encode_mp4" id="encode_mp4" value="1" <?php if(!empty($config->getEncode_mp4())){echo "checked";} ?>>
</div>
</div>
<div class="form-group">
<label class="col-md-2"><?php echo __("Encode video in WEBM Format"); ?></label>
<div class="col-md-10">
<input data-toggle="toggle" type="checkbox" name="encode_webm" id="encode_webm" value="1" <?php if(!empty($config->getEncode_webm())){echo "checked";} ?>>
</div>
</div>
<div class="form-group">
<label class="col-md-2"><?php echo __("Encode MP3 file Spectrum"); ?></label>
<div class="col-md-10">
<input data-toggle="toggle" type="checkbox" name="encode_mp3spectrum" id="encode_mp3spectrum" value="1" <?php if(!empty($config->getEncode_mp3spectrum())){echo "checked";} ?>>
</div>
</div>
<div class="form-group">
<label class="col-md-2"><?php echo __("Disable YouPHPTube Google Analytics"); ?></label>
<div class="col-md-10">
<input data-toggle="toggle" type="checkbox" name="disable_analytics" id="disable_analytics" value="1" <?php if(!empty($config->getDisable_analytics())){echo "checked";} ?> aria-describedby="disable_analyticsHelp">
<small id="disable_analyticsHelp" class="form-text text-muted"><?php echo __("This help us to track and dettect errors"); ?></small>
</div>
</div>
</fieldset>
</div>
<div class="tab-pane" id="tabHead">
@ -694,7 +743,7 @@ $config = new Configuration();
update('cpu', response);
setTimeout(function () {
getCpu();
}, 1000);
}, 2000);
}
});
}
@ -707,7 +756,7 @@ $config = new Configuration();
setTimeout(function () {
getMem();
}, 1000);
}, 10000);
}
});
}
@ -719,7 +768,7 @@ $config = new Configuration();
update('disk', response);
setTimeout(function () {
getDisk();
}, 1000);
}, 30000);
}
});
}
@ -910,7 +959,15 @@ $config = new Configuration();
"ffmpegPath": $('#ffmpegPath').val(),
"head": $('#head').val(),
"adsense": $('#adsense').val(),
"mode": $('#mode').val()
"mode": $('#mode').val(),
"disable_analytics": $('#disable_analytics').prop("checked"),
"session_timeout": $('#session_timeout').val(),
"encode_mp4": $('#encode_mp4').prop("checked"),
"encode_webm": $('#encode_webm').prop("checked"),
"encode_mp3spectrum": $('#encode_mp3spectrum').prop("checked"),
"ffmpegSpectrum": $('#ffmpegSpectrum').val(),
"autoplay": $('#autoplay').prop("checked")
},
type: 'post',
success: function (response) {

View file

@ -1,7 +1,5 @@
<?php
require_once '../videos/configuration.php';
require_once $global['systemRootPath'] . 'objects/configuration.php';
$config = new Configuration();
?>
<!DOCTYPE html>
<html lang="<?php echo $_SESSION['language']; ?>">

View file

@ -450,4 +450,10 @@ footer {
.galleryVideo .group {
overflow: hidden;
text-overflow: ellipsis;
}
.autoplay span span{
margin: 0 5px;
color: #767676;
font-weight: bold;
}

View file

@ -5,8 +5,6 @@ if (!User::canUpload()) {
header("location: {$global['webSiteRootURL']}user");
exit;
}
require_once $global['systemRootPath'] . 'objects/configuration.php';
$config = new Configuration();
function isYoutubeDl() {
return trim(shell_exec('which youtube-dl'));

BIN
view/img/static.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 252 KiB

View file

@ -1,7 +1,3 @@
<?php
require_once $global['systemRootPath'] . 'objects/configuration.php';
$config = new Configuration();
?>
<hr>
<footer>
<ul class="list-inline">
@ -41,4 +37,6 @@ if (!empty($_GET['error'])) {
<script src="<?php echo $global['webSiteRootURL']; ?>js/bootpag/jquery.bootpag.min.js" type="text/javascript"></script>
<script src="<?php echo $global['webSiteRootURL']; ?>js/bootgrid/jquery.bootgrid.js" type="text/javascript"></script>
<script src="<?php echo $global['webSiteRootURL']; ?>bootstrap/bootstrapSelectPicker/js/bootstrap-select.min.js" type="text/javascript"></script>
<script src="<?php echo $global['webSiteRootURL']; ?>js/script.js" type="text/javascript"></script>
<script src="<?php echo $global['webSiteRootURL']; ?>js/script.js" type="text/javascript"></script>
<script src="<?php echo $global['webSiteRootURL']; ?>js/bootstrap-toggle/bootstrap-toggle.min.js" type="text/javascript"></script>
<script src="<?php echo $global['webSiteRootURL']; ?>js/js-cookie/js.cookie.js" type="text/javascript"></script>

View file

@ -1,7 +1,3 @@
<?php
require_once $global['systemRootPath'] . 'objects/configuration.php';
$config = new Configuration();
?>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
@ -15,7 +11,11 @@ $config = new Configuration();
<link href="<?php echo $global['webSiteRootURL']; ?>js/bootgrid/jquery.bootgrid.css" rel="stylesheet" type="text/css"/>
<link href="<?php echo $global['webSiteRootURL']; ?>css/main.css" rel="stylesheet" type="text/css"/>
<link href="<?php echo $global['webSiteRootURL']; ?>css/font-awesome-4.7.0/css/font-awesome.min.css" rel="stylesheet" type="text/css"/>
<link href="<?php echo $global['webSiteRootURL']; ?>js/bootstrap-toggle/bootstrap-toggle.min.css" rel="stylesheet" type="text/css"/>
<script src="<?php echo $global['webSiteRootURL']; ?>js/jquery-3.2.0.min.js" type="text/javascript"></script>
<?php
if(!$config->getDisable_analytics()){
?>
<script>
// YouPHPTube Analytics
(function (i, s, o, g, r, a, m) {
@ -34,5 +34,6 @@ $config = new Configuration();
ga('youPHPTube.send', 'pageview');
</script>
<?php
}
echo $config->getHead();
?>

View file

@ -7,8 +7,6 @@ if (empty($_SESSION['language'])) {
} else {
$lang = $_SESSION['language'];
}
require_once $global['systemRootPath'] . 'objects/configuration.php';
$config = new Configuration();
?>
<style>
@media (max-width: 550px) {

View file

@ -14,7 +14,7 @@ if (!empty($ad)) {
echo "ad";
}
?>">
<video poster="<?php echo $poster; ?>" controls crossorigin autoplay
<video poster="<?php echo $poster; ?>" controls crossorigin
class="embed-responsive-item video-js vjs-default-skin vjs-16-9 vjs-big-play-centered" id="mainVideo" data-setup='{ aspectRatio: "16:9" }'>
<source src="<?php echo $global['webSiteRootURL']; ?>videos/<?php echo $playNowVideo['filename']; ?>.mp4" type="video/mp4">
<source src="<?php echo $global['webSiteRootURL']; ?>videos/<?php echo $playNowVideo['filename']; ?>.webm" type="video/webm">
@ -45,7 +45,14 @@ if (!empty($ad)) {
$(document).ready(function () {
fullFuration = strToSeconds('<?php echo $ad['duration']; ?>');
player = videojs('mainVideo').ready(function () {
this.play();
<?php if($config->getAutoplay()){ echo "this.play();"; }else{
?>
if(Cookies.get('autoplay') && Cookies.get('autoplay')!=='false'){
this.play();
}
<?php
} ?>
<?php if (!empty($logId)) { ?>
isPlayingAd = true;
this.on('ended', function () {
@ -54,6 +61,18 @@ if (!empty($ad)) {
isPlayingAd = false;
$('#adButton').trigger("click");
}
<?php
// if autoplay play next video
if(!empty($videos[0])){
?>
else if(Cookies.get('autoplay') && Cookies.get('autoplay')!=='false'){
document.location = '<?php echo $global['webSiteRootURL']; ?>video/<?php echo $videos[0]['clean_title']; ?>';
}
<?php
}
?>
});
this.on('timeupdate', function () {
var durationLeft = fullFuration-this.currentTime();

View file

@ -6,8 +6,6 @@ if (!file_exists('../videos/configuration.php')) {
header("Location: install/index.php");
}
require_once '../videos/configuration.php';
require_once $global['systemRootPath'] . 'objects/configuration.php';
$config = new Configuration();
$mode = $config->getMode();
if(!empty($_GET['videoName'])){
$mode = "Youtube";

View file

@ -0,0 +1,83 @@
/*! ========================================================================
* Bootstrap Toggle: bootstrap-toggle.css v2.2.0
* http://www.bootstraptoggle.com
* ========================================================================
* Copyright 2014 Min Hur, The New York Times Company
* Licensed under MIT
* ======================================================================== */
.checkbox label .toggle,
.checkbox-inline .toggle {
margin-left: -20px;
margin-right: 5px;
}
.toggle {
position: relative;
overflow: hidden;
}
.toggle input[type="checkbox"] {
display: none;
}
.toggle-group {
position: absolute;
width: 200%;
top: 0;
bottom: 0;
left: 0;
transition: left 0.35s;
-webkit-transition: left 0.35s;
-moz-user-select: none;
-webkit-user-select: none;
}
.toggle.off .toggle-group {
left: -100%;
}
.toggle-on {
position: absolute;
top: 0;
bottom: 0;
left: 0;
right: 50%;
margin: 0;
border: 0;
border-radius: 0;
}
.toggle-off {
position: absolute;
top: 0;
bottom: 0;
left: 50%;
right: 0;
margin: 0;
border: 0;
border-radius: 0;
}
.toggle-handle {
position: relative;
margin: 0 auto;
padding-top: 0px;
padding-bottom: 0px;
height: 100%;
width: 0px;
border-width: 0 1px;
}
.toggle.btn { min-width: 59px; min-height: 34px; }
.toggle-on.btn { padding-right: 24px; }
.toggle-off.btn { padding-left: 24px; }
.toggle.btn-lg { min-width: 79px; min-height: 45px; }
.toggle-on.btn-lg { padding-right: 31px; }
.toggle-off.btn-lg { padding-left: 31px; }
.toggle-handle.btn-lg { width: 40px; }
.toggle.btn-sm { min-width: 50px; min-height: 30px;}
.toggle-on.btn-sm { padding-right: 20px; }
.toggle-off.btn-sm { padding-left: 20px; }
.toggle.btn-xs { min-width: 35px; min-height: 22px;}
.toggle-on.btn-xs { padding-right: 12px; }
.toggle-off.btn-xs { padding-left: 12px; }

View file

@ -0,0 +1,180 @@
/*! ========================================================================
* Bootstrap Toggle: bootstrap-toggle.js v2.2.0
* http://www.bootstraptoggle.com
* ========================================================================
* Copyright 2014 Min Hur, The New York Times Company
* Licensed under MIT
* ======================================================================== */
+function ($) {
'use strict';
// TOGGLE PUBLIC CLASS DEFINITION
// ==============================
var Toggle = function (element, options) {
this.$element = $(element)
this.options = $.extend({}, this.defaults(), options)
this.render()
}
Toggle.VERSION = '2.2.0'
Toggle.DEFAULTS = {
on: 'On',
off: 'Off',
onstyle: 'primary',
offstyle: 'default',
size: 'normal',
style: '',
width: null,
height: null
}
Toggle.prototype.defaults = function() {
return {
on: this.$element.attr('data-on') || Toggle.DEFAULTS.on,
off: this.$element.attr('data-off') || Toggle.DEFAULTS.off,
onstyle: this.$element.attr('data-onstyle') || Toggle.DEFAULTS.onstyle,
offstyle: this.$element.attr('data-offstyle') || Toggle.DEFAULTS.offstyle,
size: this.$element.attr('data-size') || Toggle.DEFAULTS.size,
style: this.$element.attr('data-style') || Toggle.DEFAULTS.style,
width: this.$element.attr('data-width') || Toggle.DEFAULTS.width,
height: this.$element.attr('data-height') || Toggle.DEFAULTS.height
}
}
Toggle.prototype.render = function () {
this._onstyle = 'btn-' + this.options.onstyle
this._offstyle = 'btn-' + this.options.offstyle
var size = this.options.size === 'large' ? 'btn-lg'
: this.options.size === 'small' ? 'btn-sm'
: this.options.size === 'mini' ? 'btn-xs'
: ''
var $toggleOn = $('<label class="btn">').html(this.options.on)
.addClass(this._onstyle + ' ' + size)
var $toggleOff = $('<label class="btn">').html(this.options.off)
.addClass(this._offstyle + ' ' + size + ' active')
var $toggleHandle = $('<span class="toggle-handle btn btn-default">')
.addClass(size)
var $toggleGroup = $('<div class="toggle-group">')
.append($toggleOn, $toggleOff, $toggleHandle)
var $toggle = $('<div class="toggle btn" data-toggle="toggle">')
.addClass( this.$element.prop('checked') ? this._onstyle : this._offstyle+' off' )
.addClass(size).addClass(this.options.style)
this.$element.wrap($toggle)
$.extend(this, {
$toggle: this.$element.parent(),
$toggleOn: $toggleOn,
$toggleOff: $toggleOff,
$toggleGroup: $toggleGroup
})
this.$toggle.append($toggleGroup)
var width = this.options.width || Math.max($toggleOn.outerWidth(), $toggleOff.outerWidth())+($toggleHandle.outerWidth()/2)
var height = this.options.height || Math.max($toggleOn.outerHeight(), $toggleOff.outerHeight())
$toggleOn.addClass('toggle-on')
$toggleOff.addClass('toggle-off')
this.$toggle.css({ width: width, height: height })
if (this.options.height) {
$toggleOn.css('line-height', $toggleOn.height() + 'px')
$toggleOff.css('line-height', $toggleOff.height() + 'px')
}
this.update(true)
this.trigger(true)
}
Toggle.prototype.toggle = function () {
if (this.$element.prop('checked')) this.off()
else this.on()
}
Toggle.prototype.on = function (silent) {
if (this.$element.prop('disabled')) return false
this.$toggle.removeClass(this._offstyle + ' off').addClass(this._onstyle)
this.$element.prop('checked', true)
if (!silent) this.trigger()
}
Toggle.prototype.off = function (silent) {
if (this.$element.prop('disabled')) return false
this.$toggle.removeClass(this._onstyle).addClass(this._offstyle + ' off')
this.$element.prop('checked', false)
if (!silent) this.trigger()
}
Toggle.prototype.enable = function () {
this.$toggle.removeAttr('disabled')
this.$element.prop('disabled', false)
}
Toggle.prototype.disable = function () {
this.$toggle.attr('disabled', 'disabled')
this.$element.prop('disabled', true)
}
Toggle.prototype.update = function (silent) {
if (this.$element.prop('disabled')) this.disable()
else this.enable()
if (this.$element.prop('checked')) this.on(silent)
else this.off(silent)
}
Toggle.prototype.trigger = function (silent) {
this.$element.off('change.bs.toggle')
if (!silent) this.$element.change()
this.$element.on('change.bs.toggle', $.proxy(function() {
this.update()
}, this))
}
Toggle.prototype.destroy = function() {
this.$element.off('change.bs.toggle')
this.$toggleGroup.remove()
this.$element.removeData('bs.toggle')
this.$element.unwrap()
}
// TOGGLE PLUGIN DEFINITION
// ========================
function Plugin(option) {
return this.each(function () {
var $this = $(this)
var data = $this.data('bs.toggle')
var options = typeof option == 'object' && option
if (!data) $this.data('bs.toggle', (data = new Toggle(this, options)))
if (typeof option == 'string' && data[option]) data[option]()
})
}
var old = $.fn.bootstrapToggle
$.fn.bootstrapToggle = Plugin
$.fn.bootstrapToggle.Constructor = Toggle
// TOGGLE NO CONFLICT
// ==================
$.fn.toggle.noConflict = function () {
$.fn.bootstrapToggle = old
return this
}
// TOGGLE DATA-API
// ===============
$(function() {
$('input[type=checkbox][data-toggle^=toggle]').bootstrapToggle()
})
$(document).on('click.bs.toggle', 'div[data-toggle^=toggle]', function(e) {
var $checkbox = $(this).find('input[type=checkbox]')
$checkbox.bootstrapToggle('toggle')
e.preventDefault()
})
}(jQuery);

View file

@ -0,0 +1,28 @@
/*! ========================================================================
* Bootstrap Toggle: bootstrap-toggle.css v2.2.0
* http://www.bootstraptoggle.com
* ========================================================================
* Copyright 2014 Min Hur, The New York Times Company
* Licensed under MIT
* ======================================================================== */
.checkbox label .toggle,.checkbox-inline .toggle{margin-left:-20px;margin-right:5px}
.toggle{position:relative;overflow:hidden}
.toggle input[type=checkbox]{display:none}
.toggle-group{position:absolute;width:200%;top:0;bottom:0;left:0;transition:left .35s;-webkit-transition:left .35s;-moz-user-select:none;-webkit-user-select:none}
.toggle.off .toggle-group{left:-100%}
.toggle-on{position:absolute;top:0;bottom:0;left:0;right:50%;margin:0;border:0;border-radius:0}
.toggle-off{position:absolute;top:0;bottom:0;left:50%;right:0;margin:0;border:0;border-radius:0}
.toggle-handle{position:relative;margin:0 auto;padding-top:0;padding-bottom:0;height:100%;width:0;border-width:0 1px}
.toggle.btn{min-width:59px;min-height:34px}
.toggle-on.btn{padding-right:24px}
.toggle-off.btn{padding-left:24px}
.toggle.btn-lg{min-width:79px;min-height:45px}
.toggle-on.btn-lg{padding-right:31px}
.toggle-off.btn-lg{padding-left:31px}
.toggle-handle.btn-lg{width:40px}
.toggle.btn-sm{min-width:50px;min-height:30px}
.toggle-on.btn-sm{padding-right:20px}
.toggle-off.btn-sm{padding-left:20px}
.toggle.btn-xs{min-width:35px;min-height:22px}
.toggle-on.btn-xs{padding-right:12px}
.toggle-off.btn-xs{padding-left:12px}

View file

@ -0,0 +1,9 @@
/*! ========================================================================
* Bootstrap Toggle: bootstrap-toggle.js v2.2.0
* http://www.bootstraptoggle.com
* ========================================================================
* Copyright 2014 Min Hur, The New York Times Company
* Licensed under MIT
* ======================================================================== */
+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.toggle"),f="object"==typeof b&&b;e||d.data("bs.toggle",e=new c(this,f)),"string"==typeof b&&e[b]&&e[b]()})}var c=function(b,c){this.$element=a(b),this.options=a.extend({},this.defaults(),c),this.render()};c.VERSION="2.2.0",c.DEFAULTS={on:"On",off:"Off",onstyle:"primary",offstyle:"default",size:"normal",style:"",width:null,height:null},c.prototype.defaults=function(){return{on:this.$element.attr("data-on")||c.DEFAULTS.on,off:this.$element.attr("data-off")||c.DEFAULTS.off,onstyle:this.$element.attr("data-onstyle")||c.DEFAULTS.onstyle,offstyle:this.$element.attr("data-offstyle")||c.DEFAULTS.offstyle,size:this.$element.attr("data-size")||c.DEFAULTS.size,style:this.$element.attr("data-style")||c.DEFAULTS.style,width:this.$element.attr("data-width")||c.DEFAULTS.width,height:this.$element.attr("data-height")||c.DEFAULTS.height}},c.prototype.render=function(){this._onstyle="btn-"+this.options.onstyle,this._offstyle="btn-"+this.options.offstyle;var b="large"===this.options.size?"btn-lg":"small"===this.options.size?"btn-sm":"mini"===this.options.size?"btn-xs":"",c=a('<label class="btn">').html(this.options.on).addClass(this._onstyle+" "+b),d=a('<label class="btn">').html(this.options.off).addClass(this._offstyle+" "+b+" active"),e=a('<span class="toggle-handle btn btn-default">').addClass(b),f=a('<div class="toggle-group">').append(c,d,e),g=a('<div class="toggle btn" data-toggle="toggle">').addClass(this.$element.prop("checked")?this._onstyle:this._offstyle+" off").addClass(b).addClass(this.options.style);this.$element.wrap(g),a.extend(this,{$toggle:this.$element.parent(),$toggleOn:c,$toggleOff:d,$toggleGroup:f}),this.$toggle.append(f);var h=this.options.width||Math.max(c.outerWidth(),d.outerWidth())+e.outerWidth()/2,i=this.options.height||Math.max(c.outerHeight(),d.outerHeight());c.addClass("toggle-on"),d.addClass("toggle-off"),this.$toggle.css({width:h,height:i}),this.options.height&&(c.css("line-height",c.height()+"px"),d.css("line-height",d.height()+"px")),this.update(!0),this.trigger(!0)},c.prototype.toggle=function(){this.$element.prop("checked")?this.off():this.on()},c.prototype.on=function(a){return this.$element.prop("disabled")?!1:(this.$toggle.removeClass(this._offstyle+" off").addClass(this._onstyle),this.$element.prop("checked",!0),void(a||this.trigger()))},c.prototype.off=function(a){return this.$element.prop("disabled")?!1:(this.$toggle.removeClass(this._onstyle).addClass(this._offstyle+" off"),this.$element.prop("checked",!1),void(a||this.trigger()))},c.prototype.enable=function(){this.$toggle.removeAttr("disabled"),this.$element.prop("disabled",!1)},c.prototype.disable=function(){this.$toggle.attr("disabled","disabled"),this.$element.prop("disabled",!0)},c.prototype.update=function(a){this.$element.prop("disabled")?this.disable():this.enable(),this.$element.prop("checked")?this.on(a):this.off(a)},c.prototype.trigger=function(b){this.$element.off("change.bs.toggle"),b||this.$element.change(),this.$element.on("change.bs.toggle",a.proxy(function(){this.update()},this))},c.prototype.destroy=function(){this.$element.off("change.bs.toggle"),this.$toggleGroup.remove(),this.$element.removeData("bs.toggle"),this.$element.unwrap()};var d=a.fn.bootstrapToggle;a.fn.bootstrapToggle=b,a.fn.bootstrapToggle.Constructor=c,a.fn.toggle.noConflict=function(){return a.fn.bootstrapToggle=d,this},a(function(){a("input[type=checkbox][data-toggle^=toggle]").bootstrapToggle()}),a(document).on("click.bs.toggle","div[data-toggle^=toggle]",function(b){var c=a(this).find("input[type=checkbox]");c.bootstrapToggle("toggle"),b.preventDefault()})}(jQuery);
//# sourceMappingURL=bootstrap-toggle.min.js.map

View file

@ -0,0 +1 @@
{"version":3,"file":"bootstrap-toggle.min.js","sources":["bootstrap-toggle.js"],"names":["$","Plugin","option","this","each","$this","data","options","Toggle","element","$element","extend","defaults","render","VERSION","DEFAULTS","on","off","onstyle","offstyle","size","style","width","height","prototype","attr","_onstyle","_offstyle","$toggleOn","html","addClass","$toggleOff","$toggleHandle","$toggleGroup","append","$toggle","prop","wrap","parent","Math","max","outerWidth","outerHeight","css","update","trigger","toggle","silent","removeClass","enable","removeAttr","disable","change","proxy","destroy","remove","removeData","unwrap","old","fn","bootstrapToggle","Constructor","noConflict","document","e","$checkbox","find","preventDefault","jQuery"],"mappings":"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"}

View file

@ -0,0 +1,85 @@
/*! ========================================================================
* Bootstrap Toggle: bootstrap2-toggle.css v2.2.0
* http://www.bootstraptoggle.com
* ========================================================================
* Copyright 2014 Min Hur, The New York Times Company
* Licensed under MIT
* ======================================================================== */
label.checkbox .toggle,
label.checkbox.inline .toggle {
margin-left: -20px;
margin-right: 5px;
}
.toggle {
min-width: 40px;
height: 20px;
position: relative;
overflow: hidden;
}
.toggle input[type="checkbox"] {
display: none;
}
.toggle-group {
position: absolute;
width: 200%;
top: 0;
bottom: 0;
left: 0;
transition: left 0.35s;
-webkit-transition: left 0.35s;
-moz-user-select: none;
-webkit-user-select: none;
}
.toggle.off .toggle-group {
left: -100%;
}
.toggle-on {
position: absolute;
top: 0;
bottom: 0;
left: 0;
right: 50%;
margin: 0;
border: 0;
border-radius: 0;
}
.toggle-off {
position: absolute;
top: 0;
bottom: 0;
left: 50%;
right: 0;
margin: 0;
border: 0;
border-radius: 0;
}
.toggle-handle {
position: relative;
margin: 0 auto;
padding-top: 0px;
padding-bottom: 0px;
height: 100%;
width: 0px;
border-width: 0 1px;
}
.toggle-handle.btn-mini {
top: -1px;
}
.toggle.btn { min-width: 30px; }
.toggle-on.btn { padding-right: 24px; }
.toggle-off.btn { padding-left: 24px; }
.toggle.btn-large { min-width: 40px; }
.toggle-on.btn-large { padding-right: 35px; }
.toggle-off.btn-large { padding-left: 35px; }
.toggle.btn-small { min-width: 25px; }
.toggle-on.btn-small { padding-right: 20px; }
.toggle-off.btn-small { padding-left: 20px; }
.toggle.btn-mini { min-width: 20px; }
.toggle-on.btn-mini { padding-right: 12px; }
.toggle-off.btn-mini { padding-left: 12px; }

View file

@ -0,0 +1,180 @@
/*! ========================================================================
* Bootstrap Toggle: bootstrap2-toggle.js v2.2.0
* http://www.bootstraptoggle.com
* ========================================================================
* Copyright 2014 Min Hur, The New York Times Company
* Licensed under MIT
* ======================================================================== */
+function ($) {
'use strict';
// TOGGLE PUBLIC CLASS DEFINITION
// ==============================
var Toggle = function (element, options) {
this.$element = $(element)
this.options = $.extend({}, this.defaults(), options)
this.render()
}
Toggle.VERSION = '2.2.0'
Toggle.DEFAULTS = {
on: 'On',
off: 'Off',
onstyle: 'primary',
offstyle: 'default',
size: 'normal',
style: '',
width: null,
height: null
}
Toggle.prototype.defaults = function() {
return {
on: this.$element.attr('data-on') || Toggle.DEFAULTS.on,
off: this.$element.attr('data-off') || Toggle.DEFAULTS.off,
onstyle: this.$element.attr('data-onstyle') || Toggle.DEFAULTS.onstyle,
offstyle: this.$element.attr('data-offstyle') || Toggle.DEFAULTS.offstyle,
size: this.$element.attr('data-size') || Toggle.DEFAULTS.size,
style: this.$element.attr('data-style') || Toggle.DEFAULTS.style,
width: this.$element.attr('data-width') || Toggle.DEFAULTS.width,
height: this.$element.attr('data-height') || Toggle.DEFAULTS.height
}
}
Toggle.prototype.render = function () {
this._onstyle = 'btn-' + this.options.onstyle
this._offstyle = 'btn-' + this.options.offstyle
var size = this.options.size === 'large' ? 'btn-large'
: this.options.size === 'small' ? 'btn-small'
: this.options.size === 'mini' ? 'btn-mini'
: ''
var $toggleOn = $('<label class="btn">').html(this.options.on)
.addClass(this._onstyle + ' ' + size)
var $toggleOff = $('<label class="btn">').html(this.options.off)
.addClass(this._offstyle + ' ' + size + ' active')
var $toggleHandle = $('<span class="toggle-handle btn btn-default">')
.addClass(size)
var $toggleGroup = $('<div class="toggle-group">')
.append($toggleOn, $toggleOff, $toggleHandle)
var $toggle = $('<div class="toggle btn" data-toggle="toggle">')
.addClass( this.$element.prop('checked') ? this._onstyle : this._offstyle+' off' )
.addClass(size).addClass(this.options.style)
this.$element.wrap($toggle)
$.extend(this, {
$toggle: this.$element.parent(),
$toggleOn: $toggleOn,
$toggleOff: $toggleOff,
$toggleGroup: $toggleGroup
})
this.$toggle.append($toggleGroup)
var width = this.options.width || Math.max($toggleOn.width(), $toggleOff.width())+($toggleHandle.outerWidth()/2)
var height = this.options.height || Math.max($toggleOn.height(), $toggleOff.height())
$toggleOn.addClass('toggle-on')
$toggleOff.addClass('toggle-off')
this.$toggle.css({ width: width, height: height })
if (this.options.height) {
$toggleOn.css('line-height', $toggleOn.height() + 'px')
$toggleOff.css('line-height', $toggleOff.height() + 'px')
}
this.update(true)
this.trigger(true)
}
Toggle.prototype.toggle = function () {
if (this.$element.prop('checked')) this.off()
else this.on()
}
Toggle.prototype.on = function (silent) {
if (this.$element.prop('disabled')) return false
this.$toggle.removeClass(this._offstyle + ' off').addClass(this._onstyle)
this.$element.prop('checked', true)
if (!silent) this.trigger()
}
Toggle.prototype.off = function (silent) {
if (this.$element.prop('disabled')) return false
this.$toggle.removeClass(this._onstyle).addClass(this._offstyle + ' off')
this.$element.prop('checked', false)
if (!silent) this.trigger()
}
Toggle.prototype.enable = function () {
this.$toggle.removeAttr('disabled')
this.$element.prop('disabled', false)
}
Toggle.prototype.disable = function () {
this.$toggle.attr('disabled', 'disabled')
this.$element.prop('disabled', true)
}
Toggle.prototype.update = function (silent) {
if (this.$element.prop('disabled')) this.disable()
else this.enable()
if (this.$element.prop('checked')) this.on(silent)
else this.off(silent)
}
Toggle.prototype.trigger = function (silent) {
this.$element.off('change.bs.toggle')
if (!silent) this.$element.change()
this.$element.on('change.bs.toggle', $.proxy(function() {
this.update()
}, this))
}
Toggle.prototype.destroy = function() {
this.$element.off('change.bs.toggle')
this.$toggleGroup.remove()
this.$element.removeData('bs.toggle')
this.$element.unwrap()
}
// TOGGLE PLUGIN DEFINITION
// ========================
function Plugin(option) {
return this.each(function () {
var $this = $(this)
var data = $this.data('bs.toggle')
var options = typeof option == 'object' && option
if (!data) $this.data('bs.toggle', (data = new Toggle(this, options)))
if (typeof option == 'string' && data[option]) data[option]()
})
}
var old = $.fn.bootstrapToggle
$.fn.bootstrapToggle = Plugin
$.fn.bootstrapToggle.Constructor = Toggle
// TOGGLE NO CONFLICT
// ==================
$.fn.toggle.noConflict = function () {
$.fn.bootstrapToggle = old
return this
}
// TOGGLE DATA-API
// ===============
$(function() {
$('input[type=checkbox][data-toggle^=toggle]').bootstrapToggle()
})
$(document).on('click.bs.toggle', 'div[data-toggle^=toggle]', function(e) {
var $checkbox = $(this).find('input[type=checkbox]')
$checkbox.bootstrapToggle('toggle')
e.preventDefault()
})
}(jQuery);

View file

@ -0,0 +1,28 @@
/*! ========================================================================
* Bootstrap Toggle: bootstrap2-toggle.css v2.2.0
* http://www.bootstraptoggle.com
* ========================================================================
* Copyright 2014 Min Hur, The New York Times Company
* Licensed under MIT
* ======================================================================== */
label.checkbox .toggle,label.checkbox.inline .toggle{margin-left:-20px;margin-right:5px}
.toggle{min-width:40px;height:20px;position:relative;overflow:hidden}
.toggle input[type=checkbox]{display:none}
.toggle-group{position:absolute;width:200%;top:0;bottom:0;left:0;transition:left .35s;-webkit-transition:left .35s;-moz-user-select:none;-webkit-user-select:none}
.toggle.off .toggle-group{left:-100%}
.toggle-on{position:absolute;top:0;bottom:0;left:0;right:50%;margin:0;border:0;border-radius:0}
.toggle-off{position:absolute;top:0;bottom:0;left:50%;right:0;margin:0;border:0;border-radius:0}
.toggle-handle{position:relative;margin:0 auto;padding-top:0;padding-bottom:0;height:100%;width:0;border-width:0 1px}
.toggle-handle.btn-mini{top:-1px}
.toggle.btn{min-width:30px}
.toggle-on.btn{padding-right:24px}
.toggle-off.btn{padding-left:24px}
.toggle.btn-large{min-width:40px}
.toggle-on.btn-large{padding-right:35px}
.toggle-off.btn-large{padding-left:35px}
.toggle.btn-small{min-width:25px}
.toggle-on.btn-small{padding-right:20px}
.toggle-off.btn-small{padding-left:20px}
.toggle.btn-mini{min-width:20px}
.toggle-on.btn-mini{padding-right:12px}
.toggle-off.btn-mini{padding-left:12px}

View file

@ -0,0 +1,9 @@
/*! ========================================================================
* Bootstrap Toggle: bootstrap2-toggle.js v2.2.0
* http://www.bootstraptoggle.com
* ========================================================================
* Copyright 2014 Min Hur, The New York Times Company
* Licensed under MIT
* ======================================================================== */
+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.toggle"),f="object"==typeof b&&b;e||d.data("bs.toggle",e=new c(this,f)),"string"==typeof b&&e[b]&&e[b]()})}var c=function(b,c){this.$element=a(b),this.options=a.extend({},this.defaults(),c),this.render()};c.VERSION="2.2.0",c.DEFAULTS={on:"On",off:"Off",onstyle:"primary",offstyle:"default",size:"normal",style:"",width:null,height:null},c.prototype.defaults=function(){return{on:this.$element.attr("data-on")||c.DEFAULTS.on,off:this.$element.attr("data-off")||c.DEFAULTS.off,onstyle:this.$element.attr("data-onstyle")||c.DEFAULTS.onstyle,offstyle:this.$element.attr("data-offstyle")||c.DEFAULTS.offstyle,size:this.$element.attr("data-size")||c.DEFAULTS.size,style:this.$element.attr("data-style")||c.DEFAULTS.style,width:this.$element.attr("data-width")||c.DEFAULTS.width,height:this.$element.attr("data-height")||c.DEFAULTS.height}},c.prototype.render=function(){this._onstyle="btn-"+this.options.onstyle,this._offstyle="btn-"+this.options.offstyle;var b="large"===this.options.size?"btn-large":"small"===this.options.size?"btn-small":"mini"===this.options.size?"btn-mini":"",c=a('<label class="btn">').html(this.options.on).addClass(this._onstyle+" "+b),d=a('<label class="btn">').html(this.options.off).addClass(this._offstyle+" "+b+" active"),e=a('<span class="toggle-handle btn btn-default">').addClass(b),f=a('<div class="toggle-group">').append(c,d,e),g=a('<div class="toggle btn" data-toggle="toggle">').addClass(this.$element.prop("checked")?this._onstyle:this._offstyle+" off").addClass(b).addClass(this.options.style);this.$element.wrap(g),a.extend(this,{$toggle:this.$element.parent(),$toggleOn:c,$toggleOff:d,$toggleGroup:f}),this.$toggle.append(f);var h=this.options.width||Math.max(c.width(),d.width())+e.outerWidth()/2,i=this.options.height||Math.max(c.height(),d.height());c.addClass("toggle-on"),d.addClass("toggle-off"),this.$toggle.css({width:h,height:i}),this.options.height&&(c.css("line-height",c.height()+"px"),d.css("line-height",d.height()+"px")),this.update(!0),this.trigger(!0)},c.prototype.toggle=function(){this.$element.prop("checked")?this.off():this.on()},c.prototype.on=function(a){return this.$element.prop("disabled")?!1:(this.$toggle.removeClass(this._offstyle+" off").addClass(this._onstyle),this.$element.prop("checked",!0),void(a||this.trigger()))},c.prototype.off=function(a){return this.$element.prop("disabled")?!1:(this.$toggle.removeClass(this._onstyle).addClass(this._offstyle+" off"),this.$element.prop("checked",!1),void(a||this.trigger()))},c.prototype.enable=function(){this.$toggle.removeAttr("disabled"),this.$element.prop("disabled",!1)},c.prototype.disable=function(){this.$toggle.attr("disabled","disabled"),this.$element.prop("disabled",!0)},c.prototype.update=function(a){this.$element.prop("disabled")?this.disable():this.enable(),this.$element.prop("checked")?this.on(a):this.off(a)},c.prototype.trigger=function(b){this.$element.off("change.bs.toggle"),b||this.$element.change(),this.$element.on("change.bs.toggle",a.proxy(function(){this.update()},this))},c.prototype.destroy=function(){this.$element.off("change.bs.toggle"),this.$toggleGroup.remove(),this.$element.removeData("bs.toggle"),this.$element.unwrap()};var d=a.fn.bootstrapToggle;a.fn.bootstrapToggle=b,a.fn.bootstrapToggle.Constructor=c,a.fn.toggle.noConflict=function(){return a.fn.bootstrapToggle=d,this},a(function(){a("input[type=checkbox][data-toggle^=toggle]").bootstrapToggle()}),a(document).on("click.bs.toggle","div[data-toggle^=toggle]",function(b){var c=a(this).find("input[type=checkbox]");c.bootstrapToggle("toggle"),b.preventDefault()})}(jQuery);
//# sourceMappingURL=bootstrap2-toggle.min.js.map

View file

@ -0,0 +1 @@
{"version":3,"file":"bootstrap2-toggle.min.js","sources":["bootstrap2-toggle.js"],"names":["$","Plugin","option","this","each","$this","data","options","Toggle","element","$element","extend","defaults","render","VERSION","DEFAULTS","on","off","onstyle","offstyle","size","style","width","height","prototype","attr","_onstyle","_offstyle","$toggleOn","html","addClass","$toggleOff","$toggleHandle","$toggleGroup","append","$toggle","prop","wrap","parent","Math","max","outerWidth","css","update","trigger","toggle","silent","removeClass","enable","removeAttr","disable","change","proxy","destroy","remove","removeData","unwrap","old","fn","bootstrapToggle","Constructor","noConflict","document","e","$checkbox","find","preventDefault","jQuery"],"mappings":"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"}

View file

@ -0,0 +1,13 @@
{
"browser": true,
"camelcase": true,
"quotmark": "single",
"globals": {
"define": true,
"module": true,
"require": true,
"escape": true
},
"extends": "../.jshintrc"
}

View file

@ -0,0 +1,165 @@
/*!
* JavaScript Cookie v2.1.4
* https://github.com/js-cookie/js-cookie
*
* Copyright 2006, 2015 Klaus Hartl & Fagner Brack
* Released under the MIT license
*/
;(function (factory) {
var registeredInModuleLoader = false;
if (typeof define === 'function' && define.amd) {
define(factory);
registeredInModuleLoader = true;
}
if (typeof exports === 'object') {
module.exports = factory();
registeredInModuleLoader = true;
}
if (!registeredInModuleLoader) {
var OldCookies = window.Cookies;
var api = window.Cookies = factory();
api.noConflict = function () {
window.Cookies = OldCookies;
return api;
};
}
}(function () {
function extend () {
var i = 0;
var result = {};
for (; i < arguments.length; i++) {
var attributes = arguments[ i ];
for (var key in attributes) {
result[key] = attributes[key];
}
}
return result;
}
function init (converter) {
function api (key, value, attributes) {
var result;
if (typeof document === 'undefined') {
return;
}
// Write
if (arguments.length > 1) {
attributes = extend({
path: '/'
}, api.defaults, attributes);
if (typeof attributes.expires === 'number') {
var expires = new Date();
expires.setMilliseconds(expires.getMilliseconds() + attributes.expires * 864e+5);
attributes.expires = expires;
}
// We're using "expires" because "max-age" is not supported by IE
attributes.expires = attributes.expires ? attributes.expires.toUTCString() : '';
try {
result = JSON.stringify(value);
if (/^[\{\[]/.test(result)) {
value = result;
}
} catch (e) {}
if (!converter.write) {
value = encodeURIComponent(String(value))
.replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g, decodeURIComponent);
} else {
value = converter.write(value, key);
}
key = encodeURIComponent(String(key));
key = key.replace(/%(23|24|26|2B|5E|60|7C)/g, decodeURIComponent);
key = key.replace(/[\(\)]/g, escape);
var stringifiedAttributes = '';
for (var attributeName in attributes) {
if (!attributes[attributeName]) {
continue;
}
stringifiedAttributes += '; ' + attributeName;
if (attributes[attributeName] === true) {
continue;
}
stringifiedAttributes += '=' + attributes[attributeName];
}
return (document.cookie = key + '=' + value + stringifiedAttributes);
}
// Read
if (!key) {
result = {};
}
// To prevent the for loop in the first place assign an empty array
// in case there are no cookies at all. Also prevents odd result when
// calling "get()"
var cookies = document.cookie ? document.cookie.split('; ') : [];
var rdecode = /(%[0-9A-Z]{2})+/g;
var i = 0;
for (; i < cookies.length; i++) {
var parts = cookies[i].split('=');
var cookie = parts.slice(1).join('=');
if (cookie.charAt(0) === '"') {
cookie = cookie.slice(1, -1);
}
try {
var name = parts[0].replace(rdecode, decodeURIComponent);
cookie = converter.read ?
converter.read(cookie, name) : converter(cookie, name) ||
cookie.replace(rdecode, decodeURIComponent);
if (this.json) {
try {
cookie = JSON.parse(cookie);
} catch (e) {}
}
if (key === name) {
result = cookie;
break;
}
if (!key) {
result[name] = cookie;
}
} catch (e) {}
}
return result;
}
api.set = api;
api.get = function (key) {
return api.call(api, key);
};
api.getJSON = function () {
return api.apply({
json: true
}, [].slice.call(arguments));
};
api.defaults = {};
api.remove = function (key, attributes) {
api(key, '', extend(attributes, {
expires: -1
}));
};
api.withConverter = init;
return api;
}
return init(function () {});
}));

View file

@ -30,6 +30,7 @@ function clean_name(str) {
$(document).ready(function () {
$('[data-toggle="popover"]').popover();
$('[data-toggle="tooltip"]').tooltip();
});
function changeVideoSrc(vid_obj, fileName) {

View file

@ -8,8 +8,6 @@ if (!User::isAdmin()) {
require_once $global['systemRootPath'] . 'objects/category.php';
require_once $global['systemRootPath'] . 'objects/video.php';
$categories = Category::getAllCategories();
require_once $global['systemRootPath'] . 'objects/configuration.php';
$config = new Configuration();
require_once $global['systemRootPath'] . 'objects/userGroups.php';
$userGroups = UserGroups::getAllUsersGroups();
@ -46,13 +44,11 @@ $userGroups = UserGroups::getAllUsersGroups();
<table id="grid" class="table table-condensed table-hover table-striped">
<thead>
<tr>
<th data-column-id="ad_title" ><?php echo __("Ad Title"); ?></th>
<th data-column-id="title" data-formatter="titleTag" ><?php echo __("Video Title"); ?></th>
<th data-column-id="clicks" data-width="100px"><?php echo __("Clicks"); ?></th>
<th data-column-id="prints" data-width="100px"><?php echo __("Prints"); ?></th>
<th data-column-id="ad_title" ><?php echo __("Ad Title"); ?></th>
<th data-column-id="clicks" data-width="80px"><?php echo __("Clicks"); ?></th>
<th data-column-id="prints" data-width="80px"><?php echo __("Prints"); ?></th>
<th data-column-id="tags" data-formatter="tags" data-sortable="false" data-width="210px"><?php echo __("Tags"); ?></th>
<th data-column-id="duration" data-width="100px"><?php echo __("Duration"); ?></th>
<th data-column-id="created" data-order="desc" data-width="100px"><?php echo __("Created"); ?></th>
<th data-column-id="commands" data-formatter="commands" data-sortable="false" data-width="100px"></th>
</tr>
</thead>
@ -183,13 +179,15 @@ $userGroups = UserGroups::getAllUsersGroups();
tags += '<div class="progress progress-striped active"><div id="downloadProgress' + row.id + '" class="progress-bar" role="progressbar" aria-valuenow="0" aria-valuemin="0" aria-valuemax="100" style="width: 0px"></div></div>';
}
var type;
var type, img;
if (row.type === "audio") {
type = "<span class='fa fa-headphones' style='font-size:14px;'></span> ";
img = "<img class='img img-responsive img-thumbnail pull-left' src='<?php echo $global['webSiteRootURL']; ?>view/img/audio_wave.jpg' style='max-height:80px; margin-right: 5px;'> ";
} else {
type = "<span class='fa fa-film' style='font-size:14px;'></span> ";
img = "<img class='img img-responsive img-thumbnail pull-left' src='<?php echo $global['webSiteRootURL']; ?>videos/"+row.filename+".jpg' style='max-height:80px; margin-right: 5px;'> ";
}
return type + row.title + "<br>" + tags;
return img+type + row.title + "<br>" + tags;
}

View file

@ -6,8 +6,6 @@ if (!User::isAdmin()) {
exit;
}
require_once $global['systemRootPath'] . 'objects/category.php';
require_once $global['systemRootPath'] . 'objects/configuration.php';
$config = new Configuration();
?>
<!DOCTYPE html>
<html lang="<?php echo $_SESSION['language']; ?>">

View file

@ -5,10 +5,6 @@ if (!User::isAdmin()) {
header("Location: {$global['webSiteRootURL']}?error=" . __("You can not manager users"));
exit;
}
require_once $global['systemRootPath'] . 'objects/configuration.php';
$config = new Configuration();
require_once $global['systemRootPath'] . 'objects/userGroups.php';
$userGroups = UserGroups::getAllUsersGroups();
?>

View file

@ -6,8 +6,6 @@ if (!User::isAdmin()) {
exit;
}
require_once $global['systemRootPath'] . 'objects/userGroups.php';
require_once $global['systemRootPath'] . 'objects/configuration.php';
$config = new Configuration();
?>
<!DOCTYPE html>
<html lang="<?php echo $_SESSION['language']; ?>">

View file

@ -8,8 +8,6 @@ if (!User::canUpload()) {
require_once $global['systemRootPath'] . 'objects/category.php';
require_once $global['systemRootPath'] . 'objects/video.php';
$categories = Category::getAllCategories();
require_once $global['systemRootPath'] . 'objects/configuration.php';
$config = new Configuration();
require_once $global['systemRootPath'] . 'objects/userGroups.php';
$userGroups = UserGroups::getAllUsersGroups();

View file

@ -8,10 +8,6 @@ if (!User::canUpload()) {
exit;
}
require_once '../../objects/configuration.php';
$config = new Configuration();
require_once $global['systemRootPath'] . 'objects/configuration.php';
$config = new Configuration();
?>
<!DOCTYPE html>
<html lang="<?php echo $_SESSION['language']; ?>">

View file

@ -1,17 +1,15 @@
<?php
$configFile = dirname(__FILE__).'/../../videos/configuration.php';
require_once $configFile;
require_once $global['systemRootPath'] . 'objects/configuration.php';
require_once $global['systemRootPath'] . 'objects/video.php';
$config = new Configuration();
$videoResolution = $config->getVideo_resolution();
header('Content-Type: application/json');
$videoConverter = array();
//$videoConverter['mp4'] = ' -vf scale=' . $videoResolution . ' -vcodec h264 -acodec aac -strict -2 -y ';
//$videoConverter['webm'] = '-vf scale=' . $videoResolution . ' -f webm -c:v libvpx -b:v 1M -acodec libvorbis -y';
$videoConverter['mp4'] = $config->getFfmpegMp4();
$videoConverter['webm'] = $config->getFfmpegWebm();
$videoConverter['mp4'] = ($config->getEncode_mp4())?$config->getFfmpegMp4():false;
$videoConverter['webm'] = ($config->getEncode_webm())?$config->getFfmpegWebm():false;
$audioConverter = array();
//$audioConverter['mp3'] = ' -acodec libmp3lame -y ';
@ -51,10 +49,11 @@ if ($type == 'audio' || $type == 'mp3' || $type == 'ogg') {
}
} else {
echo "\n {$key} Ok\n";
if ($key == 'mp3') {
if ($key == 'mp3' && $config->getEncode_mp3spectrum()) {
echo "Try FFMPEG Spectrum\n";
$destinationFile = "{$global['systemRootPath']}videos/{$filename}.mp4";
$ffmpeg = "ffmpeg -i {$pathFileName} -filter_complex \"[0:a]showwaves=s=858x480:mode=line,format=yuv420p[v]\" -map \"[v]\" -map 0:a -c:v libx264 -c:a copy {$destinationFile}";
eval('$ffmpeg ="' . $config->getFfmpegSpectrum() . '";');
//$ffmpeg = "ffmpeg -i {$pathFileName} -filter_complex \"[0:a]showwaves=s=858x480:mode=line,format=yuv420p[v]\" -map \"[v]\" -map 0:a -c:v libx264 -c:a copy {$destinationFile}";
$cmd = "rm -f $destinationFile && rm -f {$global['systemRootPath']}videos/{$filename}_progress_mp4.txt && {$ffmpeg}";
echo "** executing command {$cmd}\n";
exec($cmd . " 1> {$global['systemRootPath']}videos/{$filename}_progress_mp4.txt 2>&1", $output, $return_val);
@ -89,7 +88,7 @@ if ($type == 'audio' || $type == 'mp3' || $type == 'ogg') {
foreach ($videoConverter as $key => $value) {
if (!empty($type) && $type != $key) {
if ((!empty($type) && $type != $key) || empty($value)) {
continue;
}
// convert video

View file

@ -39,8 +39,6 @@ foreach ($videos as $key => $value) {
}
$total = Video::getTotalVideos("viewableNotAd");
$totalPages = ceil($total / $_POST['rowCount']);
require_once $global['systemRootPath'] . 'objects/configuration.php';
$config = new Configuration();
?>
<!DOCTYPE html>
<html lang="<?php echo $_SESSION['language']; ?>">

View file

@ -51,9 +51,6 @@ foreach ($videos as $key => $value) {
}
$total = Video::getTotalVideos("viewableNotAd");
$totalPages = ceil($total / $_POST['rowCount']);
require_once $global['systemRootPath'] . 'objects/configuration.php';
$config = new Configuration();
if ($video['type'] !== "audio") {
$poster = "{$global['webSiteRootURL']}videos/{$video['filename']}.jpg";
} else {
@ -179,7 +176,6 @@ if ($video['type'] !== "audio") {
$(this).tooltip("show");
return false;
});
$("#dislikeBtn, #likeBtn").tooltip();
<?php
}
?>
@ -243,7 +239,7 @@ if ($video['type'] !== "audio") {
?>" placeholder="<?php echo __("Share Video"); ?>" id="code-input">
<span class="input-group-btn">
<button class="btn btn-default" type="button" id="code-button"
data-toggle="tooltip" data-placement="button"
data-toggle="tooltip" data-placement="bottom"
title="<?php echo __("Preview"); ?>">
<span class="fa fa-eye"></span> <?php echo __("Preview"); ?>
</button>
@ -465,6 +461,24 @@ if ($video['type'] !== "audio") {
</div>
<div class="col-xs-12 col-sm-4 col-md-4 col-lg-4 bgWhite">
<div class="col-lg-12 col-sm-12 col-xs-12 autoplay">
<strong>
<?php
echo __("Up Next");
?>
</strong>
<span class="pull-right">
<span>
<?php
echo __("Autoplay");
?>
</span>
<span>
<i class="fa fa-info-circle" data-toggle="tooltip" data-placement="bottom" title="<?php echo __("When autoplay is enabled, a suggested video will automatically play next."); ?>"></i>
</span>
<input type="checkbox" data-toggle="toggle" data-size="mini" class="saveCookie" name="autoplay">
</span>
</div>
<div class="col-lg-12 col-sm-12 col-xs-12">
<?php
echo $config->getAdsense();
@ -530,7 +544,25 @@ if ($video['type'] !== "audio") {
<ul class="pages">
</ul>
<script>
$(document).ready(function () {
$(document).ready(function () {
$("input.saveCookie").each(function () {
var mycookie = Cookies.get($(this).attr('name'));
console.log($(this).attr('name'));
console.log(mycookie);
if (mycookie && mycookie == "true") {
$(this).prop('checked', mycookie);
}
});
$("input.saveCookie").change(function () {
console.log($(this).attr('name'));
console.log($(this).prop('checked'));
Cookies.set($(this).attr("name"), $(this).prop('checked'), {
path: '/',
expires: 365
});
});
// Total Itens <?php echo $total; ?>
$('.pages').bootpag({
@ -570,6 +602,7 @@ if ($video['type'] !== "audio") {
</ul>
<script>
$(document).ready(function () {
// Total Itens <?php echo $total; ?>
$('.pages').bootpag({
@ -579,6 +612,7 @@ if ($video['type'] !== "audio") {
}).on('page', function (event, num) {
window.location.replace("<?php echo $global['webSiteRootURL']; ?>page/" + num);
});
});
</script>
</div>

View file

@ -5,9 +5,7 @@ if (!User::isAdmin()) {
header("Location: {$global['webSiteRootURL']}?error=" . __("You can see orphan files"));
exit;
}
require_once $global['systemRootPath'] . 'objects/configuration.php';
require_once $global['systemRootPath'] . 'objects/video.php';
$config = new Configuration();
$videos = Video::getAllVideos();
//$localFiles
$dir = "{$global['systemRootPath']}videos/";

View file

@ -1,8 +1,6 @@
<?php
require_once '../videos/configuration.php';
require_once $global['systemRootPath'] . 'objects/user.php';
require_once $global['systemRootPath'] . 'objects/configuration.php';
$config = new Configuration();
?>
<!DOCTYPE html>
<html lang="<?php echo $_SESSION['language']; ?>">

View file

@ -1,8 +1,6 @@
<?php
require_once '../videos/configuration.php';
require_once $global['systemRootPath'] . 'objects/user.php';
require_once $global['systemRootPath'] . 'objects/configuration.php';
$config = new Configuration();
$tags = User::getTags(User::getId());
$tagsStr = "";

View file

@ -10,8 +10,6 @@ require_once $global['systemRootPath'] . 'objects/video_statistic.php';
VideoStatistic::save($video['id']);
$obj = new Video("", "", $video['id']);
$resp = $obj->addView();
require_once $global['systemRootPath'] . 'objects/configuration.php';
$config = new Configuration();
?>
<!DOCTYPE html>
<html lang="<?php echo $_SESSION['language']; ?>">