1
0
Fork 0
mirror of https://github.com/DanielnetoDotCom/YouPHPTube synced 2025-10-03 09:49:28 +02:00
Improves PHP code style normalisation to reduce inconsistency, refactors
and simplifies some PHP code, slightly beautifies some CSS code.
This commit is contained in:
Caleb Mazalevskis 2017-09-16 16:40:55 +08:00
parent a6ad438fc5
commit 40ecbd28d4
93 changed files with 986 additions and 1056 deletions

View file

@ -1,5 +1,5 @@
<?php
if(empty($config)){
if (empty($config)) {
return true;
}
if (empty($_SESSION['language'])) {
@ -39,7 +39,7 @@ function getEnabledLangs() {
global $global;
$dir = "{$global['systemRootPath']}locale";
$flags = array();
if(empty($global['dont_show_us_flag'])){
if (empty($global['dont_show_us_flag'])) {
$flags[] = 'us';
}
if ($handle = opendir($dir)) {
@ -56,5 +56,7 @@ function getEnabledLangs() {
function textToLink($string) {
return preg_replace(
"~[[:alpha:]]+://[^<>[:space:]'\"]+[[:alnum:]/]~", "<a href=\"\\0\">\\0</a>", $string);
"~[[:alpha:]]+://[^<>[:space:]'\"]+[[:alnum:]/]~", "<a href=\"\\0\">\\0</a>",
$string
);
}

View file

@ -1,7 +1,6 @@
<?php
abstract class Object{
abstract static protected function getTableName();
abstract static protected function getSearchFieldsNames();
private $fieldsName = array();
@ -16,14 +15,13 @@ abstract class Object{
return true;
}
function __construct($id) {
if (!empty($id)) {
// get data from id
$this->load($id);
}
}
static protected function getFromDb($id) {
global $global;
$id = intval($id);
@ -36,13 +34,13 @@ abstract class Object{
}
return $user;
}
static function getAll() {
global $global;
$sql = "SELECT * FROM ".static::getTableName()." WHERE 1=1 ";
$sql .= self::getSqlFromPost();
$res = $global['mysqli']->query($sql);
$rows = array();
if ($res) {
@ -54,10 +52,9 @@ abstract class Object{
}
return $rows;
}
static function getTotal() {
//will receive
//will receive
//current=1&rowCount=10&sort[sender]=asc&searchPhrase=
global $global;
$sql = "SELECT id FROM ".static::getTableName()." WHERE 1=1 ";
@ -70,82 +67,82 @@ abstract class Object{
return $res->num_rows;
}
static function getSqlFromPost() {
$sql = self::getSqlSearchFromPost();
if(!empty($_POST['sort'])){
if (!empty($_POST['sort'])) {
$orderBy = array();
foreach ($_POST['sort'] as $key => $value) {
$orderBy[] = " {$key} {$value} ";
}
$sql .= " ORDER BY ".implode(",", $orderBy);
}else{
} else {
//$sql .= " ORDER BY CREATED DESC ";
}
if(!empty($_POST['rowCount']) && !empty($_POST['current']) && $_POST['rowCount']>0){
if (!empty($_POST['rowCount']) && !empty($_POST['current']) && $_POST['rowCount']>0) {
$current = ($_POST['current']-1)*$_POST['rowCount'];
$sql .= " LIMIT $current, {$_POST['rowCount']} ";
}else{
} else {
$_POST['current'] = 0;
$_POST['rowCount'] = 0;
$sql .= " LIMIT 12 ";
}
return $sql;
}
static function getSqlSearchFromPost() {
$sql = "";
if(!empty($_POST['searchPhrase'])){
if (!empty($_POST['searchPhrase'])) {
$_GET['q'] = $_POST['searchPhrase'];
}
if(!empty($_GET['q'])){
if (!empty($_GET['q'])) {
global $global;
$search = $global['mysqli']->real_escape_string($_GET['q']);
$like = array();
$searchFields = static::getSearchFieldsNames();
foreach ($searchFields as $value) {
$like[] = " {$value} LIKE '%{$search}%' ";
}
if(!empty($like)){
$sql .= " AND (". implode(" OR ", $like).")";
$sql .= " AND (". implode(" OR ", $like).")";
}else{
$sql .= " AND 1=1 ";
}
}
return $sql;
}
function save(){
function save() {
global $global;
$fieldsName = $this->getAllFields();
if (!empty($this->id)) {
$sql = "UPDATE ".static::getTableName()." SET ";
$fields = array();
foreach ($fieldsName as $value) {
if(strtolower($value) == 'created' ){
if (strtolower($value) == 'created') {
// do nothing
}else if(strtolower($value) == 'modified' ){
} elseif (strtolower($value) == 'modified') {
$fields[] = " {$value} = now() ";
}else {
} else {
$fields[] = " {$value} = '{$this->$value}' ";
}
}
}
$sql .= implode(", ", $fields);
$sql .= " WHERE id = {$this->id}";
} else {
$sql = "INSERT INTO ".static::getTableName()." ( ";
$sql .= implode(",", $fieldsName). " )";
$sql .= implode(",", $fieldsName). " )";
$fields = array();
foreach ($fieldsName as $value) {
if(strtolower($value) == 'created' || strtolower($value) == 'modified' ){
if (strtolower($value) == 'created' || strtolower($value) == 'modified') {
$fields[] = " now() ";
}else if(!isset($this->$value)){
} elseif (!isset($this->$value)) {
$fields[] = " NULL ";
}else{
} else {
$fields[] = " '{$this->$value}' ";
}
}
@ -153,7 +150,7 @@ abstract class Object{
}
//echo $sql;
$insert_row = $global['mysqli']->query($sql);
if ($insert_row) {
if (empty($this->id)) {
$id = $global['mysqli']->insert_id;
@ -165,11 +162,11 @@ abstract class Object{
die($sql . ' Error : (' . $global['mysqli']->errno . ') ' . $global['mysqli']->error);
}
}
private function getAllFields(){
private function getAllFields() {
global $global, $mysqlDatabase;
$sql = "SELECT COLUMN_NAME FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_SCHEMA = '{$mysqlDatabase}' AND TABLE_NAME = '".static::getTableName()."'";
$res = $global['mysqli']->query($sql);
$rows = array();
if ($res) {
@ -182,4 +179,3 @@ abstract class Object{
return $rows;
}
}

View file

@ -1,20 +1,19 @@
<?php
class BootGrid {
static function getSqlFromPost($searchFieldsNames = array(), $keyPrefix = "") {
$sql = self::getSqlSearchFromPost($searchFieldsNames);
if(!empty($_POST['sort'])){
if (!empty($_POST['sort'])) {
$orderBy = array();
foreach ($_POST['sort'] as $key => $value) {
$orderBy[] = " {$keyPrefix}{$key} {$value} ";
}
$sql .= " ORDER BY ".implode(",", $orderBy);
}else{
} else {
//$sql .= " ORDER BY CREATED DESC ";
}
if(!empty($_POST['rowCount']) && !empty($_POST['current']) && $_POST['rowCount']>0){
$current = ($_POST['current']-1)*$_POST['rowCount'];
$sql .= " LIMIT $current, {$_POST['rowCount']} ";
@ -24,27 +23,25 @@ class BootGrid {
}
return $sql;
}
static function getSqlSearchFromPost($searchFieldsNames = array()) {
$sql = "";
if(!empty($_POST['searchPhrase'])){
global $global;
$search = $global['mysqli']->real_escape_string($_POST['searchPhrase']);
$like = array();
foreach ($searchFieldsNames as $value) {
$like[] = " {$value} LIKE '%{$search}%' ";
}
if(!empty($like)){
$sql .= " AND (". implode(" OR ", $like).")";
$sql .= " AND (". implode(" OR ", $like).")";
}else{
$sql .= " AND 1=1 ";
}
}
return $sql;
}
}

View file

@ -1,12 +1,11 @@
<?php
if(empty($global['systemRootPath'])){
$global['systemRootPath'] = "../";
if (empty($global['systemRootPath'])) {
$global['systemRootPath'] = '../';
}
require_once $global['systemRootPath'].'videos/configuration.php';
require_once $global['systemRootPath'] . 'videos/configuration.php';
class Captcha{
private $largura, $altura, $tamanho_fonte, $quantidade_letras;
function __construct($largura, $altura, $tamanho_fonte, $quantidade_letras) {
if (session_status() == PHP_SESSION_NONE) {
session_start();
@ -17,37 +16,41 @@ class Captcha{
$this->quantidade_letras = $quantidade_letras;
}
public function getCaptchaImage(){
public function getCaptchaImage() {
global $global;
header("Content-type: image/jpeg");
header('Content-type: image/jpeg');
$imagem = imagecreate($this->largura,$this->altura); // define a largura e a altura da imagem
$fonte = $global['systemRootPath'] . "objects/monof55.ttf"; //voce deve ter essa ou outra fonte de sua preferencia em sua pasta
$preto = imagecolorallocate($imagem,0,0,0); // define a cor preta
$branco = imagecolorallocate($imagem,255,255,255); // define a cor branca
$fonte = $global['systemRootPath'] . 'objects/monof55.ttf'; //voce deve ter essa ou outra fonte de sua preferencia em sua pasta
$preto = imagecolorallocate($imagem, 0, 0, 0); // define a cor preta
$branco = imagecolorallocate($imagem, 255, 255, 255); // define a cor branca
// define a palavra conforme a quantidade de letras definidas no parametro $quantidade_letras
//$letters = "AaBbCcDdEeFfGgHhIiJjKkLlMmNnPpQqRrSsTtUuVvYyXxWwZz23456789";
$letters = "AaBbCcDdEeFfGgHhIiJjKkLlMmNnPpQqRrSsTtUuVvYyXxWwZz23456789";
$palavra = substr(str_shuffle($letters),0,($this->quantidade_letras));
//$letters = 'AaBbCcDdEeFfGgHhIiJjKkLlMmNnPpQqRrSsTtUuVvYyXxWwZz23456789';
$letters = 'AaBbCcDdEeFfGgHhIiJjKkLlMmNnPpQqRrSsTtUuVvYyXxWwZz23456789';
$palavra = substr(str_shuffle($letters), 0, ($this->quantidade_letras));
$_SESSION["palavra"] = $palavra; // atribui para a sessao a palavra gerada
for($i = 1; $i <= $this->quantidade_letras; $i++){
imagettftext($imagem,$this->tamanho_fonte,rand(-10,10),($this->tamanho_fonte*$i),($this->tamanho_fonte + 10),$branco,$fonte,substr($palavra,($i-1),1)); // atribui as letras a imagem
for ($i = 1; $i <= $this->quantidade_letras; $i++) {
imagettftext(
$imagem,
$this->tamanho_fonte,
rand(-10, 10),
($this->tamanho_fonte*$i),
($this->tamanho_fonte + 10),
$branco,
$fonte,
substr($palavra, ($i - 1), 1)
); // atribui as letras a imagem
}
imagejpeg($imagem); // gera a imagem
imagedestroy($imagem); // limpa a imagem da memoria
}
static public function validation($word){
static public function validation($word) {
if (session_status() == PHP_SESSION_NONE) {
session_start();
}
if (strcasecmp($word, $_SESSION["palavra"])==0){
return true;
}else{
return false;
}
}
}
return (strcasecmp($word, $_SESSION["palavra"]) == 0);
}
}

View file

@ -1,5 +1,4 @@
<?php
require_once 'category.php';
header('Content-Type: application/json');
$categories = Category::getAllCategories();
@ -7,4 +6,4 @@ $total = Category::getTotalCategories();
foreach ($categories as $key => $value) {
$categories[$key]['iconHtml'] = "<span class='$value[iconClass]'></span>";
}
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,7 +1,6 @@
<?php
if (empty($global['systemRootPath'])) {
$global['systemRootPath'] = "../";
$global['systemRootPath'] = '../';
}
require_once $global['systemRootPath'] . 'videos/configuration.php';
require_once $global['systemRootPath'] . 'objects/bootGrid.php';
@ -23,7 +22,7 @@ class Category {
$this->clean_name = $clean_name;
}
function __construct($id, $name = "") {
function __construct($id, $name = '') {
if (empty($id)) {
// get the category data from category and pass
$this->name = $name;
@ -87,12 +86,7 @@ class Category {
$id = intval($id);
$sql = "SELECT * FROM categories WHERE id = $id LIMIT 1";
$res = $global['mysqli']->query($sql);
if ($res) {
$category = $res->fetch_assoc();
} else {
$category = false;
}
return $category;
return ($res) ? $res->fetch_assoc() : false;
}
static function getAllCategories() {
@ -118,12 +112,10 @@ class Category {
static function getTotalCategories() {
global $global;
$sql = "SELECT id FROM categories WHERE 1=1 ";
$sql .= BootGrid::getSqlSearchFromPost(array('name'));
$res = $global['mysqli']->query($sql);
return $res->num_rows;
}

View file

@ -1,10 +1,9 @@
<?php
header('Content-Type: application/json');
if(empty($global['systemRootPath'])){
$global['systemRootPath'] = "../";
if (empty($global['systemRootPath'])) {
$global['systemRootPath'] = '../';
}
require_once $global['systemRootPath'].'videos/configuration.php';
require_once $global['systemRootPath'] . 'videos/configuration.php';
require_once $global['systemRootPath'] . 'objects/user.php';
if (!User::isAdmin()) {
die('{"error":"'.__("Permission denied").'"}');
@ -15,4 +14,4 @@ $obj = new Category(@$_POST['id']);
$obj->setName($_POST['name']);
$obj->setClean_name($_POST['clean_name']);
$obj->setIconClass($_POST['iconClass']);
echo '{"status":"'.$obj->save().'"}';
echo '{"status":"'.$obj->save().'"}';

View file

@ -1,7 +1,7 @@
<?php
header('Content-Type: application/json');
if(empty($global['systemRootPath'])){
$global['systemRootPath'] = "../";
if (empty($global['systemRootPath'])) {
$global['systemRootPath'] = '../';
}
require_once $global['systemRootPath'].'videos/configuration.php';
require_once $global['systemRootPath'] . 'objects/user.php';

View file

@ -1,30 +1,30 @@
<?php
if(empty($global['systemRootPath'])){
$global['systemRootPath'] = "../";
if (empty($global['systemRootPath'])) {
$global['systemRootPath'] = '../';
}
require_once $global['systemRootPath'].'videos/configuration.php';
require_once $global['systemRootPath'].'objects/bootGrid.php';
require_once $global['systemRootPath'].'objects/user.php';
class Comment{
require_once $global['systemRootPath'] . 'videos/configuration.php';
require_once $global['systemRootPath'] . 'objects/bootGrid.php';
require_once $global['systemRootPath'] . 'objects/user.php';
class Comment {
private $id;
private $comment;
private $videos_id;
private $users_id;
function __construct($comment, $videos_id, $id=0) {
if(empty($id)){
function __construct($comment, $videos_id, $id = 0) {
if (empty($id)) {
// get the comment data from comment
$this->comment = $comment;
$this->videos_id = $videos_id;
$this->users_id = User::getId();
}else{
} else {
// get data from id
$this->load($id);
}
}
private function load($id){
private function load($id) {
$comment = $this->getComment($id);
$this->id = $comment['id'];
$this->comment = $comment['comment'];
@ -32,7 +32,7 @@ class Comment{
$this->users_id = $comment['user_id'];
}
function save(){
function save() {
global $global;
if(!User::isLogged()){
header('Content-Type: application/json');
@ -40,11 +40,11 @@ class Comment{
}
$this->comment = htmlentities($this->comment);
$this->comment = $global['mysqli']->real_escape_string($this->comment);
if(!empty($this->id)){
if (!empty($this->id)) {
$sql = "UPDATE comments SET comment = '{$this->comment}', modified = now() WHERE id = {$this->id}";
}else{
} else {
$id = User::getId();
$sql = "INSERT INTO comments ( comment,users_id, videos_id, created, modified) VALUES ('{$this->comment}', {$id}, {$this->videos_id}, now(), now())";
$sql = "INSERT INTO comments ( comment,users_id, videos_id, created, modified) VALUES ('{$this->comment}', {$id}, {$this->videos_id}, now(), now())";
}
$resp = $global['mysqli']->query($sql);
if(empty($resp)){
@ -52,49 +52,44 @@ class Comment{
}
return $resp;
}
function delete(){
function delete() {
if(!User::isAdmin()){
return false;
}
global $global;
if(!empty($this->id)){
if (!empty($this->id)) {
$sql = "DELETE FROM comments WHERE id = {$this->id}";
}else{
} else {
return false;
}
$resp = $global['mysqli']->query($sql);
if(empty($resp)){
if (empty($resp)) {
die('Error : (' . $global['mysqli']->errno . ') ' . $global['mysqli']->error);
}
return $resp;
}
}
private function getComment($id) {
global $global;
$id = intval($id);
$sql = "SELECT * FROM comments WHERE id = $id LIMIT 1";
$res = $global['mysqli']->query($sql);
if ($res) {
$comment = $res->fetch_assoc();
} else {
$comment = false;
}
return $comment;
return ($res) ? $res->fetch_assoc() : false;
}
static function getAllComments($videoId=0){
static function getAllComments($videoId = 0) {
global $global;
$sql = "SELECT c.*, u.name as name, u.user as user FROM comments c LEFT JOIN users as u ON u.id = users_id WHERE 1=1 ";
if(!empty($videoId)){
if (!empty($videoId)) {
$sql .= " AND videos_id = {$videoId} ";
}
$sql .= BootGrid::getSqlFromPost(array('name'));
$res = $global['mysqli']->query($sql);
$comment = array();
if ($res) {
@ -108,22 +103,19 @@ class Comment{
}
return $comment;
}
static function getTotalComments($videoId=0){
static function getTotalComments($videoId = 0) {
global $global;
$sql = "SELECT id FROM comments WHERE 1=1 ";
if(!empty($videoId)){
if (!empty($videoId)) {
$sql .= " AND videos_id = {$videoId} ";
}
$sql .= BootGrid::getSqlSearchFromPost(array('name'));
$res = $global['mysqli']->query($sql);
return $res->num_rows;
}
}
}

View file

@ -1,9 +1,9 @@
<?php
header('Content-Type: application/json');
if(empty($global['systemRootPath'])){
$global['systemRootPath'] = "../";
if (empty($global['systemRootPath'])) {
$global['systemRootPath'] = '../';
}
require_once $global['systemRootPath'].'videos/configuration.php';
require_once $global['systemRootPath'] . 'videos/configuration.php';
require_once $global['systemRootPath'] . 'objects/user.php';
if (!User::canComment()) {
die('{"error":"'.__("Permission denied").'"}');
@ -11,4 +11,4 @@ if (!User::canComment()) {
require_once 'comment.php';
$obj = new Comment($_POST['comment'], $_POST['video']);
echo '{"status":"'.$obj->save().'"}';
echo '{"status":"'.$obj->save().'"}';

View file

@ -11,5 +11,4 @@ foreach ($comments as $key => $value) {
$comments[$key]['comment'] = '<div class="pull-left"><img src="'.User::getPhoto($value['users_id']).'" alt="" class="img img-responsive img-circle" style="max-width: 50px;"/></div><div class="commentDetails"><div class="commenterName"><strong>'.$name.'</strong> <small>'.humanTiming(strtotime($value['created'])).'</small></div>'. nl2br(textToLink($value['comment'])).'</div>';
}
echo '{ "current": '.$_POST['current'].',"rowCount": '.$_POST['rowCount'].', "total": '.$total.', "rows":'. json_encode($comments).'}';

View file

@ -1,7 +1,6 @@
<?php
if (empty($global['systemRootPath'])) {
$global['systemRootPath'] = "../";
$global['systemRootPath'] = '../';
}
require_once $global['systemRootPath'] . 'videos/configuration.php';
require_once $global['systemRootPath'] . 'objects/user.php';
@ -33,10 +32,10 @@ class Configuration {
private $disable_analytics;
private $session_timeout;
private $autoplay;
// version 3.1
private $theme;
//version 3.3
private $smtp;
private $smtpAuth;
@ -45,7 +44,7 @@ class Configuration {
private $smtpUsername;
private $smtpPassword;
private $smtpPort;
// version 4
private $encoderURL;
@ -347,7 +346,7 @@ require_once \$global['systemRootPath'].'objects/include_config.php';
fwrite($fp, $content);
fclose($fp);
}
function getTheme() {
if(empty($this->theme)){
return "default";

View file

@ -2,7 +2,7 @@
header('Content-Type: application/json');
if (empty($global['systemRootPath'])) {
$global['systemRootPath'] = "../";
$global['systemRootPath'] = '../';
}
require_once $global['systemRootPath'] . 'objects/user.php';
if (!User::isAdmin()) {

View file

@ -1,5 +1,4 @@
<?php
// Returns a file size limit in bytes based on the PHP upload_max_filesize
// and post_max_size
function file_upload_max_size() {
@ -280,7 +279,7 @@ function parseDurationToSeconds($str) {
}
/**
*
*
* @global type $global
* @param type $mail
* call it before send mail to let YouPHPTube decide the method

View file

@ -1,11 +1,10 @@
<?php
require_once 'captcha.php';
$largura = empty($_GET["l"])?120:$_GET["l"]; // recebe a largura
$altura = empty($_GET["a"])?40:$_GET["a"]; // recebe a altura
$tamanho_fonte = empty($_GET["tf"])?18:$_GET["tf"]; // recebe o tamanho da fonte
$quantidade_letras = empty($_GET["ql"])?5:$_GET["ql"]; // recebe a quantidade de letras que o captcha terá
$capcha = new Captcha($largura, $altura, $tamanho_fonte, $quantidade_letras);
$capcha->getCaptchaImage();
?>
require_once 'captcha.php';
$largura = empty($_GET['l']) ? 120 : $_GET['l']; // recebe a largura
$altura = empty($_GET['a']) ? 40 : $_GET['a']; // recebe a altura
$tamanho_fonte = empty($_GET['tf']) ? 18 : $_GET['tf']; // recebe o tamanho da fonte
$quantidade_letras = empty($_GET['ql']) ? 5 : $_GET['ql']; // recebe a quantidade de letras que o captcha terá
$capcha = new Captcha($largura, $altura, $tamanho_fonte, $quantidade_letras);
$capcha->getCaptchaImage();

View file

@ -3,7 +3,6 @@ ini_set('error_log', $global['systemRootPath'].'videos/youphptube.log');
global $global;
global $config;
$global['mysqli'] = new mysqli($mysqlHost, $mysqlUser,$mysqlPass,$mysqlDatabase,@$mysqlPort);
$now = new DateTime();
@ -19,7 +18,7 @@ require_once $global['systemRootPath'] . 'objects/configuration.php';
$config = new Configuration();
// for update config from old versions
if(function_exists("getAllFlags")){
if (function_exists("getAllFlags")) {
Configuration::rewriteConfigFile();
}

View file

@ -3,4 +3,4 @@ require_once 'like.php';
require_once $global['systemRootPath'] . 'objects/user.php';
header('Content-Type: application/json');
$like = new Like($_GET['like'], $_POST['videos_id']);
echo json_encode(Like::getLikes($_POST['videos_id']));
echo json_encode(Like::getLikes($_POST['videos_id']));

View file

@ -1,15 +1,15 @@
<?php
if(empty($global['systemRootPath'])){
$global['systemRootPath'] = "../";
if (empty($global['systemRootPath'])) {
$global['systemRootPath'] = '../';
}
require_once $global['systemRootPath'].'videos/configuration.php';
require_once $global['systemRootPath'].'objects/user.php';
class Like{
class Like {
private $id;
private $like;
private $videos_id;
private $users_id;
function __construct($like, $videos_id) {
if(!User::isLogged()){
header('Content-Type: application/json');
@ -19,13 +19,13 @@ class Like{
$this->users_id = User::getId();
$this->load();
// if click again in the same vote, remove the vote
if($this->like == $like){
if ($this->like == $like) {
$like = 0;
}
$this->setLike($like);
$this->save();
}
private function setLike($like) {
$like = intval($like);
if(!in_array($like, array(0,1,-1))){
@ -33,92 +33,86 @@ class Like{
}
$this->like = $like;
}
private function load(){
private function load() {
$like = $this->getLike();
if (empty($like))
if (empty($like)) {
return false;
}
foreach ($like as $key => $value) {
$this->$key = $value;
}
}
private function getLike() {
global $global;
if(empty($this->users_id) || empty($this->videos_id)){
if (empty($this->users_id) || empty($this->videos_id)) {
header('Content-Type: application/json');
die('{"error":"You must have user and videos set to get a like"}');
}
$sql = "SELECT * FROM likes WHERE users_id = $this->users_id AND videos_id = $this->videos_id LIMIT 1";
$res = $global['mysqli']->query($sql);
if ($res) {
return $res->fetch_assoc();
} else {
return false;
}
return ($res) ? $res->fetch_assoc() : false;
}
private function save(){
private function save() {
global $global;
if(!User::isLogged()){
header('Content-Type: application/json');
die('{"error":"'.__("Permission denied").'"}');
}
if(!empty($this->id)){
if (!empty($this->id)) {
$sql = "UPDATE likes SET `like` = '{$this->like}', modified = now() WHERE id = {$this->id}";
}else{
$sql = "INSERT INTO likes ( `like`,users_id, videos_id, created, modified) VALUES ('{$this->like}', {$this->users_id}, {$this->videos_id}, now(), now())";
} else {
$sql = "INSERT INTO likes ( `like`,users_id, videos_id, created, modified) VALUES ('{$this->like}', {$this->users_id}, {$this->videos_id}, now(), now())";
}
//echo $sql;exit;
$resp = $global['mysqli']->query($sql);
if(empty($resp)){
if (empty($resp)) {
die('Error : (' . $global['mysqli']->errno . ') ' . $global['mysqli']->error);
}
return $resp;
}
static function getLikes($videos_id){
}
static function getLikes($videos_id) {
global $global;
$obj = new stdClass();
$obj->videos_id = $videos_id;
$obj->likes = 0;
$obj->dislikes = 0;
$obj->myVote = self::getMyVote($videos_id);
$sql = "SELECT count(*) as total FROM likes WHERE videos_id = {$videos_id} AND `like` = 1 "; // like
$res = $global['mysqli']->query($sql);
if ($res) {
$row = $res->fetch_assoc();
$obj->likes = intval($row['total']);
} else {
die($sql.'\nError : (' . $global['mysqli']->errno . ') ' . $global['mysqli']->error);
if (!$res) {
die($sql . '\nError : (' . $global['mysqli']->errno . ') ' . $global['mysqli']->error);
}
$row = $res->fetch_assoc();
$obj->likes = intval($row['total']);
$sql = "SELECT count(*) as total FROM likes WHERE videos_id = {$videos_id} AND `like` = -1 "; // dislike
$res = $global['mysqli']->query($sql);
if ($res) {
$row = $res->fetch_assoc();
$obj->dislikes = intval($row['total']);
} else {
if (!$res) {
die($sql.'\nError : (' . $global['mysqli']->errno . ') ' . $global['mysqli']->error);
}
$row = $res->fetch_assoc();
$obj->dislikes = intval($row['total']);
return $obj;
}
static function getMyVote($videos_id){
}
static function getMyVote($videos_id) {
global $global;
if(!User::isLogged()){
if (!User::isLogged()) {
return 0;
}
$id = User::getId();
$sql = "SELECT `like` FROM likes WHERE videos_id = {$videos_id} AND users_id = {$id} "; // like
$res = $global['mysqli']->query($sql);
if($row = $res->fetch_assoc()){
if ($row = $res->fetch_assoc()) {
return intval($row['like']);
}else{
return 0;
}
return 0;
}
}
}

View file

@ -1,7 +1,7 @@
<?php
header('Content-Type: application/json');
if (empty($global['systemRootPath'])) {
$global['systemRootPath'] = "../";
$global['systemRootPath'] = '../';
}
require_once $global['systemRootPath'] . 'videos/configuration.php';
require_once $global['systemRootPath'] . 'objects/hybridauth/autoload.php';
@ -34,7 +34,7 @@ if (!empty($_GET['type'])) {
if(empty($id)){
die(sprintf(__("%s ERROR: You must set a ID on config"), $_GET['type']));
}
if(empty($key)){
die(sprintf(__("%s ERROR: You must set a KEY on config"), $_GET['type']));
}
@ -61,18 +61,18 @@ if (!empty($_GET['type'])) {
//print_r($tokens);
//print_r($userProfile);
$user = $userProfile->email;
$name = $userProfile->displayName;
$photoURL = $userProfile->photoURL;
$email = $userProfile->email;
$email = $userProfile->email;
$pass = rand();
User::createUserIfNotExists($user, $pass, $name, $email, $photoURL);
$userObject = new User(0, $user, $pass);
$userObject->login(true);
$adapter->disconnect();
header("Location: {$global['webSiteRootURL']}");
} catch (\Exception $e) {
header("Location: {$global['webSiteRootURL']}user?error=".urlencode($e->getMessage()));
//echo $e->getMessage();

View file

@ -1,8 +1,8 @@
<?php
if(empty($global['systemRootPath'])){
$global['systemRootPath'] = "../";
if (empty($global['systemRootPath'])) {
$global['systemRootPath'] = '../';
}
require_once $global['systemRootPath'].'videos/configuration.php';
require_once $global['systemRootPath'] . 'objects/user.php';
User::logoff();
header("location: {$global['webSiteRootURL']}");
header("location: {$global['webSiteRootURL']}");

View file

@ -1,13 +1,12 @@
<?php
class Main{
class Main {
/**
* receive a YYYY-MM-DD
* @param type $brDate
* @return String dd/mm/yyyy
*/
* receive a YYYY-MM-DD
* @param type $brDate
* @return String dd/mm/yyyy
*/
static public function dateMySQLToBrString($mySqlDate) {
$parts = explode("-", $mySqlDate);
$parts = explode('-', $mySqlDate);
//switch month and day
if (empty($parts[2])) {
return $mySqlDate;
@ -46,4 +45,4 @@ class Main{
return "{$year}-{$parts[1]}-{$parts[0]}{$hour}";
}
}
}
}

View file

@ -2,7 +2,7 @@
require_once '../videos/configuration.php';
require_once $global['systemRootPath'] . 'objects/user.php';
if(!User::canUpload()){
if (!User::canUpload()) {
header("Location: {$global['webSiteRootURL']}?error=" . __("You can not notify"));
exit;
}
@ -40,5 +40,4 @@ if (!$mail->send()) {
$obj->success = __("Message sent");
}
echo json_encode($obj);
echo json_encode($obj);

View file

@ -1,9 +1,9 @@
<?php
header('Content-Type: application/json');
if(empty($global['systemRootPath'])){
$global['systemRootPath'] = "../";
if (empty($global['systemRootPath'])) {
$global['systemRootPath'] = '../';
}
require_once $global['systemRootPath'].'videos/configuration.php';
require_once $global['systemRootPath'] . 'videos/configuration.php';
require_once $global['systemRootPath'] . 'objects/user.php';
require_once $global['systemRootPath'] . 'objects/playlist.php';
if (!User::isLogged()) {
@ -15,4 +15,4 @@ if(empty($obj || User::getId()!=$obj->getUsers_id()) || empty($_POST['videos_id'
return false;
}
echo '{"status":"'.$obj->addVideo($_POST['videos_id'], $_POST['add']).'"}';
echo '{"status":"'.$obj->addVideo($_POST['videos_id'], $_POST['add']).'"}';

View file

@ -1,7 +1,6 @@
<?php
if (empty($global['systemRootPath'])) {
$global['systemRootPath'] = "../";
$global['systemRootPath'] = '../';
}
require_once $global['systemRootPath'] . 'videos/configuration.php';
require_once $global['systemRootPath'] . 'objects/user.php';
@ -19,7 +18,7 @@ class PlayList extends Object {
}
/**
*
*
* @global type $global
* @param type $publicOnly
* @param type $userId if not present check session
@ -49,7 +48,7 @@ class PlayList extends Object {
}
return $rows;
}
static function getVideosFromPlaylist($playlists_id) {
global $global;
$sql = "SELECT * FROM playlists_has_videos "
@ -67,7 +66,7 @@ class PlayList extends Object {
}
return $rows;
}
static function getVideosIdFromPlaylist($playlists_id) {
$videosId = array();
$rows = static::getVideosFromPlaylist($playlists_id);
@ -96,7 +95,7 @@ class PlayList extends Object {
//echo $sql;
return $global['mysqli']->query($sql);
}
public function delete() {
if(empty($this->id)){
return false;

View file

@ -1,19 +1,19 @@
<?php
header('Content-Type: application/json');
if(empty($global['systemRootPath'])){
$global['systemRootPath'] = "../";
if (empty($global['systemRootPath'])) {
$global['systemRootPath'] = '../';
}
require_once $global['systemRootPath'].'videos/configuration.php';
require_once $global['systemRootPath'] . 'videos/configuration.php';
require_once $global['systemRootPath'] . 'objects/user.php';
require_once $global['systemRootPath'] . 'objects/playlist.php';
if (!User::isLogged()) {
die('{"error":"'.__("Permission denied").'"}');
}
if(empty($_POST['name'])){
die('{"error":"'.__("Name can't be blank").'"}');
if (empty($_POST['name'])) {
die('{"error":"'.__("Name can't be blank").'"}');
}
$obj = new PlayList(@$_POST['id']);
$obj->setName($_POST['name']);
$obj->setStatus($_POST['status']);
echo '{"status":"'.$obj->save().'"}';
echo '{"status":"'.$obj->save().'"}';

View file

@ -1,9 +1,9 @@
<?php
header('Content-Type: application/json');
if(empty($global['systemRootPath'])){
$global['systemRootPath'] = "../";
if (empty($global['systemRootPath'])) {
$global['systemRootPath'] = '../';
}
require_once $global['systemRootPath'].'videos/configuration.php';
require_once $global['systemRootPath'] . 'videos/configuration.php';
require_once $global['systemRootPath'] . 'objects/user.php';
require_once $global['systemRootPath'] . 'objects/playlist.php';
if (!User::isLogged()) {
@ -14,4 +14,4 @@ if(User::getId() != $obj->getUsers_id()){
die('{"error":"'.__("Permission denied").'"}');
}
echo '{"status":"'.$obj->delete().'"}';
echo '{"status":"'.$obj->delete().'"}';

View file

@ -1,9 +1,9 @@
<?php
header('Content-Type: application/json');
if(empty($global['systemRootPath'])){
$global['systemRootPath'] = "../";
if (empty($global['systemRootPath'])) {
$global['systemRootPath'] = '../';
}
require_once $global['systemRootPath'].'videos/configuration.php';
require_once $global['systemRootPath'] . 'videos/configuration.php';
require_once $global['systemRootPath'] . 'objects/user.php';
require_once $global['systemRootPath'] . 'objects/playlist.php';
if (!User::isLogged()) {
@ -15,4 +15,4 @@ if(User::getId() != $obj->getUsers_id()){
}
$result = $obj->addVideo($_POST['video_id'], false);
echo '{"status":"'.$result.'"}';
echo '{"status":"'.$result.'"}';

View file

@ -1,9 +1,9 @@
<?php
header('Content-Type: application/json');
if(empty($global['systemRootPath'])){
$global['systemRootPath'] = "../";
if (empty($global['systemRootPath'])) {
$global['systemRootPath'] = '../';
}
require_once $global['systemRootPath'].'videos/configuration.php';
require_once $global['systemRootPath'] . 'videos/configuration.php';
require_once $global['systemRootPath'] . 'objects/user.php';
require_once $global['systemRootPath'] . 'objects/playlist.php';
if (!User::isLogged()) {
@ -14,4 +14,4 @@ if(User::getId() != $obj->getUsers_id()){
die('{"error":"'.__("Permission denied").'"}');
}
$obj->setName($_POST['name']);
echo '{"status":"'.$obj->save().'"}';
echo '{"status":"'.$obj->save().'"}';

View file

@ -2,4 +2,4 @@
require_once './playlist.php';
header('Content-Type: application/json');
$row = PlayList::getAllFromUser(User::getId(), false);
echo json_encode($row);
echo json_encode($row);

View file

@ -1,6 +1,6 @@
<?php
if (empty($global['systemRootPath'])) {
$global['systemRootPath'] = "../";
$global['systemRootPath'] = '../';
}
require_once $global['systemRootPath'] . 'videos/configuration.php';
require_once 'functions.php';
@ -10,4 +10,4 @@ $obj->max_file_size = get_max_file_size();
$obj->file_upload_max_size = file_upload_max_size();
$obj->videoStorageLimitMinutes = $global['videoStorageLimitMinutes'];
$obj->currentStorageUsage = getSecondsTotalVideosLength();
echo json_encode($obj);
echo json_encode($obj);

View file

@ -1,19 +1,18 @@
<?php
require_once 'subscribe.php';
header('Content-Type: application/json');
$obj = new stdClass();
$obj->error = "";
$obj->subscribe = "";
if(empty($_POST['email'])){
if (empty($_POST['email'])) {
$obj->error = __("Email can not be blank");
die(json_encode($obj));
}
if(empty($_POST['user_id'])){
if (empty($_POST['user_id'])) {
$obj->error = __("User can not be blank");
die(json_encode($obj));
}
$subscribe = new Subscribe(0, $_POST['email'], $_POST['user_id']);
$subscribe->toggle();
$obj->subscribe = $subscribe->getStatus();
die(json_encode($obj));
die(json_encode($obj));

View file

@ -1,7 +1,6 @@
<?php
if (empty($global['systemRootPath'])) {
$global['systemRootPath'] = "../";
$global['systemRootPath'] = '../';
}
require_once $global['systemRootPath'] . 'videos/configuration.php';
require_once $global['systemRootPath'] . 'objects/bootGrid.php';
@ -149,7 +148,7 @@ class Subscribe {
<div class=\"input-group\">
<input type=\"text\" placeholder=\"E-mail\" class=\"form-control\" id=\"subscribeEmail\">
<span class=\"input-group-btn\">
<button class=\"btn btn-primary\" id=\"subscribeButton2\">" . __("Subscribe") . "</button>
<button class=\"btn btn-primary\" id=\"subscribeButton2\">" . __("Subscribe") . "</button>
</span>
</div>
</div><script>
@ -157,11 +156,11 @@ $(document).ready(function () {
$(\".subscribeButton\").popover({
placement: 'bottom',
trigger: 'manual',
html: true,
html: true,
content: function() {
return $('#popover-content').html();
}
});
});
});
</script>";
$script = "<script>

View file

@ -1,16 +1,15 @@
<?php
require_once 'subscribe.php';
if(!User::isLogged()){
if (!User::isLogged()) {
return false;
}
header('Content-Type: application/json');
$user_id = User::getId();
// if admin bring all subscribers
if(User::isAdmin()){
if (User::isAdmin()) {
$user_id = "";
}
$Subscribes = Subscribe::getAllSubscribes($user_id);
$total = Subscribe::getTotalSubscribes($user_id);
echo '{ "current": '.$_POST['current'].',"rowCount": '.$_POST['rowCount'].', "total": '.$total.', "rows":'. json_encode($Subscribes).'}';
echo '{ "current": '.$_POST['current'].',"rowCount": '.$_POST['rowCount'].', "total": '.$total.', "rows":'. json_encode($Subscribes).'}';

View file

@ -8,7 +8,7 @@ require_once $global['systemRootPath'] . 'objects/video.php';
$obj = new stdClass();
$obj->error = true;
if (!User::canUpload()) {
$obj->msg = "Only logged users can file_dataoad";
$obj->msg = 'Only logged users can file_dataoad';
die(json_encode($obj));
}
header('Content-Type: application/json');
@ -35,4 +35,4 @@ if (isset($_FILES['file_data']) && $_FILES['file_data']['error'] == 0) {
}
$obj->msg = "\$_FILES Error";
$obj->FILES = $_FILES;
die(json_encode($obj));
die(json_encode($obj));

View file

@ -1,7 +1,6 @@
<?php
if (empty($global['systemRootPath'])) {
$global['systemRootPath'] = "../";
$global['systemRootPath'] = '../';
}
require_once $global['systemRootPath'] . 'videos/configuration.php';
require_once $global['systemRootPath'] . 'objects/bootGrid.php';
@ -93,7 +92,7 @@ class User {
return false;
}
}
static function getUserName() {
if (self::isLogged()) {
return $_SESSION['user']['user'];
@ -101,7 +100,7 @@ class User {
return false;
}
}
static function getUserPass() {
if (self::isLogged()) {
return $_SESSION['user']['password'];
@ -109,7 +108,7 @@ class User {
return false;
}
}
function _getName(){
return $this->name;
}
@ -121,11 +120,10 @@ class User {
if (!empty($user)) {
$photo = $user['photoURL'];
}
} else if (self::isLogged()) {
} elseif (self::isLogged()) {
$photo = $_SESSION['user']['photoURL'];
}
if(preg_match("/videos\/userPhoto\/.*/", $photo)){
if (preg_match("/videos\/userPhoto\/.*/", $photo)) {
$photo = $global['webSiteRootURL'].$photo;
}
if (empty($photo)) {
@ -160,14 +158,14 @@ class User {
}
//echo $sql;
$insert_row = $global['mysqli']->query($sql);
if ($insert_row) {
if (empty($this->id)) {
$id = $global['mysqli']->insert_id;
} else {
$id = $this->id;
}
if($updateUserGroups){
if ($updateUserGroups) {
require_once './userGroups.php';
// update the user groups
UserGroups::updateUserGroups($id, $this->userGroups);
@ -240,15 +238,15 @@ class User {
$user = $global['mysqli']->real_escape_string($user);
$sql = "SELECT * FROM users WHERE user = '$user' ";
if($mustBeactive){
if ($mustBeactive) {
$sql .= " AND status = 'a' ";
}
if ($pass !== false) {
if(!$encodedPass || $encodedPass === 'false'){
if (!$encodedPass || $encodedPass === 'false') {
$pass = md5($pass);
}
}
$sql .= " AND password = '$pass' ";
}
$sql .= " LIMIT 1";
@ -344,7 +342,7 @@ class User {
if (!self::isAdmin()) {
return false;
}
//will receive
//will receive
//current=1&rowCount=10&sort[sender]=asc&searchPhrase=
global $global;
$sql = "SELECT * FROM users WHERE 1=1 ";
@ -372,7 +370,7 @@ class User {
if (!self::isAdmin()) {
return false;
}
//will receive
//will receive
//current=1&rowCount=10&sort[sender]=asc&searchPhrase=
global $global;
$sql = "SELECT id FROM users WHERE 1=1 ";
@ -440,13 +438,13 @@ class User {
}
return self::isAdmin();
}
function getUserGroups() {
return $this->userGroups;
}
function setUserGroups($userGroups) {
if(is_array($userGroups)){
if (is_array($userGroups)) {
$this->userGroups = $userGroups;
}
}
@ -460,7 +458,7 @@ class User {
}
/**
*
*
* @param type $user_id
* text
* label Default Primary Success Info Warning Danger
@ -468,30 +466,30 @@ class User {
static function getTags($user_id){
$user = new User($user_id);
$tags = array();
if($user->getIsAdmin()){
if ($user->getIsAdmin()) {
$obj = new stdClass();
$obj->type = "info";
$obj->text = __("Admin");
$tags[] = $obj;
}else{
} else {
$obj = new stdClass();
$obj->type = "default";
$obj->text = __("Regular User");
$tags[] = $obj;
}
if($user->getStatus() == "a"){
if ($user->getStatus() == "a") {
$obj = new stdClass();
$obj->type = "success";
$obj->text = __("Active");
$tags[] = $obj;
}else{
$tags[] = $obj;
} else {
$obj = new stdClass();
$obj->type = "danger";
$obj->text = __("Inactive");
$tags[] = $obj;
}
require_once 'userGroups.php';
$groups = UserGroups::getUserGroups($user_id);
foreach ($groups as $value) {
@ -500,13 +498,13 @@ class User {
$obj->text = $value['group_name'];
$tags[] = $obj;
}
return $tags;
}
function getBackgroundURL() {
if(empty($this->backgroundURL)){
if (empty($this->backgroundURL)) {
$this->backgroundURL = "view/img/background.png";
}
return $this->backgroundURL;
@ -516,6 +514,4 @@ class User {
$this->backgroundURL = strip_tags($backgroundURL);
}
}

View file

@ -1,9 +1,9 @@
<?php
header('Content-Type: application/json');
if(empty($global['systemRootPath'])){
$global['systemRootPath'] = "../";
if (empty($global['systemRootPath'])) {
$global['systemRootPath'] = '../';
}
require_once $global['systemRootPath'].'videos/configuration.php';
require_once $global['systemRootPath'] . 'videos/configuration.php';
require_once $global['systemRootPath'] . 'objects/user.php';
if (!User::isAdmin()) {
die('{"error":"'.__("Permission denied").'"}');
@ -16,4 +16,4 @@ $user->setName($_POST['name']);
$user->setIsAdmin($_POST['isAdmin']);
$user->setStatus($_POST['status']);
$user->setUserGroups($_POST['userGroups']);
echo '{"status":"'.$user->save(true).'"}';
echo '{"status":"'.$user->save(true).'"}';

View file

@ -1,19 +1,19 @@
<?php
header('Content-Type: application/json');
if(empty($global['systemRootPath'])){
$global['systemRootPath'] = "../";
if (empty($global['systemRootPath'])) {
$global['systemRootPath'] = '../';
}
require_once $global['systemRootPath'].'videos/configuration.php';
require_once $global['systemRootPath'] . 'videos/configuration.php';
require_once $global['systemRootPath'] . 'objects/user.php';
// check if user already exists
$userCheck = new User(0, $_POST['user'], false);
$obj = new stdClass();
if(!empty($userCheck->getBdId())){
if (!empty($userCheck->getBdId())) {
$obj->error = __("User already exists");
die(json_encode($obj));
}
if(empty($_POST['user']) || empty($_POST['pass']) || empty($_POST['email']) || empty($_POST['name'])){
if (empty($_POST['user']) || empty($_POST['pass']) || empty($_POST['email']) || empty($_POST['name'])) {
$obj->error = __("You must fill all fields");
die(json_encode($obj));
}
@ -22,4 +22,4 @@ $user->setUser($_POST['user']);
$user->setPassword($_POST['pass']);
$user->setEmail($_POST['email']);
$user->setName($_POST['name']);
echo '{"status":"'.$user->save().'"}';
echo '{"status":"'.$user->save().'"}';

View file

@ -1,13 +1,13 @@
<?php
header('Content-Type: application/json');
if(empty($global['systemRootPath'])){
$global['systemRootPath'] = "../";
if (empty($global['systemRootPath'])) {
$global['systemRootPath'] = '../';
}
require_once $global['systemRootPath'].'videos/configuration.php';
require_once $global['systemRootPath'] . 'videos/configuration.php';
require_once $global['systemRootPath'] . 'objects/user.php';
require_once $global['systemRootPath'] . 'objects/userGroups.php';
if (!User::isAdmin() || empty($_POST['id'])) {
die('{"error":"'.__("Permission denied").'"}');
}
$item = new UserGroups($_POST['id']);
echo '{"status":"'.$item->delete().'"}';
echo '{"status":"'.$item->delete().'"}';

View file

@ -1,5 +1,4 @@
<?php
require_once 'userGroups.php.php';
header('Content-Type: application/json');
$rows = UserGroups::getAllUsersGroups();

View file

@ -1,7 +1,6 @@
<?php
if (empty($global['systemRootPath'])) {
$global['systemRootPath'] = "../";
$global['systemRootPath'] = '../';
}
require_once $global['systemRootPath'] . 'videos/configuration.php';
require_once $global['systemRootPath'] . 'objects/bootGrid.php';
@ -30,7 +29,7 @@ class UserGroups {
$this->$key = $value;
}
}
static private function getUserGroupsDb($id) {
global $global;
$id = intval($id);
@ -126,7 +125,7 @@ class UserGroups {
return $res->num_rows;
}
function getGroup_name() {
return $this->group_name;
}
@ -136,35 +135,35 @@ class UserGroups {
}
// for users
static function updateUserGroups($users_id, $array_groups_id){
if (!User::isAdmin()) {
return false;
}
if(!is_array($array_groups_id)){
if (!is_array($array_groups_id)) {
return false;
}
self::deleteGroupsFromUser($users_id);
global $global;
foreach ($array_groups_id as $value) {
$value = intval($value);
$sql = "INSERT INTO users_has_users_groups ( users_id, users_groups_id) VALUES ({$users_id},{$value})";
//echo $sql;
$global['mysqli']->query($sql);
}
return true;
}
static function getUserGroups($users_id){
}
static function getUserGroups($users_id) {
global $global;
$result = $global['mysqli']->query("SHOW TABLES LIKE 'users_has_users_groups'");
if (empty($result->num_rows)) {
$_GET['error'] = "You need to <a href='{$global['webSiteRootURL']}update'>update your system to ver 2.3</a>";
return array();
}
if(empty($users_id)){
if (empty($users_id)) {
return array();
}
$sql = "SELECT * FROM users_has_users_groups"
@ -182,8 +181,8 @@ class UserGroups {
die($sql . '\nError : (' . $global['mysqli']->errno . ') ' . $global['mysqli']->error);
}
return $arr;
}
}
static private function deleteGroupsFromUser($users_id){
if (!User::isAdmin()) {
return false;
@ -203,39 +202,39 @@ class UserGroups {
}
// for users end
// for videos
static function updateVideoGroups($videos_id, $array_groups_id){
// for videos
static function updateVideoGroups($videos_id, $array_groups_id) {
if (!User::canUpload()) {
return false;
}
if(!is_array($array_groups_id)){
if (!is_array($array_groups_id)) {
return false;
}
self::deleteGroupsFromVideo($videos_id);
global $global;
foreach ($array_groups_id as $value) {
$value = intval($value);
$sql = "INSERT INTO videos_group_view ( videos_id, users_groups_id) VALUES ({$videos_id},{$value})";
$global['mysqli']->query($sql);
}
return true;
}
static function getVideoGroups($videos_id){
}
static function getVideoGroups($videos_id) {
global $global;
//check if table exists if not you need to update
$res = $global['mysqli']->query('select 1 from `videos_group_view` LIMIT 1');
if(!$res){
if(User::isAdmin()){
if (!$res) {
if (User::isAdmin()) {
$_GET['error'] = "You need to Update YouPHPTube to version 2.3 <a href='{$global['webSiteRootURL']}update/'>Click here</a>";
}
return array();
return array();
}
$sql = "SELECT * FROM videos_group_view as v "
. " LEFT JOIN users_groups as ug ON users_groups_id = ug.id WHERE videos_id = $videos_id ";
@ -251,8 +250,8 @@ class UserGroups {
die($sql . '\nError : (' . $global['mysqli']->errno . ') ' . $global['mysqli']->error);
}
return $arr;
}
}
static private function deleteGroupsFromVideo($videos_id){
if (!User::canUpload()) {
return false;

View file

@ -1,10 +1,9 @@
<?php
header('Content-Type: application/json');
if(empty($global['systemRootPath'])){
$global['systemRootPath'] = "../";
if (empty($global['systemRootPath'])) {
$global['systemRootPath'] = '../';
}
require_once $global['systemRootPath'].'videos/configuration.php';
require_once $global['systemRootPath'] . 'videos/configuration.php';
require_once $global['systemRootPath'] . 'objects/user.php';
if (!User::isAdmin()) {
die('{"error":"'.__("Permission denied").'"}');
@ -13,4 +12,4 @@ if (!User::isAdmin()) {
require_once 'userGroups.php';
$obj = new UserGroups(@$_POST['id']);
$obj->setGroup_name($_POST['group_name']);
echo '{"status":"'.$obj->save().'"}';
echo '{"status":"'.$obj->save().'"}';

View file

@ -1,9 +1,9 @@
<?php
header('Content-Type: application/json');
if(empty($global['systemRootPath'])){
$global['systemRootPath'] = "../";
if (empty($global['systemRootPath'])) {
$global['systemRootPath'] = '../';
}
require_once $global['systemRootPath'].'videos/configuration.php';
require_once $global['systemRootPath'] . 'videos/configuration.php';
require_once $global['systemRootPath'] . 'objects/user.php';
if (!User::isAdmin() || empty($_POST['id'])) {
die('{"error":"'.__("Permission denied").'"}');

View file

@ -1,6 +1,6 @@
<?php
if (empty($global['systemRootPath'])) {
$global['systemRootPath'] = "../";
$global['systemRootPath'] = '../';
}
require_once $global['systemRootPath'] . 'videos/configuration.php';
require_once $global['systemRootPath'] . 'objects/user.php';
@ -68,12 +68,12 @@ if (!(!empty($_GET['user']) && !empty($_GET['recoverpass']))) {
<div class="container">
<?php
if($user->getRecoverPass() != $_GET['recoverpass']){
if ($user->getRecoverPass() != $_GET['recoverpass']) {
?>
<div class="alert alert-danger"><?php echo __("The recover pass does not match!"); ?></div>
<?php
}else{
} else {
?>
<form class="well form-horizontal" action=" " method="post" id="recoverPassForm">
<fieldset>
@ -82,7 +82,7 @@ if (!(!empty($_GET['user']) && !empty($_GET['recoverpass']))) {
<legend><?php echo __("Recover password!"); ?></legend>
<div class="form-group">
<label class="col-md-4 control-label"><?php echo __("User"); ?></label>
<label class="col-md-4 control-label"><?php echo __("User"); ?></label>
<div class="col-md-8 inputGroupContainer">
<div class="input-group">
<span class="input-group-addon"><i class="glyphicon glyphicon-lock"></i></span>
@ -91,7 +91,7 @@ if (!(!empty($_GET['user']) && !empty($_GET['recoverpass']))) {
</div>
</div>
<div class="form-group">
<label class="col-md-4 control-label"><?php echo __("Recover Password"); ?></label>
<label class="col-md-4 control-label"><?php echo __("Recover Password"); ?></label>
<div class="col-md-8 inputGroupContainer">
<div class="input-group">
<span class="input-group-addon"><i class="glyphicon glyphicon-lock"></i></span>
@ -99,9 +99,9 @@ if (!(!empty($_GET['user']) && !empty($_GET['recoverpass']))) {
</div>
</div>
</div>
<div class="form-group">
<label class="col-md-4 control-label"><?php echo __("New Password"); ?></label>
<label class="col-md-4 control-label"><?php echo __("New Password"); ?></label>
<div class="col-md-8 inputGroupContainer">
<div class="input-group">
<span class="input-group-addon"><i class="glyphicon glyphicon-lock"></i></span>
@ -111,7 +111,7 @@ if (!(!empty($_GET['user']) && !empty($_GET['recoverpass']))) {
</div>
<div class="form-group">
<label class="col-md-4 control-label"><?php echo __("Confirm New Password"); ?></label>
<label class="col-md-4 control-label"><?php echo __("Confirm New Password"); ?></label>
<div class="col-md-8 inputGroupContainer">
<div class="input-group">
<span class="input-group-addon"><i class="glyphicon glyphicon-lock"></i></span>

View file

@ -1,29 +1,29 @@
<?php
header('Content-Type: application/json');
if (empty($global['systemRootPath'])) {
$global['systemRootPath'] = "../";
$global['systemRootPath'] = '../';
}
require_once $global['systemRootPath'] . 'videos/configuration.php';
require_once $global['systemRootPath'] . 'objects/user.php';
$obj = new stdClass();
if (empty($_POST['user']) || empty($_POST['recoverPassword']) || empty($_POST['newPassword']) || empty($_POST['newPasswordConfirm'])) {
$obj->error = __("There is missing data to recover your password");
$obj->error = __("There is missing data to recover your password");
die(json_encode($obj));
}
$user = new User(0, $_POST['user'], false);
if(empty($user)){
$obj->error = __("User not found");
if (empty($user)) {
$obj->error = __("User not found");
die(json_encode($obj));
}else if($user->getRecoverPass() !== $_POST['recoverPassword']){
$obj->error = __("Recover password does not match");
} elseif ($user->getRecoverPass() !== $_POST['recoverPassword']) {
$obj->error = __("Recover password does not match");
die(json_encode($obj));
}else if($_POST['newPassword']!==$_POST['newPasswordConfirm']){
$obj->error = __("Confirmation password does not match");
} elseif ($_POST['newPassword'] !== $_POST['newPasswordConfirm']) {
$obj->error = __("Confirmation password does not match");
die(json_encode($obj));
}else{
} else {
$user->setPassword($_POST['newPassword']);
$user->setRecoverPass("");
if($user->save()){
if ($user->save()) {
$obj->success = __("Your Password has been set");
die(json_encode($obj));
}

View file

@ -1,7 +1,7 @@
<?php
header('Content-Type: application/json');
if (empty($global['systemRootPath'])) {
$global['systemRootPath'] = "../";
$global['systemRootPath'] = '../';
}
require_once $global['systemRootPath'] . 'videos/configuration.php';
require_once $global['systemRootPath'] . 'objects/user.php';
@ -31,12 +31,12 @@ $fileData = base64DataToImage($_POST['imgBase64']);
$fileName = 'background'. User::getId().'.png';
$photoURL = $imagePath.$fileName;
$bytes = file_put_contents($global['systemRootPath'].$photoURL, $fileData);
if($bytes){
if ($bytes) {
$response = array(
"status" => 'success',
"url" => $global['systemRootPath'].$photoURL
);
}else{
} else {
$response = array(
"status" => 'error',
"msg" => 'We could not save this file',
@ -49,4 +49,3 @@ $user->setBackgroundURL($photoURL);
$user->save();
User::updateSessionInfo();
print json_encode($response);
?>

View file

@ -1,8 +1,7 @@
<?php
header('Content-Type: application/json');
if (empty($global['systemRootPath'])) {
$global['systemRootPath'] = "../";
$global['systemRootPath'] = '../';
}
require_once $global['systemRootPath'] . 'videos/configuration.php';
require_once $global['systemRootPath'] . 'objects/user.php';
@ -32,12 +31,12 @@ $fileData = base64DataToImage($_POST['imgBase64']);
$fileName = 'photo'. User::getId().'.png';
$photoURL = $imagePath.$fileName;
$bytes = file_put_contents($global['systemRootPath'].$photoURL, $fileData);
if($bytes){
if ($bytes) {
$response = array(
"status" => 'success',
"url" => $global['systemRootPath'].$photoURL
);
}else{
} else {
$response = array(
"status" => 'error',
"msg" => 'We could not save this file',
@ -50,4 +49,3 @@ $user->setPhotoURL($photoURL);
$user->save();
User::updateSessionInfo();
print json_encode($response);
?>

View file

@ -1,7 +1,7 @@
<?php
header('Content-Type: application/json');
if(empty($global['systemRootPath'])){
$global['systemRootPath'] = "../";
if (empty($global['systemRootPath'])) {
$global['systemRootPath'] = '../';
}
require_once $global['systemRootPath'].'videos/configuration.php';
require_once $global['systemRootPath'] . 'objects/user.php';
@ -15,4 +15,4 @@ if (User::isAdmin() && !empty($_POST['status'])) {
$user->setStatus($_POST['status']);
}
echo '{"status":"'.$user->save().'"}';
User::updateSessionInfo();
User::updateSessionInfo();

View file

@ -1,12 +1,11 @@
<?php
if(empty($global['systemRootPath'])){
$global['systemRootPath'] = "../";
if (empty($global['systemRootPath'])) {
$global['systemRootPath'] = '../';
}
require_once $global['systemRootPath'].'videos/configuration.php';
require_once $global['systemRootPath'] . 'videos/configuration.php';
require_once $global['systemRootPath'] . 'objects/user.php';
header('Content-Type: application/json');
$users = User::getAllUsers();
$total = User::getTotalUsers();
echo '{ "current": '.$_POST['current'].',"rowCount": '.$_POST['rowCount'].', "total": '.$total.', "rows":'. json_encode($users).'}';
echo '{ "current": '.$_POST['current'].',"rowCount": '.$_POST['rowCount'].', "total": '.$total.', "rows":'. json_encode($users).'}';

View file

@ -1,7 +1,6 @@
<?php
if(empty($global['systemRootPath'])){
$global['systemRootPath'] = "../";
if (empty($global['systemRootPath'])) {
$global['systemRootPath'] = '../';
}
require_once $global['systemRootPath'].'videos/configuration.php';
require_once $global['systemRootPath'] . 'objects/userGroups.php';
@ -9,4 +8,4 @@ header('Content-Type: application/json');
$users = UserGroups::getAllUsersGroups();
$total = UserGroups::getTotalUsersGroups();
echo '{ "current": '.$_POST['current'].',"rowCount": '.$_POST['rowCount'].', "total": '.$total.', "rows":'. json_encode($users).'}';
echo '{ "current": '.$_POST['current'].',"rowCount": '.$_POST['rowCount'].', "total": '.$total.', "rows":'. json_encode($users).'}';

View file

@ -273,10 +273,10 @@ class Video {
$sql .= " AND v.status IN ('" . implode("','", Video::getViewableStatus()) . "')";
if ($status == "viewableNotAd") {
$sql .= " having videoAdsCount = 0 ";
} else if ($status == "viewableAd") {
} elseif ($status == "viewableAd") {
$sql .= " having videoAdsCount > 0 ";
}
} else if (!empty($status)) {
} elseif (!empty($status)) {
$sql .= " AND v.status = '{$status}'";
}
@ -285,16 +285,20 @@ class Video {
}
if (!empty($id)) {
$sql .= " AND v.id = $id ";
} else if (empty($random) && !empty($_GET['videoName'])) {
} elseif (empty($random) && !empty($_GET['videoName'])) {
$sql .= " AND clean_title = '{$_GET['videoName']}' ";
} else if (!empty($random)) {
} elseif (!empty($random)) {
$sql .= " AND v.id != {$random} ";
$sql .= " ORDER BY RAND() ";
} else {
$sql .= " ORDER BY v.Created DESC ";
}
$sql .= " LIMIT 1";
//if(!empty($random))echo "<hr>".$sql;
/*
if (!empty($random)) {
echo '<hr />'.$sql;
}
*/
$res = $global['mysqli']->query($sql);
if ($res) {
require_once 'userGroups.php';
@ -322,7 +326,7 @@ class Video {
}
/**
*
*
* @global type $global
* @param type $status
* @param type $showOnlyLoggedUserVideos you may pass an user ID to filter results
@ -355,15 +359,15 @@ class Video {
$sql .= " AND v.status IN ('" . implode("','", Video::getViewableStatus()) . "')";
if ($status == "viewableNotAd") {
$sql .= " having videoAdsCount = 0 ";
} else if ($status == "viewableAd") {
} elseif ($status == "viewableAd") {
$sql .= " having videoAdsCount > 0 ";
}
} else if (!empty($status)) {
} elseif (!empty($status)) {
$sql .= " AND v.status = '{$status}'";
}
if ($showOnlyLoggedUserVideos === true && !User::isAdmin()) {
$sql .= " AND v.users_id = '" . User::getId() . "'";
} else if (!empty($showOnlyLoggedUserVideos)) {
} elseif (!empty($showOnlyLoggedUserVideos)) {
$sql .= " AND v.users_id = {$showOnlyLoggedUserVideos}";
}
@ -421,15 +425,15 @@ class Video {
$sql .= " AND v.status IN ('" . implode("','", Video::getViewableStatus()) . "')";
if ($status == "viewableNotAd") {
$sql .= " having videoAdsCount = 0 ";
} else if ($status == "viewableAd") {
} elseif ($status == "viewableAd") {
$sql .= " having videoAdsCount > 0 ";
}
} else if (!empty($status)) {
} elseif (!empty($status)) {
$sql .= " AND status = '{$status}'";
}
if ($showOnlyLoggedUserVideos === true && !User::isAdmin()) {
$sql .= " AND v.users_id = '" . User::getId() . "'";
} else if (is_int($showOnlyLoggedUserVideos)) {
} elseif (is_int($showOnlyLoggedUserVideos)) {
$sql .= " AND v.users_id = {$showOnlyLoggedUserVideos}";
}
if (!empty($_GET['catName'])) {
@ -478,7 +482,7 @@ class Video {
if (!empty($content)) {
$object->$value = self::parseProgress($content);
} else {
}
if (!empty($object->$value->progress) && !is_numeric($object->$value->progress)) {
@ -577,7 +581,7 @@ class Video {
exec($cmd);
$cmd = "rm -f {$global['systemRootPath']}videos/{$video['filename']}_progress_{$value}.txt";
exec($cmd);
*
*
*/
$file = "{$global['systemRootPath']}videos/original_{$video['filename']}";
if (file_exists($file)) {
@ -622,28 +626,27 @@ class Video {
return "00:00:00";
} else {
$duration = $durationParts[0];
$durationParts = explode(":", $duration);
if(count($durationParts) == 1){
return "0:00:".static::addZero($durationParts[0]);
}else if(count($durationParts)==2){
return "0:".static::addZero($durationParts[0]).":".static::addZero($durationParts[1]);
$durationParts = explode(':', $duration);
if (count($durationParts) == 1) {
return '0:00:'.static::addZero($durationParts[0]);
} elseif (count($durationParts) == 2) {
return '0:'.static::addZero($durationParts[0]).':'.static::addZero($durationParts[1]);
}
return $duration;
}
}
static private function addZero($str){
if(intval($str) < 10){
return "0".intval($str);
}else{
return $str;
static private function addZero($str) {
if (intval($str) < 10) {
return '0'.intval($str);
}
return $str;
}
static function getItemPropDuration($duration = "") {
static function getItemPropDuration($duration = '') {
$duration = static::getCleanDuration($duration);
$parts = explode(":", $duration);
return "PT" . intval($parts[0]) . "H" . intval($parts[1]) . "M" . intval($parts[2]) . "S";
$parts = explode(':', $duration);
return 'PT' . intval($parts[0]) . 'H' . intval($parts[1]) . 'M' . intval($parts[2]) . 'S';
}
@ -768,7 +771,7 @@ class Video {
}
/**
*
*
* @param type $user_id
* text
* label Default Primary Success Info Warning Danger

View file

@ -1,9 +1,9 @@
<?php
header('Content-Type: application/json');
if(empty($global['systemRootPath'])){
$global['systemRootPath'] = "../";
if (empty($global['systemRootPath'])) {
$global['systemRootPath'] = '../';
}
require_once $global['systemRootPath'].'videos/configuration.php';
require_once $global['systemRootPath'] . 'videos/configuration.php';
require_once $global['systemRootPath'] . 'objects/user.php';
if (!User::canUpload() || empty($_POST['id'])) {
die('{"error":"'.__("Permission denied").'"}');
@ -32,4 +32,4 @@ if ($resp && User::isAdmin() && !empty($_POST['isAd']) && $_POST['isAd']!=='fals
$va->save();
}
echo '{"status":"'.!empty($resp).'", "msg": "'.$msg.'"}';
echo '{"status":"'.!empty($resp).'", "msg": "'.$msg.'"}';

View file

@ -9,4 +9,4 @@ if(empty($obj)){
die("Object not found");
}
$resp = $obj->addView();
echo '{"status":"'.!empty($resp).'"}';
echo '{"status":"'.!empty($resp).'"}';

View file

@ -1,7 +1,7 @@
<?php
header('Content-Type: application/json');
if(empty($global['systemRootPath'])){
$global['systemRootPath'] = "../";
if (empty($global['systemRootPath'])) {
$global['systemRootPath'] = '../';
}
require_once $global['systemRootPath'].'videos/configuration.php';
require_once $global['systemRootPath'] . 'objects/user.php';

View file

@ -1,9 +1,7 @@
<?php
header('Content-Type: application/json');
if (empty($global['systemRootPath'])) {
$global['systemRootPath'] = "../";
$global['systemRootPath'] = '../';
}
require_once $global['systemRootPath'] . 'videos/configuration.php';
require_once $global['systemRootPath'] . 'objects/user.php';
@ -45,4 +43,3 @@ if (file_exists($fileName)) {
$obj2->message = __("The original file for this video does not exists anymore");
echo json_encode($obj2);
}

View file

@ -1,7 +1,7 @@
<?php
header('Content-Type: application/json');
if(empty($global['systemRootPath'])){
$global['systemRootPath'] = "../";
if (empty($global['systemRootPath'])) {
$global['systemRootPath'] = '../';
}
require_once $global['systemRootPath'].'videos/configuration.php';
require_once $global['systemRootPath'] . 'objects/user.php';
@ -36,4 +36,4 @@ if(file_exists($file)){
}
$resp = $obj->save();
$obj->updateDurationIfNeed();
echo '{"status":"'.!empty($resp).'"}';
echo '{"status":"'.!empty($resp).'"}';

View file

@ -1,8 +1,7 @@
<?php
header('Content-Type: application/json');
if(empty($global['systemRootPath'])){
$global['systemRootPath'] = "../";
if (empty($global['systemRootPath'])) {
$global['systemRootPath'] = '../';
}
require_once $global['systemRootPath'] .'videos/configuration.php';
require_once $global['systemRootPath'] . 'objects/user.php';

View file

@ -1,9 +1,9 @@
<?php
header('Content-Type: application/json');
if(empty($global['systemRootPath'])){
$global['systemRootPath'] = "../";
if (empty($global['systemRootPath'])) {
$global['systemRootPath'] = '../';
}
require_once $global['systemRootPath'].'videos/configuration.php';
require_once $global['systemRootPath'] . 'videos/configuration.php';
require_once $global['systemRootPath'] . 'objects/user.php';
if (!User::isAdmin() || empty($_POST['id'])) {
die('{"error":"'.__("Permission denied").'"}');
@ -16,4 +16,4 @@ if(empty($obj)){
}
$obj->setStatus($_POST['status']);
$resp = $obj->save();
echo '{"status":"'.!empty($resp).'"}';
echo '{"status":"'.!empty($resp).'"}';

View file

@ -54,18 +54,18 @@ class Video_ad {
header('Content-Type: application/json');
die('{"error":"' . __("Permission denied") . '"}');
}
if(empty($this->starts)){
$this->starts = date("Y-m-d h:i:s");
if (empty($this->starts)) {
$this->starts = date('Y-m-d h:i:s');
}
if (empty($this->ad_title)) {
return false;
}
if(empty($this->finish)){
if (empty($this->finish)) {
$finish = "NULL";
}else{
} else {
$finish = "'{$this->finish}'";
}
global $global;
if (!empty($this->id)) {
$sql = "UPDATE video_ads SET "
@ -86,7 +86,7 @@ class Video_ad {
. "('{$this->ad_title}','{$this->starts}', {$finish}, '{$this->getSkip_after_seconds()}',"
. "'{$this->redirect}', '{$this->getFinish_max_clicks()}', '{$this->getFinish_max_prints()}', '{$this->videos_id}', '{$this->categories_id}', now(), now())";
}
$insert_row = $global['mysqli']->query($sql);
if ($insert_row) {
@ -288,8 +288,8 @@ class Video_ad {
. " AND (finish IS NULL OR finish = '0000-00-00 00:00:00' OR finish > now()) "
. " AND (finish_max_clicks = 0 OR finish_max_clicks > (SELECT count(*) FROM video_ads_logs as val WHERE val.video_ads_id = va.id AND clicked = 1 )) "
. " AND (finish_max_prints = 0 OR finish_max_prints > (SELECT count(*) FROM video_ads_logs as val WHERE val.video_ads_id = va.id)) ";
$sql .= " LIMIT 1";
//echo $sql;exit;
$res = $global['mysqli']->query($sql);
@ -300,14 +300,14 @@ class Video_ad {
}
return $ad;
}
static function log($id){
global $global;
$userId = empty($_SESSION["user"]["id"]) ? "NULL" : $_SESSION["user"]["id"];
$sql = "INSERT INTO video_ads_logs "
. "(datetime, clicked, ip, video_ads_id, users_id) values "
. "(now(),0, '".getRealIpAddr()."', '{$id}',{$userId})";
$insert_row = $global['mysqli']->query($sql);
if ($insert_row) {
@ -316,11 +316,11 @@ class Video_ad {
die($sql . ' Save Video Ads Log Error : (' . $global['mysqli']->errno . ') ' . $global['mysqli']->error);
}
}
static function clickLog($video_ads_log_id){
global $global;
$sql = "UPDATE video_ads_logs set clicked = 1 WHERE id = {$video_ads_log_id}";
$insert_row = $global['mysqli']->query($sql);
if ($insert_row) {
@ -329,7 +329,7 @@ class Video_ad {
die($sql . ' Save Click Video Ads Log Error : (' . $global['mysqli']->errno . ') ' . $global['mysqli']->error);
}
}
static function redirect($id){
$ad = self::getVideoAds($id);
header("Location: {$ad['redirect']}");

View file

@ -1,10 +1,10 @@
<?php
header('Content-Type: application/json');
if(empty($global['systemRootPath'])){
$global['systemRootPath'] = "../";
if (empty($global['systemRootPath'])) {
$global['systemRootPath'] = '../';
}
require_once $global['systemRootPath'].'videos/configuration.php';
require_once $global['systemRootPath'] . 'videos/configuration.php';
require_once $global['systemRootPath'] . 'objects/user.php';
require 'video_ad.php';
Video_ad::clickLog($_GET['video_ads_logs_id']);
Video_ad::redirect($_GET['adId']);
Video_ad::redirect($_GET['adId']);

View file

@ -1,9 +1,9 @@
<?php
header('Content-Type: application/json');
if(empty($global['systemRootPath'])){
$global['systemRootPath'] = "../";
if (empty($global['systemRootPath'])) {
$global['systemRootPath'] = '../';
}
require_once $global['systemRootPath'].'videos/configuration.php';
require_once $global['systemRootPath'] . 'videos/configuration.php';
require_once $global['systemRootPath'] . 'objects/user.php';
if (!User::isAdmin() || empty($_POST['id'])) {
die('{"error":"'.__("Permission denied").'"}');

View file

@ -6,4 +6,4 @@ header('Content-Type: application/json');
$videos = Video_ad::getAllVideos();
$total = Video_ad::getTotalVideos();
echo '{ "current": '.$_POST['current'].',"rowCount": '.$_POST['rowCount'].', "total": '.$total.', "rows":'. json_encode($videos).'}';
echo '{ "current": '.$_POST['current'].',"rowCount": '.$_POST['rowCount'].', "total": '.$total.', "rows":'. json_encode($videos).'}';

View file

@ -1,15 +1,15 @@
<?php
header('Content-Type: application/json');
if(empty($global['systemRootPath'])){
$global['systemRootPath'] = "../";
if (empty($global['systemRootPath'])) {
$global['systemRootPath'] = '../';
}
require_once $global['systemRootPath'].'videos/configuration.php';
require_once $global['systemRootPath'] . 'videos/configuration.php';
require_once $global['systemRootPath'] . 'objects/user.php';
if (!User::isAdmin() || empty($_POST['id'])) {
die('{"error":"'.__("Permission denied").'"}');
}
require 'video_ad.php';
$va = new Video_ad("", "", "", "", $_POST['id']);
$va = new Video_ad('', '', '', '', $_POST['id']);
$va->setAd_title($_POST["title"]);
$va->setStarts($_POST["starts"]);
$va->setFinish($_POST["finish"]);
@ -19,4 +19,4 @@ $va->setFinish_max_clicks($_POST["clicks"]);
$va->setFinish_max_prints($_POST["prints"]);
$va->setCategories_id($_POST["categories_id"]);
$resp = $va->save();
echo '{"status":"'.!empty($resp).'"}';
echo '{"status":"'.!empty($resp).'"}';

View file

@ -1,7 +1,6 @@
<?php
if (empty($global['systemRootPath'])) {
$global['systemRootPath'] = "../";
$global['systemRootPath'] = '../';
}
require_once $global['systemRootPath'] . 'videos/configuration.php';
require_once $global['systemRootPath'] . 'objects/bootGrid.php';
@ -83,7 +82,7 @@ class VideoStatistic {
$numberOfDays--;
return static::getTotalLastDays($video_id, $numberOfDays, $returnArray);
}
static function getTotalToday($video_id, $hour=0, $returnArray = array()) {
if ($hour >= 24) {
return $returnArray;

View file

@ -4,16 +4,16 @@ require_once 'video.php';
require_once $global['systemRootPath'] . 'objects/functions.php';
header('Content-Type: application/json');
$showOnlyLoggedUserVideos = true;
if(User::isAdmin()){
if (User::isAdmin()) {
$showOnlyLoggedUserVideos = false;
}
$videos = Video::getAllVideos("", $showOnlyLoggedUserVideos, true);
$total = Video::getTotalVideos("", $showOnlyLoggedUserVideos, true);
$videos = Video::getAllVideos('', $showOnlyLoggedUserVideos, true);
$total = Video::getTotalVideos('', $showOnlyLoggedUserVideos, true);
foreach ($videos as $key => $value) {
$name = empty($value['name'])?$value['user']:$value['name'];
//$categories[$key]['comment'] = " <div class=\"commenterName\"><strong>{$name}</strong><div class=\"date sub-text\">{$value['created']}</div></div><div class=\"commentText\">". nl2br($value['comment'])."</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: 50px;"/></div><div class="commentDetails"><div class="commenterName"><strong>'.$name.'</strong> <small>'.humanTiming(strtotime($value['videoCreation'])).'</small></div></div>';
}
echo '{ "current": '.$_POST['current'].',"rowCount": '.$_POST['rowCount'].', "total": '.$total.', "rows":'. json_encode($videos).'}';
echo '{ "current": '.$_POST['current'].',"rowCount": '.$_POST['rowCount'].', "total": '.$total.', "rows":'. json_encode($videos).'}';

View file

@ -29,9 +29,9 @@ if (!User::canUpload()) {
$video = new Video("", "", @$_POST['videos_id']);
$obj->video_id = @$_POST['videos_id'];
$title = $video->getTitle();
if(empty($title) && !empty($_POST['title'])){
if (empty($title) && !empty($_POST['title'])) {
$title = $video->setTitle($_POST['title']);
}else if(empty($title)){
} elseif (empty($title)) {
$video->setTitle("Automatic Title");
}
$video->setDuration($_POST['duration']);
@ -40,10 +40,10 @@ $video->setStatus('a');
$video->setVideoDownloadedLink($_POST['videoDownloadedLink']);
if(preg_match("/(mp3|wav|ogg)$/i", $_POST['format'])){
if (preg_match("/(mp3|wav|ogg)$/i", $_POST['format'])) {
$type = 'audio';
$video->setType($type);
}else if(preg_match("/(mp4|webm)$/i", $_POST['format'])){
} elseif (preg_match("/(mp4|webm)$/i", $_POST['format'])) {
$type = 'video';
$video->setType($type);
}
@ -74,8 +74,8 @@ if(!empty($_FILES['image']['tmp_name']) && !file_exists("{$destination}.jpg")){
die(json_encode($obj));
}
}
if(!empty($_FILES['gifimage']['tmp_name']) && !file_exists("{$destination}.gif")){
if(!move_uploaded_file ($_FILES['gifimage']['tmp_name'] , "{$destination}.gif")){
if (!empty($_FILES['gifimage']['tmp_name']) && !file_exists("{$destination}.gif")) {
if (!move_uploaded_file ($_FILES['gifimage']['tmp_name'] , "{$destination}.gif")) {
$obj->msg = __("Could not move gif image file [{$destination}.gif]");
error_log($obj->msg);
die(json_encode($obj));
@ -90,12 +90,7 @@ error_log("Files Received for video {$video_id}: ".$video->getTitle());
die(json_encode($obj));
/*
error_log(print_r($_POST, true));
error_log(print_r($_FILES, true));
var_dump($_POST, $_FILES);
*/

View file

@ -2,10 +2,10 @@
header('Content-Type: application/json');
$obj = new stdClass();
$obj->error = true;
if(empty($global['systemRootPath'])){
$global['systemRootPath'] = "../";
if (empty($global['systemRootPath'])) {
$global['systemRootPath'] = '../';
}
require_once $global['systemRootPath'].'videos/configuration.php';
require_once $global['systemRootPath'] . 'videos/configuration.php';
require_once $global['systemRootPath'] . 'objects/user.php';
require_once $global['systemRootPath'] . 'objects/video.php';
@ -38,14 +38,14 @@ if (isset($_FILES['upl']) && $_FILES['upl']['error'] == 0) {
if (strcasecmp($extension, 'mp3') == 0 || strcasecmp($extension, 'wav') == 0) {
$type = 'audio';
}
//var_dump($extension, $type);exit;
require_once $global['systemRootPath'] . 'objects/video.php';
//echo "Starting Get Duration\n";
$duration = Video::getDurationFromFile($_FILES['upl']['tmp_name']);
// check if can upload video (about time limit storage)
if(!empty($global['videoStorageLimitMinutes'])){
$maxDuration = $global['videoStorageLimitMinutes']*60;
@ -65,8 +65,8 @@ if (isset($_FILES['upl']) && $_FILES['upl']['error'] == 0) {
exit;
}
}
$path_parts = pathinfo($_FILES['upl']['name']);
$mainName = preg_replace("/[^A-Za-z0-9]/", "", cleanString($path_parts['filename']));
$filename = uniqid($mainName . "_YPTuniqid_", true);
@ -114,32 +114,32 @@ if (isset($_FILES['upl']) && $_FILES['upl']['error'] == 0) {
if (!copy($_FILES['upl']['tmp_name'], "{$global['systemRootPath']}videos/original_" . $filename)) {
die("Error on copy(" . $_FILES['upl']['tmp_name'] . ", " . "{$global['systemRootPath']}videos/original_" . $filename . ")");
}
} else if (array_key_exists('dontMoveUploadedFile', $_FILES['upl'])) {
} elseif (array_key_exists('dontMoveUploadedFile', $_FILES['upl'])) {
if (!rename($_FILES['upl']['tmp_name'], "{$global['systemRootPath']}videos/original_" . $filename)) {
die("Error on rename(" . $_FILES['upl']['tmp_name'] . ", " . "{$global['systemRootPath']}videos/original_" . $filename . ")");
}
} else if (!move_uploaded_file($_FILES['upl']['tmp_name'], "{$global['systemRootPath']}videos/original_" . $filename)) {
} elseif (!move_uploaded_file($_FILES['upl']['tmp_name'], "{$global['systemRootPath']}videos/original_" . $filename)) {
die("Error on move_uploaded_file(" . $_FILES['upl']['tmp_name'] . ", " . "{$global['systemRootPath']}videos/original_" . $filename . ")");
}
$video = new Video("", "", $id);
$video = new Video('', '', $id);
// send to encoder
$queue = array();
if($video->getType() == 'video'){
if($config->getEncode_mp4()){
if ($video->getType() == 'video') {
if ($config->getEncode_mp4()) {
$queue[] = $video->queue("mp4");
}
if($config->getEncode_webm()){
if ($config->getEncode_webm()) {
$queue[] = $video->queue("webm");
}
}else if($config->getEncode_mp3spectrum()){
if($config->getEncode_mp4()){
} elseif ($config->getEncode_mp3spectrum()) {
if ($config->getEncode_mp4()) {
$queue[] = $video->queue("mp4_spectrum");
}
if($config->getEncode_webm()){
if ($config->getEncode_webm()) {
$queue[] = $video->queue("webm_spectrum");
}
}else{
} else {
$queue[] = $video->queue("mp3");
$queue[] = $video->queue("ogg");
}
@ -159,8 +159,3 @@ if (isset($_FILES['upl']) && $_FILES['upl']['error'] == 0) {
//echo '{"status":"error", "msg":' . json_encode($_FILES) . ', "type":"$_FILES Error"}';
status(["status" => "error", "msg" => print_r($_FILES,true), "type" => '$_FILES Error']);
exit;

View file

@ -103,7 +103,7 @@ if ($client->getAccessToken()) {
$obj->msg = sprintf(__("Your video <a href='https://youtu.be/%s' target='_blank' class='btn btn-default'><span class='fa fa-youtube-play'></span> %s</a> was uploaded to your <a href='https://www.youtube.com/my_videos' class='btn btn-default' target='_blank'><span class='fa fa-youtube'></span> YouTube Account</a><br> "), $obj->id, $obj->title);
$v->setYoutubeId($obj->id);
$v->save();
} catch (Google_Service_Exception $e) {
$obj->msg = sprintf(__("A service error occurred: %s"), $e->getMessage());
} catch (Google_Exception $e) {
@ -123,7 +123,6 @@ if ($client->getAccessToken()) {
$_SESSION['state'] = $state;
$authUrl = $client->createAuthUrl();
$obj->msg = "<h3>Authorization Required</h3><p>You need to <a href=\"{$authUrl}\" class='btn btn-danger'><span class='fa fa-youtube'></span> authorize access</a> before proceeding.<p>";
}
echo json_encode($obj);
?>

View file

@ -23,13 +23,13 @@ require_once '../videos/configuration.php';
<footer class="blockquote-footer">Apostle Paul in <cite title="Source Title">Romans 11:36</cite></footer>
</blockquote>
<div class="btn-group btn-group-justified">
<a href="https://www.youphptube.com/" class="btn btn-success">Main Site</a>
<a href="https://demo.youphptube.com/" class="btn btn-danger">Demo Site</a>
<a href="https://tutorials.youphptube.com/" class="btn btn-primary">Tutorials Site</a>
<a href="https://github.com/DanielnetoDotCom/YouPHPTube/issues" class="btn btn-warning">Issues and requests Site</a>
<a href="https://www.youphptube.com/" class="btn btn-success">Main Site</a>
<a href="https://demo.youphptube.com/" class="btn btn-danger">Demo Site</a>
<a href="https://tutorials.youphptube.com/" class="btn btn-primary">Tutorials Site</a>
<a href="https://github.com/DanielnetoDotCom/YouPHPTube/issues" class="btn btn-warning">Issues and requests Site</a>
</div>
<span class="label label-success"><?php printf(__("You are running YouPHPTube version %s!"), $config->getVersion()); ?></span>
<span class="label label-success">
<?php printf(__("You can upload max of %s!"), get_max_file_size()); ?>
</span>
@ -39,8 +39,8 @@ require_once '../videos/configuration.php';
<span class="label label-success">
<?php printf(__("You have %s minutes of videos!"), number_format(getSecondsTotalVideosLength()/6, 2)); ?>
</span>
$obj->videoStorageLimitMinutes = $global['videoStorageLimitMinutes'];
$obj->currentStorageUsage = getSecondsTotalVideosLength();
</div>

View file

@ -134,8 +134,8 @@ $playlists = PlayList::getAllFromUser($user_id, $publicOnly);
if ($isMyChannel) {
?>
<a href="<?php echo $global['webSiteRootURL']; ?>mvideos" class="btn btn-success ">
<span class="glyphicon glyphicon-film"></span>
<span class="glyphicon glyphicon-headphones"></span>
<span class="glyphicon glyphicon-film"></span>
<span class="glyphicon glyphicon-headphones"></span>
<?php echo __("My videos"); ?>
</a>
<?php

View file

@ -60,7 +60,7 @@ foreach ($videos as $value) {
include $global['systemRootPath'] . 'view/include/head.php';
?>
<script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.5.0/Chart.bundle.min.js" integrity="sha256-+q+dGCSrVbejd3MDuzJHKsk2eXd4sF5XYEMfPZsOnYE=" crossorigin="anonymous"></script>
</head>
<body>
<?php
@ -117,17 +117,17 @@ foreach ($videos as $value) {
<div class="panel panel-default">
<div class="panel-heading when"># <?php echo __("Total Views"); ?></div>
<div class="panel-body">
<canvas id="myChartPie" height="200" ></canvas>
<canvas id="myChartPie" height="200" ></canvas>
</div>
</div>
</div>
</div>
<div class="col-md-8">
<div class="panel panel-default">
<div class="panel-heading when"># <?php echo __("Timeline"); ?></div>
<div class="panel-body" id="timeline">
<canvas id="myChartLine" height="90" ></canvas>
<canvas id="myChartLine" height="90" ></canvas>
</div>
</div>
</div>
</div>
</div>
<div class="row">
@ -157,7 +157,7 @@ foreach ($videos as $value) {
borderWidth: 1
}]
};
var lineChartData = {
labels: <?php echo json_encode($label90Days); ?>,
datasets: [{
@ -167,7 +167,7 @@ foreach ($videos as $value) {
data: <?php echo json_encode($statistc_last90Days); ?>
}]
};
var lineChartDataToday = {
labels: <?php echo json_encode($labelToday); ?>,
datasets: [{
@ -240,7 +240,7 @@ foreach ($videos as $value) {
}
}
});
var myChartLineToday = new Chart(ctxLineToday, {
type: 'line',
data: lineChartDataToday,

View file

@ -39,31 +39,31 @@ require_once $global['systemRootPath'] . 'objects/functions.php';
<ul class="nav nav-tabs">
<li class="nav-item">
<a class="nav-link " href="#tabTheme" data-toggle="tab">
<span class="fa fa-cog"></span>
<span class="fa fa-cog"></span>
<?php echo __("Themes"); ?>
</a>
</li>
<li class="nav-item">
<a class="nav-link " href="#tabCompatibility" data-toggle="tab">
<span class="fa fa-cog"></span>
<span class="fa fa-cog"></span>
<?php echo __("Compatibility Check"); ?>
</a>
</li>
<li class="nav-item active">
<a class="nav-link " href="#tabRegular" id="tabRegularLink" data-toggle="tab">
<span class="fa fa-cog"></span>
<span class="fa fa-cog"></span>
<?php echo __("Regular Configuration"); ?>
</a>
</li>
<li class="nav-item">
<a class="nav-link " href="#tabAdvanced" data-toggle="tab">
<span class="fa fa-cogs"></span>
<span class="fa fa-cogs"></span>
<?php echo __("Advanced Configuration"); ?>
</a>
</li>
<li class="nav-item">
<a class="nav-link " href="#tabHead" data-toggle="tab">
<span class="fa fa-code"></span>
<span class="fa fa-code"></span>
<?php echo __("Script Code"); ?>
</a>
</li>
@ -73,11 +73,11 @@ require_once $global['systemRootPath'] . 'objects/functions.php';
<fieldset>
<legend><?php echo __("Themes"); ?></legend>
<h1 class="alert alert-warning">
<span class="fa fa-warning"></span>
<span class="fa fa-warning"></span>
<?php echo __("Do not forget to save after choose your theme"); ?>
</h1>
<div class="alert alert-info">
<span class="fa fa-info-circle"></span>
<span class="fa fa-info-circle"></span>
<?php echo __("We would like to thanks http://bootswatch.com/"); ?>
</div>
<?php
@ -86,15 +86,15 @@ require_once $global['systemRootPath'] . 'objects/functions.php';
$file = basename($filename); // $file is set to "index.php"
$fileEx = basename($filename, ".css"); // $file is set to "index"
$savedTheme = $config->getTheme();
if($fileEx == $savedTheme){
if ($fileEx == $savedTheme) {
?>
<script>
$(document).ready(function () {
setTimeout(function () {
setTimeout(function () {
$("#btn<?php echo ($fileEx); ?>").trigger("click");
}, 1000);
});
</script>
</script>
<?php
}
?>
@ -108,7 +108,7 @@ require_once $global['systemRootPath'] . 'objects/functions.php';
?>
</fieldset>
</div>
<div class="tab-pane" id="tabCompatibility">
<div class="tab-pane" id="tabCompatibility">
<div class="alert alert-success">
<span class="fa fa-film"></span>
<strong><?php
@ -128,7 +128,7 @@ require_once $global['systemRootPath'] . 'objects/functions.php';
}
?> and you have <?php echo $global['videoStorageLimitMinutes']; ?> minutes of storage
<div class="progress">
<div class="progress-bar progress-bar-success progress-bar-striped active" role="progressbar"
<div class="progress-bar progress-bar-success progress-bar-striped active" role="progressbar"
aria-valuenow="<?php echo $percent; ?>" aria-valuemin="0" aria-valuemax="100" style="width: <?php echo $percent; ?>%">
<?php echo $percent; ?>% of your storage limit used
</div>
@ -137,21 +137,21 @@ require_once $global['systemRootPath'] . 'objects/functions.php';
}
?>
</div>
</div>
<?php
if (isApache()) {
?>
<div class="alert alert-success">
<span class="glyphicon glyphicon-check"></span>
<strong><?php echo $_SERVER['SERVER_SOFTWARE']; ?> is Present</strong>
</div>
</div>
<?php
} else {
?>
<div class="alert alert-danger">
<span class="glyphicon glyphicon-unchecked"></span>
<strong>Your server is <?php echo $_SERVER['SERVER_SOFTWARE']; ?>, you must install Apache</strong>
</div>
</div>
<?php
}
?>
@ -163,14 +163,14 @@ require_once $global['systemRootPath'] . 'objects/functions.php';
<div class="alert alert-success">
<span class="glyphicon glyphicon-check"></span>
<strong>PHP <?php echo PHP_VERSION; ?> is Present</strong>
</div>
</div>
<?php
} else {
?>
<div class="alert alert-danger">
<span class="glyphicon glyphicon-unchecked"></span>
<strong>Your PHP version is <?php echo PHP_VERSION; ?>, you must install PHP 5.6.x or greater</strong>
</div>
</div>
<?php
}
?>
@ -182,7 +182,7 @@ require_once $global['systemRootPath'] . 'objects/functions.php';
<div class="alert alert-success">
<span class="glyphicon glyphicon-check"></span>
<strong>Mod Rewrite module is Present</strong>
</div>
</div>
<?php
} else {
?>
@ -195,7 +195,7 @@ require_once $global['systemRootPath'] . 'objects/functions.php';
Restart apache2 after<br>
<pre><code>/etc/init.d/apache2 restart</code></pre>
</details>
</div>
</div>
<?php
}
?>
@ -206,7 +206,7 @@ require_once $global['systemRootPath'] . 'objects/functions.php';
<div class="alert alert-success">
<span class="glyphicon glyphicon-check"></span>
<strong>Your videos directory is writable</strong>
</div>
</div>
<?php
} else {
?>
@ -229,7 +229,7 @@ require_once $global['systemRootPath'] . 'objects/functions.php';
<br>
<pre><code>sudo chmod -R 777 <?php echo $dir; ?></code></pre>
</details>
</div>
</div>
<?php
}
$pathToPHPini = php_ini_loaded_file();
@ -244,7 +244,7 @@ require_once $global['systemRootPath'] . 'objects/functions.php';
<div class="alert alert-success">
<span class="glyphicon glyphicon-check"></span>
<strong>Your post_max_size is <?php echo ini_get('post_max_size'); ?></strong>
</div>
</div>
<?php
} else {
?>
@ -253,11 +253,11 @@ require_once $global['systemRootPath'] . 'objects/functions.php';
<strong>Your post_max_size is <?php echo ini_get('post_max_size'); ?>, it must be at least 100M</strong>
<details>
Edit the <code>php.ini</code> file
Edit the <code>php.ini</code> file
<br>
<pre><code>sudo nano <?php echo $pathToPHPini; ?></code></pre>
</details>
</div>
</div>
<?php
}
?>
@ -268,7 +268,7 @@ require_once $global['systemRootPath'] . 'objects/functions.php';
<div class="alert alert-success">
<span class="glyphicon glyphicon-check"></span>
<strong>Your upload_max_filesize is <?php echo ini_get('upload_max_filesize'); ?></strong>
</div>
</div>
<?php
} else {
?>
@ -277,11 +277,11 @@ require_once $global['systemRootPath'] . 'objects/functions.php';
<strong>Your upload_max_filesize is <?php echo ini_get('upload_max_filesize'); ?>, it must be at least 100M</strong>
<details>
Edit the <code>php.ini</code> file
Edit the <code>php.ini</code> file
<br>
<pre><code>sudo nano <?php echo $pathToPHPini; ?></code></pre>
</details>
</div>
</div>
<?php
}
?>
@ -294,17 +294,17 @@ require_once $global['systemRootPath'] . 'objects/functions.php';
<div class="form-group">
<label class="col-md-4 control-label">
<?php echo __("Your Logo"); ?>
</label>
</label>
<div class="col-md-8 ">
<div id="croppieLogo"></div>
<a id="logo-btn" class="btn btn-default btn-xs btn-block"><?php echo __("Upload a logo"); ?></a>
</div>
<input type="file" id="logo" value="Choose a Logo" accept="image/*" style="display: none;" />
</div>
</div>
<div class="form-group">
<label class="col-md-4 control-label">
<?php echo __("Your Small Logo"); ?> (32x32)
</label>
</label>
<div class="col-md-8 ">
<div id="croppieLogoSmall"></div>
<a id="logoSmall-btn" class="btn btn-default btn-xs btn-block"><?php echo __("Upload a small logo"); ?></a>
@ -313,10 +313,10 @@ require_once $global['systemRootPath'] . 'objects/functions.php';
</div>
<div class="form-group">
<label class="col-md-4 control-label"><?php echo __("First Page Mode"); ?></label>
<label class="col-md-4 control-label"><?php echo __("First Page Mode"); ?></label>
<div class="col-md-8 inputGroupContainer">
<div class="input-group">
<span class="input-group-addon"><i class="fa fa-sitemap"></i></span>
<span class="input-group-addon"><i class="fa fa-sitemap"></i></span>
<select class="form-control" id="mode" >
<option value="Youtube" <?php echo ($config->getMode() == "Youtube") ? "selected" : ""; ?>><?php echo __("Youtube"); ?></option>
<option value="Gallery" <?php echo ($config->getMode() == "Gallery") ? "selected" : ""; ?>><?php echo __("Gallery"); ?></option>
@ -326,7 +326,7 @@ require_once $global['systemRootPath'] . 'objects/functions.php';
</div>
<div class="form-group">
<label class="col-md-4 control-label"><?php echo __("Web site title"); ?></label>
<label class="col-md-4 control-label"><?php echo __("Web site title"); ?></label>
<div class="col-md-8 inputGroupContainer">
<div class="input-group">
<span class="input-group-addon"><i class="glyphicon glyphicon-globe"></i></span>
@ -335,7 +335,7 @@ require_once $global['systemRootPath'] . 'objects/functions.php';
</div>
</div>
<div class="form-group">
<label class="col-md-4 control-label"><?php echo __("Language"); ?></label>
<label class="col-md-4 control-label"><?php echo __("Language"); ?></label>
<div class="col-md-8 inputGroupContainer">
<div class="input-group">
<span class="input-group-addon"><i class="glyphicon glyphicon-flag"></i></span>
@ -345,7 +345,7 @@ require_once $global['systemRootPath'] . 'objects/functions.php';
</div>
</div>
<div class="form-group">
<label class="col-md-4 control-label"><?php echo __("E-mail"); ?></label>
<label class="col-md-4 control-label"><?php echo __("E-mail"); ?></label>
<div class="col-md-8 inputGroupContainer">
<div class="input-group">
<span class="input-group-addon"><i class="glyphicon glyphicon-envelope"></i></span>
@ -357,10 +357,10 @@ require_once $global['systemRootPath'] . 'objects/functions.php';
<div class="form-group">
<label class="col-md-4 control-label"><?php echo __("Authenticated users can upload videos"); ?></label>
<label class="col-md-4 control-label"><?php echo __("Authenticated users can upload videos"); ?></label>
<div class="col-md-8 inputGroupContainer">
<div class="input-group">
<span class="input-group-addon"><i class="fa fa-cloud-upload"></i></span>
<span class="input-group-addon"><i class="fa fa-cloud-upload"></i></span>
<select class="form-control" id="authCanUploadVideos" >
<option value="1" <?php echo ($config->getAuthCanUploadVideos() == 1) ? "selected" : ""; ?>><?php echo __("Yes"); ?></option>
<option value="0" <?php echo ($config->getAuthCanUploadVideos() == 0) ? "selected" : ""; ?>><?php echo __("No"); ?></option>
@ -370,7 +370,7 @@ require_once $global['systemRootPath'] . 'objects/functions.php';
</div>
<div class="form-group">
<label class="col-md-4 control-label"><?php echo __("Authenticated users can comment videos"); ?></label>
<label class="col-md-4 control-label"><?php echo __("Authenticated users can comment videos"); ?></label>
<div class="col-md-8 inputGroupContainer">
<div class="input-group">
<span class="input-group-addon"><i class="fa fa-commenting"></i></span>
@ -381,22 +381,22 @@ require_once $global['systemRootPath'] . 'objects/functions.php';
</select>
</div>
</div>
</div>
</div>
<div class="form-group">
<label class="col-md-4 control-label"><?php echo __("Autoplay Video on Load Page"); ?></label>
<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>
<label class="col-md-4 control-label"><?php echo __("Enable Facebook Login"); ?></label>
<div class="col-md-8">
<div class="input-group">
<span class="input-group-addon"><i class="fa fa-facebook-square"></i></span>
@ -407,14 +407,14 @@ require_once $global['systemRootPath'] . 'objects/functions.php';
</div>
</div>
<label class="col-md-4 control-label"><?php echo __("Facebook ID"); ?></label>
<label class="col-md-4 control-label"><?php echo __("Facebook ID"); ?></label>
<div class="col-md-8 inputGroupContainer">
<div class="input-group">
<span class="input-group-addon"><i class="fa fa-id-card"></i></span>
<input id="authFacebook_id" placeholder="<?php echo __("Facebook ID"); ?>" class="form-control" type="text" value="<?php echo $config->getAuthFacebook_id() ?>" >
</div>
</div>
<label class="col-md-4 control-label"><?php echo __("Facebook Key"); ?></label>
<label class="col-md-4 control-label"><?php echo __("Facebook Key"); ?></label>
<div class="col-md-8 inputGroupContainer">
<div class="input-group">
<span class="input-group-addon"><i class="fa fa-key"></i></span>
@ -426,7 +426,7 @@ require_once $global['systemRootPath'] . 'objects/functions.php';
</div>
<div class="form-group">
<label class="col-md-4 control-label"><?php echo __("Enable Google Login"); ?></label>
<label class="col-md-4 control-label"><?php echo __("Enable Google Login"); ?></label>
<div class="col-md-8">
<div class="input-group">
<span class="input-group-addon"><i class="fa fa-google"></i></span>
@ -437,14 +437,14 @@ require_once $global['systemRootPath'] . 'objects/functions.php';
</div>
</div>
<label class="col-md-4 control-label"><?php echo __("Google ID"); ?></label>
<label class="col-md-4 control-label"><?php echo __("Google ID"); ?></label>
<div class="col-md-8 inputGroupContainer">
<div class="input-group">
<span class="input-group-addon"><i class="fa fa-id-card"></i></span>
<input id="authGoogle_id" placeholder="<?php echo __("Google ID"); ?>" class="form-control" type="text" value="<?php echo $config->getAuthGoogle_id() ?>" >
</div>
</div>
<label class="col-md-4 control-label"><?php echo __("Google Key"); ?></label>
<label class="col-md-4 control-label"><?php echo __("Google Key"); ?></label>
<div class="col-md-8 inputGroupContainer">
<div class="input-group">
<span class="input-group-addon"><i class="fa fa-key"></i></span>
@ -464,98 +464,98 @@ require_once $global['systemRootPath'] . 'objects/functions.php';
<legend><?php echo __("Advanced configuration"); ?></legend>
<div class="form-group">
<label class="col-md-2"><?php echo __("Encoder URL"); ?></label>
<label class="col-md-2"><?php echo __("Encoder URL"); ?></label>
<div class="col-md-10">
<input id="encoder_url" aria-describedby="encoder_urlHelp" class="form-control" type="url" value="<?php echo $config->getEncoderURL(); ?>" >
<input id="encoder_url" aria-describedby="encoder_urlHelp" class="form-control" type="url" value="<?php echo $config->getEncoderURL(); ?>" >
<small id="encoder_urlHelp" class="form-text text-muted">
<?php echo __("You need to set up an encoder server"); ?><br>
<?php echo __("You can use our public encoder on"); ?>: https://encoder.youphptube.com/ or
<?php echo __("You can use our public encoder on"); ?>: https://encoder.youphptube.com/ or
<a href="https://github.com/DanielnetoDotCom/YouPHPTube-Encoder" class="btn btn-default btn-xs" target="_blank"><?php echo __("For faster encode, download your own encoder"); ?></a>
</small>
</div>
</div>
<div class="form-group">
<label class="col-md-2"><?php echo __("Session Timeout in seconds"); ?></label>
<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(); ?>" >
<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 __("Disable YouPHPTube Google Analytics"); ?></label>
<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">
?> 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>
<div class="form-group">
<label class="col-md-2"><?php echo __("Enable SMTP"); ?></label>
<label class="col-md-2"><?php echo __("Enable SMTP"); ?></label>
<div class="col-md-10">
<input data-toggle="toggle" type="checkbox" name="enableSmtp" id="enableSmtp" value="1" <?php
if (!empty($config->getSmtp())) {
echo "checked";
}
?> >
?> >
</div>
</div>
<div class="form-group">
<label class="col-md-2"><?php echo __("Enable SMTP Auth"); ?></label>
<label class="col-md-2"><?php echo __("Enable SMTP Auth"); ?></label>
<div class="col-md-10">
<input data-toggle="toggle" type="checkbox" name="enableSmtpAuth" id="enableSmtpAuth" value="1" <?php
if (!empty($config->getSmtpAuth())) {
echo "checked";
}
?> >
?> >
</div>
</div>
</div>
<div class="form-group">
<label class="col-md-2"><?php echo __("SMTP Secure"); ?></label>
<label class="col-md-2"><?php echo __("SMTP Secure"); ?></label>
<div class="col-md-10">
<input id="smtpSecure" class="form-control" type="text" value="<?php echo $config->getSmtpSecure(); ?>" placeholder="tls OR ssl" aria-describedby="smtpSecureHelp" >
<input id="smtpSecure" class="form-control" type="text" value="<?php echo $config->getSmtpSecure(); ?>" placeholder="tls OR ssl" aria-describedby="smtpSecureHelp" >
<small id="smtpSecureHelp" class="form-text text-muted"><?php echo __("Use tls OR ssl"); ?></small>
</div>
</div>
</div>
<div class="form-group">
<label class="col-md-2"><?php echo __("SMTP Port"); ?></label>
<label class="col-md-2"><?php echo __("SMTP Port"); ?></label>
<div class="col-md-10">
<input id="smtpPort" class="form-control" type="number" value="<?php echo $config->getSmtpPort(); ?>" placeholder="465 OR 587" aria-describedby="smtpPortHelp" >
<input id="smtpPort" class="form-control" type="number" value="<?php echo $config->getSmtpPort(); ?>" placeholder="465 OR 587" aria-describedby="smtpPortHelp" >
<small id="smtpPortHelp" class="form-text text-muted"><?php echo __("465 OR 587"); ?></small>
</div>
</div>
<div class="form-group">
<label class="col-md-2"><?php echo __("SMTP Host"); ?></label>
<div class="col-md-10">
<input id="smtpHost" class="form-control" type="text" value="<?php echo $config->getSmtpHost(); ?>" placeholder="smtp.gmail.com" >
</div>
</div>
<div class="form-group">
<label class="col-md-2"><?php echo __("SMTP Username"); ?></label>
<div class="col-md-10">
<input id="smtpUsername" class="form-control" type="text" value="<?php echo $config->getSmtpUsername(); ?>" placeholder="email@gmail.com" >
</div>
</div>
<div class="form-group">
<label class="col-md-2"><?php echo __("SMTP Password"); ?></label>
<label class="col-md-2"><?php echo __("SMTP Host"); ?></label>
<div class="col-md-10">
<input id="smtpPassword" class="form-control" type="password" value="<?php echo $config->getSmtpPassword(); ?>" >
<input id="smtpHost" class="form-control" type="text" value="<?php echo $config->getSmtpHost(); ?>" placeholder="smtp.gmail.com" >
</div>
</div>
<div class="form-group">
<label class="col-md-2"><?php echo __("SMTP Username"); ?></label>
<div class="col-md-10">
<input id="smtpUsername" class="form-control" type="text" value="<?php echo $config->getSmtpUsername(); ?>" placeholder="email@gmail.com" >
</div>
</div>
<div class="form-group">
<label class="col-md-2"><?php echo __("SMTP Password"); ?></label>
<div class="col-md-10">
<input id="smtpPassword" class="form-control" type="password" value="<?php echo $config->getSmtpPassword(); ?>" >
</div>
</div>
</fieldset>
<?php
} else {
@ -570,7 +570,7 @@ require_once $global['systemRootPath'] . 'objects/functions.php';
<legend><?php echo __("Script Code"); ?></legend>
<div class="form-group">
<label class="col-md-2"><?php echo __("Head Code"); ?></label>
<label class="col-md-2"><?php echo __("Head Code"); ?></label>
<div class="col-md-10">
<textarea id="head" class="form-control" type="text" rows="20" ><?php echo $config->getHead(); ?></textarea>
<small>For Google Analytics code: <a href='https://analytics.google.com' target="_blank">https://analytics.google.com</a></small><br>
@ -578,7 +578,7 @@ require_once $global['systemRootPath'] . 'objects/functions.php';
</div>
</div>
<div class="form-group">
<label class="col-md-2"><?php echo __("Google Ad Sense"); ?></label>
<label class="col-md-2"><?php echo __("Google Ad Sense"); ?></label>
<div class="col-md-10">
<textarea id="adsense" class="form-control" type="text" rows="20" ><?php echo $config->getAdsense(); ?></textarea>
<small>For Google AdSense code: <a href='https://www.google.com/adsense' target="_blank">https://www.google.com/adsense</a></small><br>

View file

@ -25,7 +25,7 @@ require_once '../videos/configuration.php';
<!-- Text input-->
<div class="form-group">
<label class="col-md-4 control-label"><?php echo __("Name"); ?></label>
<label class="col-md-4 control-label"><?php echo __("Name"); ?></label>
<div class="col-md-4 inputGroupContainer">
<div class="input-group">
<span class="input-group-addon"><i class="glyphicon glyphicon-user"></i></span>
@ -37,7 +37,7 @@ require_once '../videos/configuration.php';
<!-- Text input-->
<div class="form-group">
<label class="col-md-4 control-label"><?php echo __("E-mail"); ?></label>
<label class="col-md-4 control-label"><?php echo __("E-mail"); ?></label>
<div class="col-md-4 inputGroupContainer">
<div class="input-group">
<span class="input-group-addon"><i class="glyphicon glyphicon-envelope"></i></span>
@ -49,7 +49,7 @@ require_once '../videos/configuration.php';
<!-- Text input-->
<div class="form-group">
<label class="col-md-4 control-label"><?php echo __("Website"); ?></label>
<label class="col-md-4 control-label"><?php echo __("Website"); ?></label>
<div class="col-md-4 inputGroupContainer">
<div class="input-group">
<span class="input-group-addon"><i class="glyphicon glyphicon-globe"></i></span>
@ -71,7 +71,7 @@ require_once '../videos/configuration.php';
<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-4 inputGroupContainer">
<div class="input-group">
<span class="input-group-addon"><img src="<?php echo $global['webSiteRootURL']; ?>captcha" id="captcha"></span>

View file

@ -1,5 +1,5 @@
*{
font-family: Roboto,arial,sans-serif;
* {
font-family: Roboto, arial, sans-serif;
font-size: 12px;
}
html,
@ -9,16 +9,13 @@ body {
body {
padding-top: 60px;
}
.nopadding {
padding: 0 !important;
margin: 0 !important;
}
.videoLink .duration{
.videoLink .duration {
position: absolute;
background: rgba(0,0, 0, 0.6)!important;
background: rgba(0, 0, 0, 0.6)!important;
padding: 2px;
color: #FFF;
bottom: 5px;
@ -26,53 +23,51 @@ body {
font-size: 0.9em;
border-radius: 5px;
}
.videoLink .glyphicon-play-circle{
.videoLink .glyphicon-play-circle {
transition: all 0.3s ease-in-out;
top: 50%;
left: 50%;
margin: -25px 0 0 -25px;
position: absolute;
color: rgba(255,255, 255, 0.3)!important;
color: rgba(255, 255, 255, 0.3)!important;
font-size: 50px;
}
.videoLink div{
.videoLink div {
transition: all 0.3s ease-in-out;
font-size: 1em;
}
.videoLink div.details, .videoLink div.details div{
.videoLink div.details,
.videoLink div.details div {
font-size: 0.9em;
}
.gallery:hover .glyphicon-play-circle, .videoLink:hover .glyphicon-play-circle{
color: rgba(255,255, 255, 0.6)!important;
.gallery:hover .glyphicon-play-circle,
.videoLink:hover .glyphicon-play-circle {
color: rgba(255, 255, 255, 0.6)!important;
}
.bottom-border{
.bottom-border {
border-bottom: 2px solid #F2F2F2;
margin: 0;
padding: 5px;
}
h1,h2,h3,h4{
h1,
h2,
h3,
h4 {
margin: 5px;
padding: 5px;
}
h1{
h1 {
font-size: 20px;
}
h2{
h2 {
font-size: 18px;
}
h3{
h3 {
font-size: 16px;
}
h4{
h4 {
font-size: 14px;
}
footer {
color: #444;
padding: 25px;
@ -83,7 +78,7 @@ footer {
}
footer .btn-outline:hover,
footer .btn-outline:focus,
footer .btn-outline:active{
footer .btn-outline:active {
color: #444;
background: white;
border: solid 2px white;
@ -97,20 +92,18 @@ footer .btn-outline {
}
/* for main video */
.video-content {
flex:0 1 100%;
height:50%;
display:flex;
justify-content:flex-start;
flex: 0 1 100%;
height: 50%;
display: flex;
justify-content: flex-start;
}
.main-video{
.main-video {
background-color: #000;
margin-bottom: 10px;
}
/* end for main video */
.form-compact .form-control {
position: relative;
height: auto;
@ -124,16 +117,17 @@ footer .btn-outline {
border-radius: 0;
margin-bottom: -1px;
}
.form-compact input.first, .form-compact select.first {
.form-compact input.first,
.form-compact select.first {
border-top-left-radius: 5px;
border-top-right-radius: 5px;
}
.form-compact input.last, .form-compact select.last {
.form-compact input.last,
.form-compact select.last {
border-bottom-left-radius: 5px;
border-bottom-right-radius: 5px;
margin-bottom: 10px;
}
@media (max-width: 767px) {
.navbar-form {
padding: 0;
@ -142,17 +136,17 @@ footer .btn-outline {
/* Comments */
.commenterName small {
font-family:verdana;
font-size:0.9em;
font-family: verdana;
font-size: 0.9em;
}
.commenterName {
margin-right:5px;
margin-right: 5px;
}
.commentText {
clear: both;
}
.commentDetails {
margin:0 0 0 60px;
margin: 0 0 0 60px;
}
/* End Comments */
@ -175,17 +169,21 @@ footer .btn-outline {
border: 0;
margin-right: 0;
}
.tabbable-line > .nav-tabs > li.open, .tabbable-line > .nav-tabs > li:hover {
.tabbable-line > .nav-tabs > li.open,
.tabbable-line > .nav-tabs > li:hover {
border-bottom: 4px solid #fbcdcf;
}
.tabbable-line > .nav-tabs > li.open > a, .tabbable-line > .nav-tabs > li:hover > a {
.tabbable-line > .nav-tabs > li.open > a,
.tabbable-line > .nav-tabs > li:hover > a {
border: 0;
background: none !important;
}
.tabbable-line > .nav-tabs > li.open > a > i, .tabbable-line > .nav-tabs > li:hover > a > i {
.tabbable-line > .nav-tabs > li.open > a > i,
.tabbable-line > .nav-tabs > li:hover > a > i {
color: #a6a6a6;
}
.tabbable-line > .nav-tabs > li.open .dropdown-menu, .tabbable-line > .nav-tabs > li:hover .dropdown-menu {
.tabbable-line > .nav-tabs > li.open .dropdown-menu,
.tabbable-line > .nav-tabs > li:hover .dropdown-menu {
margin-top: 0px;
}
.tabbable-line > .nav-tabs > li.active {
@ -213,40 +211,35 @@ footer .btn-outline {
.nowrapCell td {
white-space: normal !important;
}
.watch8-action-buttons{
.watch8-action-buttons {
padding: 5px 10px 0 10px;
margin: 5px 0 0 0;
margin: 5px 0 0 0;
border-top: 2px solid #F2F2F2;
}
.bgWhite{
.bgWhite {
margin: 0 0 10px;
border: 0;
box-shadow: 0 1px 2px rgba(0,0,0,.1);
border: 0;
box-shadow: 0 1px 2px rgba(0, 0, 0, .1);
-moz-box-sizing: border-box;
box-sizing: border-box;
padding: 10px;
overflow: hidden;
text-overflow: ellipsis;
}
.no-outline{
.no-outline {
border: 0;
}
.no-outline:focus,
.no-outline:active,
.no-outline:hover{
.no-outline:focus,
.no-outline:active,
.no-outline:hover {
background-color: transparent;
color: #000;
}
#showMore{
#showMore {
padding: 20px;
margin: 10px;
margin: 10px;
border-top: 2px solid #F2F2F2;
}
.watch-view-count {
line-height: 24px;
max-height: 24px;
@ -256,26 +249,25 @@ footer .btn-outline {
padding: -5px;
border-bottom: 2px solid #167ac6;
}
#likeBtn.myVote span, #likeBtn.myVote small {
#likeBtn.myVote span,
#likeBtn.myVote small {
color: #167ac6;
}
#dislikeBtn.myVote span, #dislikeBtn.myVote small {
#dislikeBtn.myVote span,
#dislikeBtn.myVote small {
color: #444;
}
/* fancy checkbox */
.material-switch > input[type="checkbox"] {
display: none;
display: none;
}
.material-switch > label {
cursor: pointer;
height: 0px;
position: relative;
width: 40px;
position: relative;
width: 40px;
}
.material-switch > label::before {
background: rgb(0, 0, 0);
box-shadow: inset 0px 0px 10px rgba(0, 0, 0, 0.5);
@ -283,7 +275,7 @@ footer .btn-outline {
content: '';
height: 16px;
margin-top: -8px;
position:absolute;
position: absolute;
opacity: 0.3;
transition: all 0.4s ease-in-out;
width: 40px;
@ -311,34 +303,34 @@ footer .btn-outline {
}
/* fancy checkbox end */
.label.fix-width {
min-width: 130px !important;
display: inline-block !important;
text-align: left;
border-top-left-radius: 0;
border-bottom-left-radius: 0;
}
}
.label.fix-width.label-primary {
min-width: 70px !important;
text-align: right;
border-top-right-radius: 0;
border-bottom-right-radius: 0;
border-top-left-radius: 0.25em;;
border-bottom-left-radius: 0.25em;;
border-top-left-radius: 0.25em;
;
border-bottom-left-radius: 0.25em;
;
}
.popover-content, .popover-title, .popover{
color:#333 !important;
.popover-content,
.popover-title,
.popover {
color: #333 !important;
}
.videosDetails{
.videosDetails {
padding-left: 20px;
}
.divMainVideo .duration{
.divMainVideo .duration {
position: absolute;
background: rgba(0,0, 0, 0.6)!important;
background: rgba(0, 0, 0, 0.6)!important;
padding: 3px;
color: #FFF;
bottom: 5px;
@ -346,10 +338,9 @@ footer .btn-outline {
font-size: 0.9em;
border-radius: 5px;
}
.gallery .duration{
.gallery .duration {
position: absolute;
background: rgba(0,0, 0, 0.6)!important;
background: rgba(0, 0, 0, 0.6)!important;
padding: 3px;
color: #FFF;
top: 5px;
@ -357,96 +348,111 @@ footer .btn-outline {
font-size: 0.9em;
border-radius: 5px;
}
.gallery h2, .videosDetails .title{
.gallery h2,
.videosDetails .title {
font-size: 1em;
margin: 0;
padding: 0;
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
line-height: 16px; /* fallback */
max-height: 32px; /* fallback */
min-height: 32px; /* fallback */
line-height: 16px; /* fallback */
max-height: 32px; /* fallback */
min-height: 32px; /* fallback */
-webkit-line-clamp: 2; /* number of lines to show */
-webkit-box-orient: vertical;
}
.gallery .watch-view-count{
.gallery .watch-view-count {
font-size: 0.8em;
font-weight: normal;
border: 0;
margin: 0;
padding: 0;
}
.galleryVideo{
.galleryVideo {
overflow: hidden;
height: 190px;
border-bottom: solid 1px #EEE;
margin-bottom: 10px;
}
.galleryVideo .group {
overflow: hidden;
text-overflow: ellipsis;
}
.autoplay span span{
.autoplay span span {
margin: 0 5px;
font-weight: bold;
}
img.rotate90,
img.rotate-270 {
transform: rotate(90deg);
-ms-transform: rotate(90deg);
/* IE 9 */
-moz-transform: rotate(90deg);
/* Firefox */
img.rotate90, img.rotate-270{
transform:rotate(90deg);
-ms-transform:rotate(90deg); /* IE 9 */
-moz-transform:rotate(90deg); /* Firefox */
-webkit-transform:rotate(90deg); /* Safari and Chrome */
-o-transform:rotate(90deg); /* Opera */
}
img.rotate180, img.rotate-180{
transform:rotate(180deg);
-ms-transform:rotate(180deg); /* IE 9 */
-moz-transform:rotate(180deg); /* Firefox */
-webkit-transform:rotate(180deg); /* Safari and Chrome */
-o-transform:rotate(180deg); /* Opera */
}
img.rotate270, img.rotate-90{
transform:rotate(270deg);
-ms-transform:rotate(270deg); /* IE 9 */
-moz-transform:rotate(270deg); /* Firefox */
-webkit-transform:rotate(270deg); /* Safari and Chrome */
-o-transform:rotate(270deg); /* Opera */
}
-webkit-transform: rotate(90deg);
/* Safari and Chrome */
.subscribeButton{
-o-transform: rotate(90deg);
/* Opera */
}
img.rotate180,
img.rotate-180 {
transform: rotate(180deg);
-ms-transform: rotate(180deg);
/* IE 9 */
-moz-transform: rotate(180deg);
/* Firefox */
-webkit-transform: rotate(180deg);
/* Safari and Chrome */
-o-transform: rotate(180deg);
/* Opera */
}
img.rotate270,
img.rotate-90 {
transform: rotate(270deg);
-ms-transform: rotate(270deg);
/* IE 9 */
-moz-transform: rotate(270deg);
/* Firefox */
-webkit-transform: rotate(270deg);
/* Safari and Chrome */
-o-transform: rotate(270deg);
/* Opera */
}
.subscribeButton {
background-color: #e62117;
color: #FFF;
}
.subscribeButton:hover, .subscribeButton:active, .subscribeButton:focus{
.subscribeButton:hover,
.subscribeButton:active,
.subscribeButton:focus {
background-color: #CC0000;
color: #FFF;
}
.subscribeButton span:before {
content: "\f16a";
}
.subscribeButton.subscribed{
.subscribeButton.subscribed {
background-color: #DDD;
color: #777;
}
.subscribeButton.subscribed span:before {
content: "\f00c";
}
.subscribeButton.subscribed:hover span:before {
content: "\f057";
}
.profileBg{
.profileBg {
padding: 20px;
min-height: 200px;
margin: 10px 0;
@ -455,16 +461,14 @@ img.rotate270, img.rotate-90{
-o-background-size: cover;
background-size: cover;
}
#sidebar{
#sidebar {
width: 300px;
position: absolute;
top: 0;
height: 100vh;
margin-top: 55px;
}
#sideBarContainer{
#sideBarContainer {
overflow-y: auto;
position: absolute;
left: 0;
@ -472,7 +476,7 @@ img.rotate270, img.rotate-90{
height: 100%;
width: 100%;
}
#sideBarContainer ul{
#sideBarContainer ul {
margin-bottom: 150px;
}
.navbar-brand {
@ -483,17 +487,16 @@ img.rotate270, img.rotate-90{
.navbar-brand>img {
width: 120px;
}
.list-inline {
display: flex;
justify-content: left;
}
footer ul.list-inline{
footer ul.list-inline {
justify-content: center;
}
footer ul.list-inline li{
footer ul.list-inline li {
justify-content: center;
align-items: center;
align-items: center;
}
/** header **/
@ -504,57 +507,54 @@ nav ul.items-container {
padding: 0px;
}
nav ul.items-container,
nav ul.items-container li{
nav ul.items-container li {
list-style: none;
}
nav ul.items-container li:first-child{
nav ul.items-container li:first-child {
flex: 1;
display: flex;
}
nav ul.items-container li:first-child ul.left-side{
nav ul.items-container li:first-child ul.left-side {
display: flex;
align-items: center
}
nav ul.items-container li:last-child{
nav ul.items-container li:last-child {
margin-right: 20px;
}
nav ul.items-container li ul.right-menus {
display: flex;
flex-direction: row;
}
nav ul.items-container li ul.right-menus li{
nav ul.items-container li ul.right-menus li {
margin-left: 20px;
}
/** header **/
.navbar .container{
padding: 0 2px;
.navbar .container {
padding: 0 2px;
align-items: center;
}
.list-inline > li {
display: flex;
}
.navbar .list-inline{
.navbar .list-inline {
margin: 0;
display: flex;
align-items: center;
}
/* Play List */
.playlistList{
.playlistList {
height: 400px;
overflow: hidden;
}
.playlistList .nav{
.playlistList .nav {
overflow-y: auto;
position: absolute;
top: 0;
height: 100%;
overflow-x: hidden;
}
.playlist-nav .navbar {
padding: 0;
max-height: none;
@ -574,7 +574,7 @@ nav ul.items-container li ul.right-menus li{
}
/* End Play List */
.floatVideo{
.floatVideo {
position: fixed !important;
width: 550px;
top: 70px;
@ -582,15 +582,15 @@ nav ul.items-container li ul.right-menus li{
z-index: 100;
overflow: visible;
}
.floatVideo #main-video{
-webkit-box-shadow: 2px 0px 19px 2px rgba(0,0,0,1);
-moz-box-shadow: 2px 0px 19px 2px rgba(0,0,0,1);
box-shadow: 2px 0px 19px 2px rgba(0,0,0,1);
.floatVideo #main-video {
-webkit-box-shadow: 2px 0px 19px 2px rgba(0, 0, 0, 1);
-moz-box-shadow: 2px 0px 19px 2px rgba(0, 0, 0, 1);
box-shadow: 2px 0px 19px 2px rgba(0, 0, 0, 1);
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
border-radius: 5px;
}
#floatButtons{
#floatButtons {
z-index: 110;
position: absolute;
right: -10px;
@ -598,21 +598,21 @@ nav ul.items-container li ul.right-menus li{
}
#floatButtons .btn-outline:hover,
#floatButtons .btn-outline:focus,
#floatButtons .btn-outline:active{
color: rgba(255,255,255,1);
background-color: rgba(0,0,0,0.5);
#floatButtons .btn-outline:active {
color: rgba(255, 255, 255, 1);
background-color: rgba(0, 0, 0, 0.5);
}
#floatButtons .btn-outline {
color: rgba(255,255,255,0.3);
background-color: rgba(0,0,0,0.1);
color: rgba(255, 255, 255, 0.3);
background-color: rgba(0, 0, 0, 0.1);
transition: all 0.3s ease-in-out;
border-radius: 10px;
}
#videoContainer{
overflow: visible;
background: black;
#videoContainer {
overflow: visible;
background: black;
}
/** video manager progress bar */
.progress {
position: relative;
@ -632,7 +632,6 @@ nav ul.items-container li ul.right-menus li{
font-weight: 800;
padding: 3px 10px 2px;
}
.loader {
border: 5px solid #f3f3f3; /* Light grey */
border-top: 5px solid #3498db; /* Blue */
@ -641,57 +640,58 @@ nav ul.items-container li ul.right-menus li{
height: 30px;
animation: spin 2s linear infinite;
}
@keyframes spin {
0% { transform: rotate(0deg); }
100% { transform: rotate(360deg); }
0% {
transform: rotate(0deg);
}
100% {
transform: rotate(360deg);
}
}
@media (max-width: 1200px) {
.floatVideo{
.floatVideo {
width: 500px;
}
.galleryVideo{
.galleryVideo {
height: 195px;
}
}
@media (max-width: 992px) {
.floatVideo{
.floatVideo {
width: 450px;
}
.galleryVideo{
.galleryVideo {
height: 220px;
}
}
@media (max-width: 850px) {
.galleryVideo{
.galleryVideo {
height: 180px;
}
}
@media (max-width: 768px) {
.galleryVideo{
.galleryVideo {
height: 290px;
}
}
@media (max-width: 650px) {
.galleryVideo{
.galleryVideo {
height: 250px;
}
}
@media (max-width: 500px) {
.floatVideo{
.floatVideo {
width: 380px;
}
.galleryVideo{
.galleryVideo {
height: 200px;
}
}
@media (max-width: 400px) {
.floatVideo{
.floatVideo {
width: 320px;
}
.galleryVideo{
.galleryVideo {
height: 180px;
}
}

View file

@ -1,10 +1,16 @@
.video-js .vjs-control-bar {
background: -moz-linear-gradient(top, rgba(0,0,0,0) 0%, rgba(0,0,0,0.65) 100%); /* FF3.6-15 */
background: -webkit-linear-gradient(top, rgba(0,0,0,0) 0%,rgba(0,0,0,0.65) 100%); /* Chrome10-25,Safari5.1-6 */
background: linear-gradient(to bottom, rgba(0,0,0,0) 0%,rgba(0,0,0,0.65) 100%); /* W3C, IE10+, FF16+, Chrome26+, Opera12+, Safari7+ */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#00000000', endColorstr='#a6000000',GradientType=0 ); /* IE6-9 */
}
background: -moz-linear-gradient(top, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.65) 100%);
/* FF3.6-15 */
background: -webkit-linear-gradient(top, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.65) 100%);
/* Chrome10-25,Safari5.1-6 */
background: linear-gradient(to bottom, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.65) 100%);
/* W3C, IE10+, FF16+, Chrome26+, Opera12+, Safari7+ */
filter: progid: DXImageTransform.Microsoft.gradient( startColorstr='#00000000', endColorstr='#a6000000', GradientType=0);
/* IE6-9 */
}
.video-js .vjs-play-progress {
color: #f12b24;
background-color: #f12b24;
@ -12,7 +18,6 @@ filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#00000000', e
.video-js:hover .vjs-play-progress {
font-size: 1em !important;
}
.video-js .vjs-big-play-button {
height: 1.5em;
width: 1.5em;
@ -20,106 +25,95 @@ filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#00000000', e
-moz-border-radius: 3em;
border-radius: 3em;
background-color: rgba(200, 200, 200, 0.1);
-webkit-transition: all 0.4s;
-moz-transition: all 0.4s;
-o-transition: all 0.4s;
transition: all 0.4s;
-webkit-transition: all 0.4s;
-moz-transition: all 0.4s;
-o-transition: all 0.4s;
transition: all 0.4s;
}
.video-js:hover .vjs-big-play-button,
.video-js .vjs-big-play-button:focus {
background-color: rgba(200, 200, 200, 0.3);
-webkit-transition: all 0.4s;
-moz-transition: all 0.4s;
-o-transition: all 0.4s;
transition: all 0.4s;
background-color: rgba(200, 200, 200, 0.3);
-webkit-transition: all 0.4s;
-moz-transition: all 0.4s;
-o-transition: all 0.4s;
transition: all 0.4s;
}
.video-js .vjs-mouse-display:after, .video-js .vjs-play-progress:after, .video-js .vjs-time-tooltip{
background: rgba(0,0, 0, 0.6)!important;
.video-js .vjs-mouse-display:after,
.video-js .vjs-play-progress:after,
.video-js .vjs-time-tooltip {
background: rgba(0, 0, 0, 0.6)!important;
padding: 2px;
color: #FFF;
font-size: 12px !important;
}
.video-js .vjs-load-progress {
background-color: rgba(159,159,159,.8);
background-color: rgba(159, 159, 159, .8);
}
.video-js .vjs-slider-horizontal {
background-color: rgba(159,159,159,.3);
background-color: rgba(159, 159, 159, .3);
}
.vjs-rotate90 {
rotate: 90;
zoom: 1.0;
}
/* Ad Elements */
#adUrl{
color: #DDD;
position: absolute;
left: 0;
top: 80%;
padding: 10px;
font-size: 12px;
text-shadow: -1px 0 #333, 0 1px #333, 1px 0 #333, 0 -1px #333, 0 0 0.3em black;
white-space: nowrap;
#adUrl {
color: #DDD;
position: absolute;
left: 0;
top: 80%;
padding: 10px;
font-size: 12px;
text-shadow: -1px 0 #333, 0 1px #333, 1px 0 #333, 0 -1px #333, 0 0 0.3em black;
white-space: nowrap;
}
#adUrl a{
color: #DDD;
#adUrl a {
color: #DDD;
}
#adUrl a:hover{
color: #FFF;
text-decoration: underline;
#adUrl a:hover {
color: #FFF;
text-decoration: underline;
}
#adButton{
background-color: rgba(0, 0, 0, 0.7);
-webkit-transition: all 0.4s;
-moz-transition: all 0.4s;
-o-transition: all 0.4s;
transition: all 0.4s;
color: #FFF;
border: 1px solid #888;
position: absolute;
right: 0;
top: 70%;
padding: 10px;
font-size: 16px;
#adButton {
background-color: rgba(0, 0, 0, 0.7);
-webkit-transition: all 0.4s;
-moz-transition: all 0.4s;
-o-transition: all 0.4s;
transition: all 0.4s;
color: #FFF;
border: 1px solid #888;
position: absolute;
right: 0;
top: 70%;
padding: 10px;
font-size: 16px;
}
#adButton:hover{
background-color: rgba(0, 0, 0, 0.9);
border: 1px solid #DDD;
#adButton:hover {
background-color: rgba(0, 0, 0, 0.9);
border: 1px solid #DDD;
}
.adControl{
.adControl {
display: none;
}
.ad .video-js .vjs-play-progress {
color: #FC0;
color: #FC0;
background-color: #FC0;
}
.ad .vjs-progress-control *{
.ad .vjs-progress-control * {
pointer-events: none !important;
}
.ad .adControl{
.ad .adControl {
display: block;
}
/* End Ad Elements */
.img-portrait {
transform: scale(0.56) rotate(90deg);
transform: scale(0.56) rotate(90deg);
}
.embed-responsive-9by16 {
padding-bottom: 100%;
padding-bottom: 100%;
}
.video-js.vjs-9-16 {
padding-top: 100%;
}
padding-top: 100%;
}

View file

@ -1,5 +1,3 @@
/*=========================
Icons
================= */
@ -16,76 +14,77 @@ ul.social-network li {
margin: 0 5px;
}
/* footer social icons */
.social-network a.icoRss:hover {
background-color: #F56505;
background-color: #F56505;
}
.social-network a.icoFacebook:hover {
background-color:#3B5998;
background-color: #3B5998;
}
.social-network a.icoTwitter:hover {
background-color:#33ccff;
background-color: #33ccff;
}
.social-network a.icoGoogle:hover {
background-color:#BD3518;
background-color: #BD3518;
}
.social-network a.icoVimeo:hover {
background-color:#0590B8;
background-color: #0590B8;
}
.social-network a.icoLinkedin:hover {
background-color:#007bb7;
background-color: #007bb7;
}
.social-network a.icoRss:hover i, .social-network a.icoFacebook:hover i, .social-network a.icoTwitter:hover i,
.social-network a.icoGoogle:hover i, .social-network a.icoVimeo:hover i, .social-network a.icoLinkedin:hover i {
color:#fff;
.social-network a.icoRss:hover i,
.social-network a.icoFacebook:hover i,
.social-network a.icoTwitter:hover i,
.social-network a.icoGoogle:hover i,
.social-network a.icoVimeo:hover i,
.social-network a.icoLinkedin:hover i {
color: #fff;
}
a.socialIcon:hover, .socialHoverClass {
color:#44BCDD;
a.socialIcon:hover,
.socialHoverClass {
color: #44BCDD;
}
.social-circle li a {
display:inline-block;
position:relative;
margin:0 auto 0 auto;
-moz-border-radius:50%;
-webkit-border-radius:50%;
border-radius:50%;
text-align:center;
width: 30px;
height: 30px;
font-size:15px;
display: inline-block;
position: relative;
margin: 0 auto 0 auto;
-moz-border-radius: 50%;
-webkit-border-radius: 50%;
border-radius: 50%;
text-align: center;
width: 30px;
height: 30px;
font-size: 15px;
}
.social-circle li i {
margin:0;
line-height:30px;
text-align: center;
margin: 0;
line-height: 30px;
text-align: center;
}
.social-circle li a:hover i, .triggeredHover {
-moz-transform: rotate(360deg);
-webkit-transform: rotate(360deg);
-ms--transform: rotate(360deg);
transform: rotate(360deg);
-webkit-transition: all 0.2s;
-moz-transition: all 0.2s;
-o-transition: all 0.2s;
-ms-transition: all 0.2s;
transition: all 0.2s;
.social-circle li a:hover i,
.triggeredHover {
-moz-transform: rotate(360deg);
-webkit-transform: rotate(360deg);
-ms--transform: rotate(360deg);
transform: rotate(360deg);
-webkit-transition: all 0.2s;
-moz-transition: all 0.2s;
-o-transition: all 0.2s;
-ms-transition: all 0.2s;
transition: all 0.2s;
}
.social-circle i {
color: #fff;
-webkit-transition: all 0.8s;
-moz-transition: all 0.8s;
-o-transition: all 0.8s;
-ms-transition: all 0.8s;
transition: all 0.8s;
color: #fff;
-webkit-transition: all 0.8s;
-moz-transition: all 0.8s;
-o-transition: all 0.8s;
-ms-transition: all 0.8s;
transition: all 0.8s;
}.social-circle a {
background-color: #D3D3D3;
}
.social-circle a {
background-color: #D3D3D3;
}
#shareDiv, #shareDiv .tabbable-panel{
#shareDiv,
#shareDiv .tabbable-panel {
border-width: 0;
}
}

View file

@ -53,7 +53,7 @@ function isYoutubeDl() {
<legend><?php echo __("Download Video"); ?></legend>
<div class="form-group">
<label class="col-md-4 control-label"><?php echo __("Video URL"); ?></label>
<label class="col-md-4 control-label"><?php echo __("Video URL"); ?></label>
<div class="col-md-8 inputGroupContainer">
<div class="input-group">
<span class="input-group-addon"><i class="glyphicon glyphicon-film"></i></span>
@ -63,7 +63,7 @@ function isYoutubeDl() {
</div>
<!-- TODO audio only -->
<div class="form-group" style="display: none">
<label class="col-md-4 control-label"><?php echo __("Audio only"); ?></label>
<label class="col-md-4 control-label"><?php echo __("Audio only"); ?></label>
<div class="col-md-8 inputGroupContainer">
<div class="input-group">
<span class="input-group-addon"><i class="glyphicon glyphicon-headphones"></i></span>
@ -91,7 +91,7 @@ function isYoutubeDl() {
$minutesTotal = getMinutesTotalVideosLength();
?>
<div class="alert alert-warning">
<?php printf(__("Make sure that the video you are going to download has a duration of less than %d minute(s)!"), ($global['videoStorageLimitMinutes']-$minutesTotal)); ?>
<?php printf(__("Make sure that the video you are going to download has a duration of less than %d minute(s)!"), ($global['videoStorageLimitMinutes']-$minutesTotal)); ?>
</div>
<?php
}

View file

@ -7,7 +7,7 @@
<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>
</audio>
</div>
</div>
<div class="col-xs-12 col-sm-12 col-lg-2"></div>
</div><!--/row-->

View file

@ -8,20 +8,20 @@ require_once '../../videos/configuration.php';
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<title><?php echo $config->getWebSiteTitle(); ?></title>
<style type="text/css">
</style>
</head>
<body leftmargin="10" rightmargin="10" marginwidth="10" topmargin="10" bottommargin="10" marginheight="10" offset="0" bgcolor="#f0f1f4">
<table width="80%" cellpadding="10" cellspacing="0" border="0" align="center" bgcolor="#FFF" style="margin:0 auto;">
<tr>
<td align="center"><img src="<?php echo $global['webSiteRootURL'], $config->getLogo(); ?>" alt="<?php echo $config->getWebSiteTitle(); ?>"/></td>
</tr>
</tr>
<tr>
<td>{message}</td>
</tr>
</tr>
<tr>
<td></td>
</tr>
</tr>
</table>
</body>
</html>

View file

@ -16,9 +16,9 @@
<script src="<?php echo $global['webSiteRootURL']; ?>js/jquery-3.2.0.min.js" type="text/javascript"></script>
<script>
var webSiteRootURL = '<?php echo $global['webSiteRootURL']; ?>';
</script>
</script>
<?php
if(!$config->getDisable_analytics()){
if (!$config->getDisable_analytics()) {
?>
<script>
// YouPHPTube Analytics
@ -36,7 +36,7 @@ if(!$config->getDisable_analytics()){
ga('create', 'UA-96597943-1', 'auto', 'youPHPTube');
ga('youPHPTube.send', 'pageview');
</script>
</script>
<?php
}
echo $config->getHead();

View file

@ -50,7 +50,7 @@ if (empty($_SESSION['language'])) {
<?php
if (User::canUpload()) {
?>
?>
<li>
<a href="<?php echo $global['webSiteRootURL']; ?>upload" class="btn btn-default navbar-btn pull-left" data-toggle="tooltip" title="<?php echo __("Upload a MP4 video"); ?>" data-placement="bottom" ><span class="fa fa-video-camera"></span></a>
</li>
@ -109,11 +109,11 @@ if (empty($_SESSION['language'])) {
<ul class="nav navbar">
<?php
if (User::isLogged()) {
?>
?>
<li>
<div>
<a href="<?php echo $global['webSiteRootURL']; ?>logoff" class="btn btn-default btn-xs btn-block">
<span class="glyphicon glyphicon-log-out"></span>
<span class="glyphicon glyphicon-log-out"></span>
<?php echo __("Logoff"); ?>
</a>
</div>
@ -132,7 +132,7 @@ if (empty($_SESSION['language'])) {
<div>
<a href="<?php echo $global['webSiteRootURL']; ?>user" class="btn btn-primary btn-xs btn-block">
<span class="fa fa-user-circle"></span>
<span class="fa fa-user-circle"></span>
<?php echo __("My Account"); ?>
</a>
@ -143,7 +143,7 @@ if (empty($_SESSION['language'])) {
<div>
<a href="<?php echo $global['webSiteRootURL']; ?>channel/<?php echo User::getId(); ?>" class="btn btn-danger btn-xs btn-block">
<span class="fa fa-youtube-play"></span>
<span class="fa fa-youtube-play"></span>
<?php echo __("My Channel"); ?>
</a>
@ -156,8 +156,8 @@ if (empty($_SESSION['language'])) {
<li>
<div>
<a href="<?php echo $global['webSiteRootURL']; ?>mvideos" class="btn btn-success btn-xs btn-block">
<span class="glyphicon glyphicon-film"></span>
<span class="glyphicon glyphicon-headphones"></span>
<span class="glyphicon glyphicon-film"></span>
<span class="glyphicon glyphicon-headphones"></span>
<?php echo __("My videos"); ?>
</a>
</div>
@ -165,7 +165,7 @@ if (empty($_SESSION['language'])) {
<li>
<div>
<a href="<?php echo $global['webSiteRootURL']; ?>charts" class="btn btn-info btn-xs btn-block">
<span class="fa fa-bar-chart"></span>
<span class="fa fa-bar-chart"></span>
<?php echo __("Video Statistics"); ?>
</a>
</div>
@ -173,7 +173,7 @@ if (empty($_SESSION['language'])) {
<li>
<div>
<a href="<?php echo $global['webSiteRootURL']; ?>subscribes" class="btn btn-warning btn-xs btn-block">
<span class="fa fa-check"></span>
<span class="fa fa-check"></span>
<?php echo __("Subscriptions"); ?>
</a>
</div>
@ -191,43 +191,43 @@ if (empty($_SESSION['language'])) {
</li>
<li>
<a href="<?php echo $global['webSiteRootURL']; ?>users">
<span class="glyphicon glyphicon-user"></span>
<span class="glyphicon glyphicon-user"></span>
<?php echo __("Users"); ?>
</a>
</li>
<li>
<a href="<?php echo $global['webSiteRootURL']; ?>usersGroups">
<span class="fa fa-users"></span>
<span class="fa fa-users"></span>
<?php echo __("Users Groups"); ?>
</a>
</li>
<li>
<a href="<?php echo $global['webSiteRootURL']; ?>ads">
<span class="fa fa-money"></span>
<span class="fa fa-money"></span>
<?php echo __("Video Advertising"); ?>
</a>
</li>
<li>
<a href="<?php echo $global['webSiteRootURL']; ?>categories">
<span class="glyphicon glyphicon-list"></span>
<span class="glyphicon glyphicon-list"></span>
<?php echo __("Categories"); ?>
</a>
</li>
<li>
<a href="<?php echo $global['webSiteRootURL']; ?>update">
<span class="glyphicon glyphicon-refresh"></span>
<span class="glyphicon glyphicon-refresh"></span>
<?php echo __("Update version"); ?>
</a>
</li>
<li>
<a href="<?php echo $global['webSiteRootURL']; ?>siteConfigurations">
<span class="glyphicon glyphicon-cog"></span>
<span class="glyphicon glyphicon-cog"></span>
<?php echo __("Site Configurations"); ?>
</a>
</li>
<li>
<a href="<?php echo $global['webSiteRootURL']; ?>locale">
<span class="glyphicon glyphicon-flag"></span>
<span class="glyphicon glyphicon-flag"></span>
<?php echo __("Create more translations"); ?>
</a>
</li>
@ -240,7 +240,7 @@ if (empty($_SESSION['language'])) {
<li>
<div>
<a href="<?php echo $global['webSiteRootURL']; ?>user" class="btn btn-success btn-block">
<span class="glyphicon glyphicon-log-in"></span>
<span class="glyphicon glyphicon-log-in"></span>
<?php echo __("Login"); ?>
</a>
</div>
@ -252,22 +252,22 @@ if (empty($_SESSION['language'])) {
<li>
<hr>
</li>
</li>
<li class="nav-item <?php echo empty($_SESSION['type']) ? "active" : ""; ?>">
<a class="nav-link " href="<?php echo $global['webSiteRootURL']; ?>?type=all">
<span class="glyphicon glyphicon-star"></span>
<span class="glyphicon glyphicon-star"></span>
<?php echo __("Audios and Videos"); ?>
</a>
</li>
<li class="nav-item <?php echo (!empty($_SESSION['type']) && $_SESSION['type'] == 'video' && empty($_GET['catName'])) ? "active" : ""; ?>">
<a class="nav-link " href="<?php echo $global['webSiteRootURL']; ?>videoOnly">
<span class="glyphicon glyphicon-facetime-video"></span>
<span class="glyphicon glyphicon-facetime-video"></span>
<?php echo __("Videos"); ?>
</a>
</li>
<li class="nav-item <?php echo (!empty($_SESSION['type']) && $_SESSION['type'] == 'audio' && empty($_GET['catName'])) ? "active" : ""; ?>">
<a class="nav-link" href="<?php echo $global['webSiteRootURL']; ?>audioOnly">
<span class="glyphicon glyphicon-headphones"></span>
<span class="glyphicon glyphicon-headphones"></span>
<?php echo __("Audios"); ?>
</a>
</li>
@ -292,13 +292,13 @@ if (empty($_SESSION['language'])) {
</li>
<li>
<a href="<?php echo $global['webSiteRootURL']; ?>about">
<span class="glyphicon glyphicon-info-sign"></span>
<span class="glyphicon glyphicon-info-sign"></span>
<?php echo __("About"); ?>
</a>
</li>
<li>
<a href="<?php echo $global['webSiteRootURL']; ?>contact">
<span class="glyphicon glyphicon-comment"></span>
<span class="glyphicon glyphicon-comment"></span>
<?php echo __("Contact"); ?>
</a>
</li>

View file

@ -29,11 +29,10 @@ $playlistVideos = PlayList::getVideosFromPlaylist($playlist_id);
foreach ($playlistVideos as $value) {
$class = "";
$indicator = $count+1;
if($count==$playlist_index){
if ($count==$playlist_index) {
$class .= " active";
$indicator = '<span class="fa fa-play text-danger"></span>';
}
}
?>
<li class="<?php echo $class; ?>">
<a href="<?php echo $global['webSiteRootURL']; ?>playlist/<?php echo $playlist_id; ?>/<?php echo $count; ?>" title="<?php echo $value['title']; ?>" class="videoLink row">
@ -64,7 +63,7 @@ $playlistVideos = PlayList::getVideosFromPlaylist($playlist_id);
<div class="text-uppercase row"><strong itemprop="name" class="title"><?php echo $value['title']; ?></strong></div>
<div class="details row" itemprop="description">
<div>
<span class="<?php echo $value['iconClass']; ?>"></span>
<span class="<?php echo $value['iconClass']; ?>"></span>
</div>
<div>
<strong class=""><?php echo number_format($value['views_count'], 0); ?></strong> <?php echo __("Views"); ?>
@ -72,8 +71,8 @@ $playlistVideos = PlayList::getVideosFromPlaylist($playlist_id);
</div>
</div>
</a>
</li>
</a>
</li>
<?php
$count++;
}

View file

@ -34,8 +34,8 @@ if (!empty($ad)) {
echo " ad";
}
?>">
<video poster="<?php echo $poster; ?>" controls crossorigin
class="embed-responsive-item video-js vjs-default-skin <?php echo $vjsClass; ?> vjs-big-play-centered"
<video poster="<?php echo $poster; ?>" controls crossorigin
class="embed-responsive-item video-js vjs-default-skin <?php echo $vjsClass; ?> vjs-big-play-centered"
id="mainVideo" data-setup='{ aspectRatio: "<?php echo $aspectRatio; ?>" }'>
<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">
@ -46,7 +46,7 @@ if (!empty($ad)) {
</p>
</video>
<?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>
<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'];
@ -57,7 +57,7 @@ if (!empty($ad)) {
<?php } ?>
</div>
</div>
</div>
</div>
<div class="col-xs-12 col-sm-12 col-lg-2"></div>
</div><!--/row-->

View file

@ -67,7 +67,7 @@ $userGroups = UserGroups::getAllUsersGroups();
<div class="form-group">
<label for="inputAdTitle" ><?php echo __("Advertising Title"); ?></label>
<input type="text" id="inputAdTitle" class="form-control " placeholder="<?php echo __("Advertising Title"); ?>" required autofocus>
<input type="text" id="inputAdTitle" class="form-control " placeholder="<?php echo __("Advertising Title"); ?>" required autofocus>
</div>
<div class="form-group">
@ -75,7 +75,7 @@ $userGroups = UserGroups::getAllUsersGroups();
<input type="url" id="inputAdUrlRedirect" pattern="https?://.+" class="form-control " placeholder="<?php echo __("URL"); ?>" required >
</div>
<div class="form-group">
<label for="inputAdStarts"><?php echo __("Starts on"); ?></label>
<label for="inputAdStarts"><?php echo __("Starts on"); ?></label>
<input type="text" id="inputAdStarts" class="form-control datepicker" placeholder="<?php echo __("Starts on"); ?>" required >
<small>Leave Blank for Right Now</small>
</div>
@ -102,7 +102,7 @@ $userGroups = UserGroups::getAllUsersGroups();
<small>Leave Blank for Never</small>
</div>
<div class="form-group">
<label for="inputAdCategory" ><?php echo __("Category to display this Ad"); ?></label>
<label for="inputAdCategory" ><?php echo __("Category to display this Ad"); ?></label>
<select class="form-control last" id="inputAdCategory" required>
<?php
foreach ($categories as $value) {

View file

@ -22,10 +22,10 @@ if (!User::canUpload()) {
?>
<div class="container">
<div class="col-lg-9">
<div class="col-lg-9">
<textarea id="emailMessage" placeholder="Enter text ..." style="width: 100%;"></textarea>
</div>
<div class="col-lg-3">
<div class="col-lg-3">
<button type="button" class="btn btn-success" id="sendSubscribeBtn">
<span class="fa fa-envelope-o" aria-hidden="true"></span> <?php echo __("Notify Subscribers"); ?>
</button>
@ -73,7 +73,7 @@ if (!User::canUpload()) {
}
});
}
function notify(){
modal.showPleaseWait();
$.ajax({

View file

@ -189,7 +189,7 @@ $userGroups = UserGroups::getAllUsersGroups();
closeOnConfirm: false
},
function () {
modal.showPleaseWait();
$.ajax({
url: 'deleteUser',

View file

@ -21,7 +21,7 @@ $userGroups = UserGroups::getAllUsersGroups();
?>
<link href="<?php echo $global['webSiteRootURL']; ?>js/bootstrap-datetimepicker/css/bootstrap-datetimepicker.min.css" rel="stylesheet" type="text/css"/>
<link href="js/bootstrap-fileinput/css/fileinput.min.css" rel="stylesheet" type="text/css"/>
<script src="js/bootstrap-fileinput/js/fileinput.min.js" type="text/javascript"></script>
<script src="js/bootstrap-fileinput/js/fileinput.min.js" type="text/javascript"></script>
</head>
<body>
@ -39,15 +39,15 @@ $userGroups = UserGroups::getAllUsersGroups();
<span class="fa fa-user"></span> <?php echo __("Users"); ?>
</a>
<a href="<?php echo $global['webSiteRootURL']; ?>charts" class="btn btn-info">
<span class="fa fa-bar-chart"></span>
<span class="fa fa-bar-chart"></span>
<?php echo __("Video Chart"); ?>
</a>
<a href="<?php echo $config->getEncoderURL(), "?webSiteRootURL=", urlencode($global['webSiteRootURL']), "&user=", urlencode(User::getUserName()), "&pass=", urlencode(User::getUserPass()); ?>" class="btn btn-default">
<span class="fa fa-upload"></span>
<span class="fa fa-upload"></span>
<?php echo __("Encoder Site"); ?>
</a>
<a href="<?php echo $global['webSiteRootURL']; ?>upload" class="btn btn-default">
<span class="fa fa-video-camera"></span>
<span class="fa fa-video-camera"></span>
<?php echo __("Upload a MP4 File"); ?>
</a>
@ -80,7 +80,7 @@ $userGroups = UserGroups::getAllUsersGroups();
}
?> and you have <?php echo $global['videoStorageLimitMinutes']; ?> minutes of storage
<div class="progress">
<div class="progress-bar progress-bar-success progress-bar-striped" role="progressbar"
<div class="progress-bar progress-bar-success progress-bar-striped" role="progressbar"
aria-valuenow="<?php echo $percent; ?>" aria-valuemin="0" aria-valuemax="100" style="width: <?php echo $percent; ?>%">
<?php echo $percent; ?>% of your storage limit used
</div>

View file

@ -58,7 +58,7 @@ $totalPages = ceil($total / $_POST['rowCount']);
<?php
echo $config->getAdsense();
?>
</div>
</div>
<div class="container-fluid gallery" itemscope itemtype="http://schema.org/VideoObject">
<div class="col-xs-12 col-sm-1 col-md-1 col-lg-1"></div>
<div class="col-xs-12 col-sm-10 col-md-10 col-lg-10 list-group-item">
@ -82,13 +82,13 @@ $totalPages = ceil($total / $_POST['rowCount']);
} else {
$poster = "{$global['webSiteRootURL']}view/img/audio_wave.jpg";
}
?>
?>
<img src="<?php echo $poster; ?>" alt="<?php echo $value['title']; ?>" class="thumbsJPG img img-responsive <?php echo $img_portrait; ?> rotate<?php echo $value['rotation']; ?>" />
<?php
if (!empty($imgGif)) {
?>
<img 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 } ?>
<span class="duration"><?php echo Video::getCleanDuration($value['duration']); ?></span>
</a>
<a href="<?php echo $global['webSiteRootURL']; ?>video/<?php echo $value['clean_title']; ?>" title="<?php echo $value['title']; ?>">
@ -108,7 +108,7 @@ $totalPages = ceil($total / $_POST['rowCount']);
</div>
<?php
}
?>
?>
</div>
<div class="row">
@ -135,7 +135,7 @@ $totalPages = ceil($total / $_POST['rowCount']);
<div class="alert alert-warning">
<span class="glyphicon glyphicon-facetime-video"></span> <strong><?php echo __("Warning"); ?>!</strong> <?php echo __("We have not found any videos or audios to show"); ?>.
</div>
<?php } ?>
<?php } ?>
</div>
<div class="col-xs-12 col-sm-1 col-md-1 col-lg-1"></div>

View file

@ -132,7 +132,7 @@ if (!empty($video)) {
<div class="row bgWhite list-group-item">
<div class="row divMainVideo">
<div class="col-xs-4 col-sm-4 col-lg-4">
<img src="<?php echo $poster; ?>" alt="<?php echo str_replace('"', '', $video['title']); ?>" class="img img-responsive <?php echo $img_portrait; ?> rotate<?php echo $video['rotation']; ?>" height="130" itemprop="thumbnail" />
<img src="<?php echo $poster; ?>" alt="<?php echo str_replace('"', '', $video['title']); ?>" class="img img-responsive <?php echo $img_portrait; ?> rotate<?php echo $video['rotation']; ?>" height="130" itemprop="thumbnail" />
<time class="duration" itemprop="duration" datetime="<?php echo Video::getItemPropDuration($video['duration']); ?>" ><?php echo Video::getCleanDuration($video['duration']); ?></time>
<meta itemprop="thumbnailUrl" content="<?php echo $img; ?>" />
<meta itemprop="contentURL" content="<?php echo $global['webSiteRootURL'], $catLink, "video/", $video['clean_title']; ?>" />
@ -158,7 +158,7 @@ if (!empty($video)) {
</h1>
<div class="col-xs-12 col-sm-12 col-lg-12"><?php echo $video['creator']; ?></div>
<span class="watch-view-count pull-right text-muted" itemprop="interactionCount"><?php echo number_format($video['views_count'], 0); ?> <?php echo __("Views"); ?></span>
</div>
</div>
</div>
<div class="row">
@ -189,7 +189,7 @@ if (!empty($video)) {
<input id="publicPlayList" name="publicPlayList" type="checkbox" checked="checked"/>
<label for="publicPlayList" class="label-success"></label>
</div>
</div>
</div>
<div class="form-group">
<button class="btn btn-success btn-block" id="addPlayList" ><?php echo __("Create a New Play List"); ?></button>
</div>
@ -202,7 +202,7 @@ if (!empty($video)) {
Sign in to add this video to a playlist.
<a href="<?php echo $global['webSiteRootURL']; ?>user" class="btn btn-primary">
<span class="glyphicon glyphicon-log-in"></span>
<span class="glyphicon glyphicon-log-in"></span>
<?php echo __("Login"); ?>
</a>
<?php
@ -287,7 +287,7 @@ if (!empty($video)) {
<a href="#" class="btn btn-default no-outline" id="shareBtn">
<span class="fa fa-share"></span> <?php echo __("Share"); ?>
</a>
<a href="#" class="btn btn-default no-outline pull-right <?php echo ($video['myVote'] == -1) ? "myVote" : "" ?>" id="dislikeBtn"
<a href="#" class="btn btn-default no-outline pull-right <?php echo ($video['myVote'] == -1) ? "myVote" : "" ?>" id="dislikeBtn"
<?php
if (!User::isLogged()) {
?>
@ -295,7 +295,7 @@ if (!empty($video)) {
<?php } ?>>
<span class="fa fa-thumbs-down"></span> <small><?php echo $video['dislikes']; ?></small>
</a>
<a href="#" class="btn btn-default no-outline pull-right <?php echo ($video['myVote'] == 1) ? "myVote" : "" ?>" id="likeBtn"
<a href="#" class="btn btn-default no-outline pull-right <?php echo ($video['myVote'] == 1) ? "myVote" : "" ?>" id="likeBtn"
<?php
if (!User::isLogged()) {
?>
@ -351,19 +351,19 @@ if (!empty($video)) {
<ul class="nav nav-tabs">
<li class="nav-item">
<a class="nav-link " href="#tabShare" data-toggle="tab">
<span class="fa fa-share"></span>
<span class="fa fa-share"></span>
<?php echo __("Share"); ?>
</a>
</li>
<li class="nav-item">
<a class="nav-link " href="#tabEmbeded" data-toggle="tab">
<span class="fa fa-code"></span>
<span class="fa fa-code"></span>
<?php echo __("Embeded"); ?>
</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#tabEmail" data-toggle="tab">
<span class="fa fa-envelope"></span>
<span class="fa fa-envelope"></span>
<?php echo __("E-mail"); ?>
</a>
</li>
@ -408,7 +408,7 @@ if (!empty($video)) {
<fieldset>
<!-- Text input-->
<div class="form-group">
<label class="col-md-4 control-label"><?php echo __("E-mail"); ?></label>
<label class="col-md-4 control-label"><?php echo __("E-mail"); ?></label>
<div class="col-md-8 inputGroupContainer">
<div class="input-group">
<span class="input-group-addon"><i class="glyphicon glyphicon-envelope"></i></span>
@ -431,7 +431,7 @@ if (!empty($video)) {
<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="input-group">
<span class="input-group-addon"><img src="<?php echo $global['webSiteRootURL']; ?>captcha" id="captcha"></span>
@ -485,7 +485,7 @@ if (!empty($video)) {
</div>
</div>
</div>
</div>
</div>
<div class="row bgWhite list-group-item">
<div class="row">
<div class="col-xs-12 col-sm-12 col-lg-12">
@ -495,7 +495,7 @@ if (!empty($video)) {
<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>
</div>
</div>
</div>
@ -518,7 +518,7 @@ if (!empty($video)) {
if (!User::canComment()) {
echo __("You cannot comment on videos");
}
?></textarea>
?></textarea>
<?php if (User::canComment()) { ?>
<span class="input-group-addon btn btn-success" id="saveCommentBtn" <?php
if (!User::canComment()) {
@ -590,7 +590,7 @@ if (!empty($video)) {
</div>
</div>
<div class="col-xs-12 col-sm-4 col-md-4 col-lg-4 bgWhite list-group-item">
<div class="col-xs-12 col-sm-4 col-md-4 col-lg-4 bgWhite list-group-item">
<?php
if (!empty($playlist_id)) {
include './include/playlist.php';
@ -660,11 +660,11 @@ if (!empty($video)) {
<div class="details row text-muted" itemprop="description">
<div>
<strong><?php echo __("Category"); ?>: </strong>
<span class="<?php echo $autoPlayVideo['iconClass']; ?>"></span>
<span class="<?php echo $autoPlayVideo['iconClass']; ?>"></span>
<?php echo $autoPlayVideo['category']; ?>
</div>
<div>
<strong class=""><?php echo number_format($autoPlayVideo['views_count'], 0); ?></strong>
<strong class=""><?php echo number_format($autoPlayVideo['views_count'], 0); ?></strong>
<?php echo __("Views"); ?>
</div>
<div><?php echo $autoPlayVideo['creator']; ?></div>
@ -697,7 +697,7 @@ if (!empty($video)) {
<!-- videos List -->
<div id="videosList">
<?php include './videosList.php'; ?>
<?php include './videosList.php'; ?>
</div>
<!-- End of videos List -->
@ -744,7 +744,7 @@ if (!empty($video)) {
<div class="alert alert-warning">
<span class="glyphicon glyphicon-facetime-video"></span> <strong><?php echo __("Warning"); ?>!</strong> <?php echo __("We have not found any videos or audios to show"); ?>.
</div>
<?php } ?>
<?php } ?>
</div>
<?php

View file

@ -29,33 +29,33 @@ foreach ($files as $value) {
break;
}
}
if($obj->orphan){
if(!empty($_GET['delete'])){
if ($obj->orphan) {
if (!empty($_GET['delete'])) {
$file = $dir.$obj->dirFilename;
unlink($file);
}else{
} else {
$arrayOrphan[] = $obj;
}
}else{
} else {
$arrayNotOrphan[] = $obj;
}
$array[] = $obj;
/*
$file = "{$global['systemRootPath']}videos/original_{$video['filename']}";
if(file_exists($file)){
unlink($file);
if (file_exists($file)) {
unlink($file);
}
$file = "{$global['systemRootPath']}videos/{$video['filename']}.{$value}";
if(file_exists($file)){
unlink($file);
if (file_exists($file)) {
unlink($file);
}
$file = "{$global['systemRootPath']}videos/{$video['filename']}_progress_{$value}.txt";
if(file_exists($file)){
unlink($file);
if (file_exists($file)) {
unlink($file);
}
$file = "{$global['systemRootPath']}videos/{$video['filename']}.jpg";
if(file_exists($file)){
unlink($file);
if (file_exists($file)) {
unlink($file);
}
* */
}
@ -63,8 +63,8 @@ foreach ($files as $value) {
function getMainName($filename) {
preg_match("/([a-z0-9_]{1,}(\.[a-z0-9_]{5,})?)(\.[a-z0-9]{0,4})?$/i", $filename, $matches);
$parts = explode("_progress_", $matches[1]);
if(preg_match("/original_.*/", $parts[0])){
$parts = explode("original_", $parts[0]);
if (preg_match("/original_.*/", $parts[0])) {
$parts = explode("original_", $parts[0]);
return $parts[1];
}
return $parts[0];
@ -86,14 +86,14 @@ function getMainName($filename) {
<div class="container">
<?php
if(empty($arrayOrphan)){
if (empty($arrayOrphan)) {
?>
<h1 class="alert alert-success">
<?php echo __("You dont have any orphan file"); ?>
</h1>
<?php
}else{
} else {
?>
<ul class="list-group">
<a href="#" id="deleteAll" class="list-group-item list-group-item-danger"><?php echo __("Delete All Orphans Files"); ?> <span class="badge"><?php echo count($arrayOrphan); ?></span> </a>

View file

@ -27,7 +27,7 @@ require_once $global['systemRootPath'] . 'objects/user.php';
<legend><?php echo __("Sign Up"); ?></legend>
<div class="form-group">
<label class="col-md-4 control-label"><?php echo __("Name"); ?></label>
<label class="col-md-4 control-label"><?php echo __("Name"); ?></label>
<div class="col-md-8 inputGroupContainer">
<div class="input-group">
<span class="input-group-addon"><i class="glyphicon glyphicon-pencil"></i></span>
@ -37,7 +37,7 @@ require_once $global['systemRootPath'] . 'objects/user.php';
</div>
<div class="form-group">
<label class="col-md-4 control-label"><?php echo __("User"); ?></label>
<label class="col-md-4 control-label"><?php echo __("User"); ?></label>
<div class="col-md-8 inputGroupContainer">
<div class="input-group">
<span class="input-group-addon"><i class="glyphicon glyphicon-user"></i></span>
@ -47,7 +47,7 @@ require_once $global['systemRootPath'] . 'objects/user.php';
</div>
<div class="form-group">
<label class="col-md-4 control-label"><?php echo __("E-mail"); ?></label>
<label class="col-md-4 control-label"><?php echo __("E-mail"); ?></label>
<div class="col-md-8 inputGroupContainer">
<div class="input-group">
<span class="input-group-addon"><i class="glyphicon glyphicon-envelope"></i></span>
@ -57,7 +57,7 @@ require_once $global['systemRootPath'] . 'objects/user.php';
</div>
<div class="form-group">
<label class="col-md-4 control-label"><?php echo __("New Password"); ?></label>
<label class="col-md-4 control-label"><?php echo __("New Password"); ?></label>
<div class="col-md-8 inputGroupContainer">
<div class="input-group">
<span class="input-group-addon"><i class="glyphicon glyphicon-lock"></i></span>
@ -67,7 +67,7 @@ require_once $global['systemRootPath'] . 'objects/user.php';
</div>
<div class="form-group">
<label class="col-md-4 control-label"><?php echo __("Confirm New Password"); ?></label>
<label class="col-md-4 control-label"><?php echo __("Confirm New Password"); ?></label>
<div class="col-md-8 inputGroupContainer">
<div class="input-group">
<span class="input-group-addon"><i class="glyphicon glyphicon-lock"></i></span>

View file

@ -40,7 +40,7 @@ foreach ($tags as $value) {
</legend>
<div class="form-group">
<label class="col-md-4 control-label"><?php echo __("Name"); ?></label>
<label class="col-md-4 control-label"><?php echo __("Name"); ?></label>
<div class="col-md-8 inputGroupContainer">
<div class="input-group">
<span class="input-group-addon"><i class="glyphicon glyphicon-pencil"></i></span>
@ -50,7 +50,7 @@ foreach ($tags as $value) {
</div>
<div class="form-group">
<label class="col-md-4 control-label"><?php echo __("User"); ?></label>
<label class="col-md-4 control-label"><?php echo __("User"); ?></label>
<div class="col-md-8 inputGroupContainer">
<div class="input-group">
<span class="input-group-addon"><i class="glyphicon glyphicon-user"></i></span>
@ -60,7 +60,7 @@ foreach ($tags as $value) {
</div>
<div class="form-group">
<label class="col-md-4 control-label"><?php echo __("E-mail"); ?></label>
<label class="col-md-4 control-label"><?php echo __("E-mail"); ?></label>
<div class="col-md-8 inputGroupContainer">
<div class="input-group">
<span class="input-group-addon"><i class="glyphicon glyphicon-envelope"></i></span>
@ -70,7 +70,7 @@ foreach ($tags as $value) {
</div>
<div class="form-group">
<label class="col-md-4 control-label"><?php echo __("New Password"); ?></label>
<label class="col-md-4 control-label"><?php echo __("New Password"); ?></label>
<div class="col-md-8 inputGroupContainer">
<div class="input-group">
<span class="input-group-addon"><i class="glyphicon glyphicon-lock"></i></span>
@ -80,7 +80,7 @@ foreach ($tags as $value) {
</div>
<div class="form-group">
<label class="col-md-4 control-label"><?php echo __("Confirm New Password"); ?></label>
<label class="col-md-4 control-label"><?php echo __("Confirm New Password"); ?></label>
<div class="col-md-8 inputGroupContainer">
<div class="input-group">
<span class="input-group-addon"><i class="glyphicon glyphicon-lock"></i></span>
@ -247,7 +247,7 @@ foreach ($tags as $value) {
<div class="form-group">
<label class="col-md-4 control-label"><?php echo __("User"); ?></label>
<label class="col-md-4 control-label"><?php echo __("User"); ?></label>
<div class="col-md-8 inputGroupContainer">
<div class="input-group">
<span class="input-group-addon"><i class="glyphicon glyphicon-user"></i></span>
@ -258,7 +258,7 @@ foreach ($tags as $value) {
<div class="form-group">
<label class="col-md-4 control-label"><?php echo __("Password"); ?></label>
<label class="col-md-4 control-label"><?php echo __("Password"); ?></label>
<div class="col-md-8 inputGroupContainer">
<div class="input-group">
<span class="input-group-addon"><i class="glyphicon glyphicon-lock"></i></span>

View file

@ -2,7 +2,7 @@
require_once '../videos/configuration.php';
require_once $global['systemRootPath'] . 'objects/video.php';
$video = Video::getVideo();
if(empty($video)){
if (empty($video)) {
die(__("Video not found"));
}
@ -53,16 +53,16 @@ if ($video['type'] !== "audio") {
<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']; ?>.mp3" type="audio/mpeg" />
<a href="<?php echo $global['webSiteRootURL']; ?>videos/<?php echo $video['filename']; ?>.mp3">horse</a>
</audio>
</audio>
<?php
} else {
?>
<video poster="<?php echo $poster; ?>" controls crossorigin width="auto" height="auto"
<video poster="<?php echo $poster; ?>" controls crossorigin width="auto" height="auto"
class="video-js vjs-default-skin vjs-big-play-centered <?php echo $vjsClass; ?> " id="mainVideo" data-setup='{"fluid": true }'>
<source src="<?php echo $global['webSiteRootURL']; ?>videos/<?php echo $video['filename']; ?>.mp4" type="video/mp4">
<source src="<?php echo $global['webSiteRootURL']; ?>videos/<?php echo $video['filename']; ?>.webm" type="video/webm">
<p><?php echo __("If you can't view this video, your browser does not support HTML5 videos"); ?></p>
</video>
</video>
<?php
}
?>

View file

@ -74,7 +74,7 @@ foreach ($videos as $key => $value) {
<div class="details row" itemprop="description">
<div>
<strong><?php echo __("Category"); ?>: </strong>
<span class="<?php echo $value['iconClass']; ?>"></span>
<span class="<?php echo $value['iconClass']; ?>"></span>
<?php echo $value['category']; ?>
</div>
<div>
@ -99,7 +99,7 @@ foreach ($videos as $key => $value) {
</div>
<?php
}
?>
?>
<ul class="pages">
</ul>
<div class="loader" id="pageLoader" style="display: none;"></div>