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

View file

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

View file

@ -1,12 +1,11 @@
<?php <?php
if (empty($global['systemRootPath'])) {
if(empty($global['systemRootPath'])){ $global['systemRootPath'] = '../';
$global['systemRootPath'] = "../";
} }
require_once $global['systemRootPath'].'videos/configuration.php'; require_once $global['systemRootPath'] . 'videos/configuration.php';
class Captcha{ class Captcha{
private $largura, $altura, $tamanho_fonte, $quantidade_letras; private $largura, $altura, $tamanho_fonte, $quantidade_letras;
function __construct($largura, $altura, $tamanho_fonte, $quantidade_letras) { function __construct($largura, $altura, $tamanho_fonte, $quantidade_letras) {
if (session_status() == PHP_SESSION_NONE) { if (session_status() == PHP_SESSION_NONE) {
session_start(); session_start();
@ -17,37 +16,41 @@ class Captcha{
$this->quantidade_letras = $quantidade_letras; $this->quantidade_letras = $quantidade_letras;
} }
public function getCaptchaImage(){ public function getCaptchaImage() {
global $global; 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 $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 $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 $preto = imagecolorallocate($imagem, 0, 0, 0); // define a cor preta
$branco = imagecolorallocate($imagem,255,255,255); // define a cor branca $branco = imagecolorallocate($imagem, 255, 255, 255); // define a cor branca
// define a palavra conforme a quantidade de letras definidas no parametro $quantidade_letras // define a palavra conforme a quantidade de letras definidas no parametro $quantidade_letras
//$letters = "AaBbCcDdEeFfGgHhIiJjKkLlMmNnPpQqRrSsTtUuVvYyXxWwZz23456789"; //$letters = 'AaBbCcDdEeFfGgHhIiJjKkLlMmNnPpQqRrSsTtUuVvYyXxWwZz23456789';
$letters = "AaBbCcDdEeFfGgHhIiJjKkLlMmNnPpQqRrSsTtUuVvYyXxWwZz23456789"; $letters = 'AaBbCcDdEeFfGgHhIiJjKkLlMmNnPpQqRrSsTtUuVvYyXxWwZz23456789';
$palavra = substr(str_shuffle($letters),0,($this->quantidade_letras)); $palavra = substr(str_shuffle($letters), 0, ($this->quantidade_letras));
$_SESSION["palavra"] = $palavra; // atribui para a sessao a palavra gerada $_SESSION["palavra"] = $palavra; // atribui para a sessao a palavra gerada
for($i = 1; $i <= $this->quantidade_letras; $i++){ 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 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 imagejpeg($imagem); // gera a imagem
imagedestroy($imagem); // limpa a imagem da memoria imagedestroy($imagem); // limpa a imagem da memoria
} }
static public function validation($word){ static public function validation($word) {
if (session_status() == PHP_SESSION_NONE) { if (session_status() == PHP_SESSION_NONE) {
session_start(); session_start();
} }
if (strcasecmp($word, $_SESSION["palavra"])==0){ return (strcasecmp($word, $_SESSION["palavra"]) == 0);
return true; }
}else{
return false; }
}
}
}

View file

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

View file

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

View file

@ -1,7 +1,7 @@
<?php <?php
header('Content-Type: application/json'); header('Content-Type: application/json');
if(empty($global['systemRootPath'])){ if (empty($global['systemRootPath'])) {
$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/user.php';

View file

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

View file

@ -1,9 +1,9 @@
<?php <?php
header('Content-Type: application/json'); header('Content-Type: application/json');
if(empty($global['systemRootPath'])){ if (empty($global['systemRootPath'])) {
$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/user.php';
if (!User::canComment()) { if (!User::canComment()) {
die('{"error":"'.__("Permission denied").'"}'); die('{"error":"'.__("Permission denied").'"}');
@ -11,4 +11,4 @@ if (!User::canComment()) {
require_once 'comment.php'; require_once 'comment.php';
$obj = new Comment($_POST['comment'], $_POST['video']); $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>'; $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).'}'; echo '{ "current": '.$_POST['current'].',"rowCount": '.$_POST['rowCount'].', "total": '.$total.', "rows":'. json_encode($comments).'}';

View file

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

View file

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

View file

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

View file

@ -1,11 +1,10 @@
<?php <?php
require_once 'captcha.php'; require_once 'captcha.php';
$largura = empty($_GET["l"])?120:$_GET["l"]; // recebe a largura $largura = empty($_GET['l']) ? 120 : $_GET['l']; // recebe a largura
$altura = empty($_GET["a"])?40:$_GET["a"]; // recebe a altura $altura = empty($_GET['a']) ? 40 : $_GET['a']; // recebe a altura
$tamanho_fonte = empty($_GET["tf"])?18:$_GET["tf"]; // recebe o tamanho da fonte $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á $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 = new Captcha($largura, $altura, $tamanho_fonte, $quantidade_letras);
$capcha->getCaptchaImage(); $capcha->getCaptchaImage();
?>

View file

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

View file

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

View file

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

View file

@ -1,8 +1,8 @@
<?php <?php
if(empty($global['systemRootPath'])){ if (empty($global['systemRootPath'])) {
$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/user.php';
User::logoff(); User::logoff();
header("location: {$global['webSiteRootURL']}"); header("location: {$global['webSiteRootURL']}");

View file

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

View file

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

View file

@ -1,9 +1,9 @@
<?php <?php
header('Content-Type: application/json'); header('Content-Type: application/json');
if(empty($global['systemRootPath'])){ if (empty($global['systemRootPath'])) {
$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/user.php';
require_once $global['systemRootPath'] . 'objects/playlist.php'; require_once $global['systemRootPath'] . 'objects/playlist.php';
if (!User::isLogged()) { if (!User::isLogged()) {
@ -15,4 +15,4 @@ if(empty($obj || User::getId()!=$obj->getUsers_id()) || empty($_POST['videos_id'
return false; 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 <?php
if (empty($global['systemRootPath'])) { if (empty($global['systemRootPath'])) {
$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/user.php';
@ -19,7 +18,7 @@ class PlayList extends Object {
} }
/** /**
* *
* @global type $global * @global type $global
* @param type $publicOnly * @param type $publicOnly
* @param type $userId if not present check session * @param type $userId if not present check session
@ -49,7 +48,7 @@ class PlayList extends Object {
} }
return $rows; return $rows;
} }
static function getVideosFromPlaylist($playlists_id) { static function getVideosFromPlaylist($playlists_id) {
global $global; global $global;
$sql = "SELECT * FROM playlists_has_videos " $sql = "SELECT * FROM playlists_has_videos "
@ -67,7 +66,7 @@ class PlayList extends Object {
} }
return $rows; return $rows;
} }
static function getVideosIdFromPlaylist($playlists_id) { static function getVideosIdFromPlaylist($playlists_id) {
$videosId = array(); $videosId = array();
$rows = static::getVideosFromPlaylist($playlists_id); $rows = static::getVideosFromPlaylist($playlists_id);
@ -96,7 +95,7 @@ class PlayList extends Object {
//echo $sql; //echo $sql;
return $global['mysqli']->query($sql); return $global['mysqli']->query($sql);
} }
public function delete() { public function delete() {
if(empty($this->id)){ if(empty($this->id)){
return false; return false;

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -1,16 +1,15 @@
<?php <?php
require_once 'subscribe.php'; require_once 'subscribe.php';
if(!User::isLogged()){ if (!User::isLogged()) {
return false; return false;
} }
header('Content-Type: application/json'); header('Content-Type: application/json');
$user_id = User::getId(); $user_id = User::getId();
// if admin bring all subscribers // if admin bring all subscribers
if(User::isAdmin()){ if (User::isAdmin()) {
$user_id = ""; $user_id = "";
} }
$Subscribes = Subscribe::getAllSubscribes($user_id); $Subscribes = Subscribe::getAllSubscribes($user_id);
$total = Subscribe::getTotalSubscribes($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 = new stdClass();
$obj->error = true; $obj->error = true;
if (!User::canUpload()) { if (!User::canUpload()) {
$obj->msg = "Only logged users can file_dataoad"; $obj->msg = 'Only logged users can file_dataoad';
die(json_encode($obj)); die(json_encode($obj));
} }
header('Content-Type: application/json'); header('Content-Type: application/json');
@ -35,4 +35,4 @@ if (isset($_FILES['file_data']) && $_FILES['file_data']['error'] == 0) {
} }
$obj->msg = "\$_FILES Error"; $obj->msg = "\$_FILES Error";
$obj->FILES = $_FILES; $obj->FILES = $_FILES;
die(json_encode($obj)); die(json_encode($obj));

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -1,6 +1,6 @@
<?php <?php
if (empty($global['systemRootPath'])) { if (empty($global['systemRootPath'])) {
$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/user.php';
@ -68,12 +68,12 @@ if (!(!empty($_GET['user']) && !empty($_GET['recoverpass']))) {
<div class="container"> <div class="container">
<?php <?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> <div class="alert alert-danger"><?php echo __("The recover pass does not match!"); ?></div>
<?php <?php
}else{ } else {
?> ?>
<form class="well form-horizontal" action=" " method="post" id="recoverPassForm"> <form class="well form-horizontal" action=" " method="post" id="recoverPassForm">
<fieldset> <fieldset>
@ -82,7 +82,7 @@ if (!(!empty($_GET['user']) && !empty($_GET['recoverpass']))) {
<legend><?php echo __("Recover password!"); ?></legend> <legend><?php echo __("Recover password!"); ?></legend>
<div class="form-group"> <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="col-md-8 inputGroupContainer">
<div class="input-group"> <div class="input-group">
<span class="input-group-addon"><i class="glyphicon glyphicon-lock"></i></span> <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> </div>
<div class="form-group"> <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="col-md-8 inputGroupContainer">
<div class="input-group"> <div class="input-group">
<span class="input-group-addon"><i class="glyphicon glyphicon-lock"></i></span> <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>
</div> </div>
<div class="form-group"> <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="col-md-8 inputGroupContainer">
<div class="input-group"> <div class="input-group">
<span class="input-group-addon"><i class="glyphicon glyphicon-lock"></i></span> <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>
<div class="form-group"> <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="col-md-8 inputGroupContainer">
<div class="input-group"> <div class="input-group">
<span class="input-group-addon"><i class="glyphicon glyphicon-lock"></i></span> <span class="input-group-addon"><i class="glyphicon glyphicon-lock"></i></span>

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -1,7 +1,7 @@
<?php <?php
header('Content-Type: application/json'); header('Content-Type: application/json');
if(empty($global['systemRootPath'])){ if (empty($global['systemRootPath'])) {
$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/user.php';

View file

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

View file

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

View file

@ -1,8 +1,7 @@
<?php <?php
header('Content-Type: application/json'); header('Content-Type: application/json');
if (empty($global['systemRootPath'])) {
if(empty($global['systemRootPath'])){ $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/user.php';

View file

@ -1,9 +1,9 @@
<?php <?php
header('Content-Type: application/json'); header('Content-Type: application/json');
if(empty($global['systemRootPath'])){ if (empty($global['systemRootPath'])) {
$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/user.php';
if (!User::isAdmin() || empty($_POST['id'])) { if (!User::isAdmin() || empty($_POST['id'])) {
die('{"error":"'.__("Permission denied").'"}'); die('{"error":"'.__("Permission denied").'"}');
@ -16,4 +16,4 @@ if(empty($obj)){
} }
$obj->setStatus($_POST['status']); $obj->setStatus($_POST['status']);
$resp = $obj->save(); $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'); header('Content-Type: application/json');
die('{"error":"' . __("Permission denied") . '"}'); die('{"error":"' . __("Permission denied") . '"}');
} }
if(empty($this->starts)){ if (empty($this->starts)) {
$this->starts = date("Y-m-d h:i:s"); $this->starts = date('Y-m-d h:i:s');
} }
if (empty($this->ad_title)) { if (empty($this->ad_title)) {
return false; return false;
} }
if(empty($this->finish)){ if (empty($this->finish)) {
$finish = "NULL"; $finish = "NULL";
}else{ } else {
$finish = "'{$this->finish}'"; $finish = "'{$this->finish}'";
} }
global $global; global $global;
if (!empty($this->id)) { if (!empty($this->id)) {
$sql = "UPDATE video_ads SET " $sql = "UPDATE video_ads SET "
@ -86,7 +86,7 @@ class Video_ad {
. "('{$this->ad_title}','{$this->starts}', {$finish}, '{$this->getSkip_after_seconds()}'," . "('{$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())"; . "'{$this->redirect}', '{$this->getFinish_max_clicks()}', '{$this->getFinish_max_prints()}', '{$this->videos_id}', '{$this->categories_id}', now(), now())";
} }
$insert_row = $global['mysqli']->query($sql); $insert_row = $global['mysqli']->query($sql);
if ($insert_row) { 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 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_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)) "; . " 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"; $sql .= " LIMIT 1";
//echo $sql;exit; //echo $sql;exit;
$res = $global['mysqli']->query($sql); $res = $global['mysqli']->query($sql);
@ -300,14 +300,14 @@ class Video_ad {
} }
return $ad; return $ad;
} }
static function log($id){ static function log($id){
global $global; global $global;
$userId = empty($_SESSION["user"]["id"]) ? "NULL" : $_SESSION["user"]["id"]; $userId = empty($_SESSION["user"]["id"]) ? "NULL" : $_SESSION["user"]["id"];
$sql = "INSERT INTO video_ads_logs " $sql = "INSERT INTO video_ads_logs "
. "(datetime, clicked, ip, video_ads_id, users_id) values " . "(datetime, clicked, ip, video_ads_id, users_id) values "
. "(now(),0, '".getRealIpAddr()."', '{$id}',{$userId})"; . "(now(),0, '".getRealIpAddr()."', '{$id}',{$userId})";
$insert_row = $global['mysqli']->query($sql); $insert_row = $global['mysqli']->query($sql);
if ($insert_row) { if ($insert_row) {
@ -316,11 +316,11 @@ class Video_ad {
die($sql . ' Save Video Ads Log Error : (' . $global['mysqli']->errno . ') ' . $global['mysqli']->error); die($sql . ' Save Video Ads Log Error : (' . $global['mysqli']->errno . ') ' . $global['mysqli']->error);
} }
} }
static function clickLog($video_ads_log_id){ static function clickLog($video_ads_log_id){
global $global; global $global;
$sql = "UPDATE video_ads_logs set clicked = 1 WHERE id = {$video_ads_log_id}"; $sql = "UPDATE video_ads_logs set clicked = 1 WHERE id = {$video_ads_log_id}";
$insert_row = $global['mysqli']->query($sql); $insert_row = $global['mysqli']->query($sql);
if ($insert_row) { if ($insert_row) {
@ -329,7 +329,7 @@ class Video_ad {
die($sql . ' Save Click Video Ads Log Error : (' . $global['mysqli']->errno . ') ' . $global['mysqli']->error); die($sql . ' Save Click Video Ads Log Error : (' . $global['mysqli']->errno . ') ' . $global['mysqli']->error);
} }
} }
static function redirect($id){ static function redirect($id){
$ad = self::getVideoAds($id); $ad = self::getVideoAds($id);
header("Location: {$ad['redirect']}"); header("Location: {$ad['redirect']}");

View file

@ -1,10 +1,10 @@
<?php <?php
header('Content-Type: application/json'); header('Content-Type: application/json');
if(empty($global['systemRootPath'])){ if (empty($global['systemRootPath'])) {
$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/user.php';
require 'video_ad.php'; require 'video_ad.php';
Video_ad::clickLog($_GET['video_ads_logs_id']); 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 <?php
header('Content-Type: application/json'); header('Content-Type: application/json');
if(empty($global['systemRootPath'])){ if (empty($global['systemRootPath'])) {
$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/user.php';
if (!User::isAdmin() || empty($_POST['id'])) { if (!User::isAdmin() || empty($_POST['id'])) {
die('{"error":"'.__("Permission denied").'"}'); die('{"error":"'.__("Permission denied").'"}');

View file

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

View file

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

View file

@ -4,16 +4,16 @@ require_once 'video.php';
require_once $global['systemRootPath'] . 'objects/functions.php'; require_once $global['systemRootPath'] . 'objects/functions.php';
header('Content-Type: application/json'); header('Content-Type: application/json');
$showOnlyLoggedUserVideos = true; $showOnlyLoggedUserVideos = true;
if(User::isAdmin()){ if (User::isAdmin()) {
$showOnlyLoggedUserVideos = false; $showOnlyLoggedUserVideos = false;
} }
$videos = Video::getAllVideos("", $showOnlyLoggedUserVideos, true); $videos = Video::getAllVideos('', $showOnlyLoggedUserVideos, true);
$total = Video::getTotalVideos("", $showOnlyLoggedUserVideos, true); $total = Video::getTotalVideos('', $showOnlyLoggedUserVideos, true);
foreach ($videos as $key => $value) { foreach ($videos as $key => $value) {
$name = empty($value['name'])?$value['user']:$value['name']; $name = empty($value['name'])?$value['user']:$value['name'];
//$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>"; //$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>'; $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']); $video = new Video("", "", @$_POST['videos_id']);
$obj->video_id = @$_POST['videos_id']; $obj->video_id = @$_POST['videos_id'];
$title = $video->getTitle(); $title = $video->getTitle();
if(empty($title) && !empty($_POST['title'])){ if (empty($title) && !empty($_POST['title'])) {
$title = $video->setTitle($_POST['title']); $title = $video->setTitle($_POST['title']);
}else if(empty($title)){ } elseif (empty($title)) {
$video->setTitle("Automatic Title"); $video->setTitle("Automatic Title");
} }
$video->setDuration($_POST['duration']); $video->setDuration($_POST['duration']);
@ -40,10 +40,10 @@ $video->setStatus('a');
$video->setVideoDownloadedLink($_POST['videoDownloadedLink']); $video->setVideoDownloadedLink($_POST['videoDownloadedLink']);
if(preg_match("/(mp3|wav|ogg)$/i", $_POST['format'])){ if (preg_match("/(mp3|wav|ogg)$/i", $_POST['format'])) {
$type = 'audio'; $type = 'audio';
$video->setType($type); $video->setType($type);
}else if(preg_match("/(mp4|webm)$/i", $_POST['format'])){ } elseif (preg_match("/(mp4|webm)$/i", $_POST['format'])) {
$type = 'video'; $type = 'video';
$video->setType($type); $video->setType($type);
} }
@ -74,8 +74,8 @@ if(!empty($_FILES['image']['tmp_name']) && !file_exists("{$destination}.jpg")){
die(json_encode($obj)); die(json_encode($obj));
} }
} }
if(!empty($_FILES['gifimage']['tmp_name']) && !file_exists("{$destination}.gif")){ if (!empty($_FILES['gifimage']['tmp_name']) && !file_exists("{$destination}.gif")) {
if(!move_uploaded_file ($_FILES['gifimage']['tmp_name'] , "{$destination}.gif")){ if (!move_uploaded_file ($_FILES['gifimage']['tmp_name'] , "{$destination}.gif")) {
$obj->msg = __("Could not move gif image file [{$destination}.gif]"); $obj->msg = __("Could not move gif image file [{$destination}.gif]");
error_log($obj->msg); error_log($obj->msg);
die(json_encode($obj)); die(json_encode($obj));
@ -90,12 +90,7 @@ error_log("Files Received for video {$video_id}: ".$video->getTitle());
die(json_encode($obj)); die(json_encode($obj));
/* /*
error_log(print_r($_POST, true)); error_log(print_r($_POST, true));
error_log(print_r($_FILES, true)); error_log(print_r($_FILES, true));
var_dump($_POST, $_FILES); var_dump($_POST, $_FILES);
*/ */

View file

@ -2,10 +2,10 @@
header('Content-Type: application/json'); header('Content-Type: application/json');
$obj = new stdClass(); $obj = new stdClass();
$obj->error = true; $obj->error = true;
if(empty($global['systemRootPath'])){ if (empty($global['systemRootPath'])) {
$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/user.php';
require_once $global['systemRootPath'] . 'objects/video.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) { if (strcasecmp($extension, 'mp3') == 0 || strcasecmp($extension, 'wav') == 0) {
$type = 'audio'; $type = 'audio';
} }
//var_dump($extension, $type);exit; //var_dump($extension, $type);exit;
require_once $global['systemRootPath'] . 'objects/video.php'; require_once $global['systemRootPath'] . 'objects/video.php';
//echo "Starting Get Duration\n"; //echo "Starting Get Duration\n";
$duration = Video::getDurationFromFile($_FILES['upl']['tmp_name']); $duration = Video::getDurationFromFile($_FILES['upl']['tmp_name']);
// check if can upload video (about time limit storage) // check if can upload video (about time limit storage)
if(!empty($global['videoStorageLimitMinutes'])){ if(!empty($global['videoStorageLimitMinutes'])){
$maxDuration = $global['videoStorageLimitMinutes']*60; $maxDuration = $global['videoStorageLimitMinutes']*60;
@ -65,8 +65,8 @@ if (isset($_FILES['upl']) && $_FILES['upl']['error'] == 0) {
exit; exit;
} }
} }
$path_parts = pathinfo($_FILES['upl']['name']); $path_parts = pathinfo($_FILES['upl']['name']);
$mainName = preg_replace("/[^A-Za-z0-9]/", "", cleanString($path_parts['filename'])); $mainName = preg_replace("/[^A-Za-z0-9]/", "", cleanString($path_parts['filename']));
$filename = uniqid($mainName . "_YPTuniqid_", true); $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)) { if (!copy($_FILES['upl']['tmp_name'], "{$global['systemRootPath']}videos/original_" . $filename)) {
die("Error on 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)) { if (!rename($_FILES['upl']['tmp_name'], "{$global['systemRootPath']}videos/original_" . $filename)) {
die("Error on 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 . ")"); 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 // send to encoder
$queue = array(); $queue = array();
if($video->getType() == 'video'){ if ($video->getType() == 'video') {
if($config->getEncode_mp4()){ if ($config->getEncode_mp4()) {
$queue[] = $video->queue("mp4"); $queue[] = $video->queue("mp4");
} }
if($config->getEncode_webm()){ if ($config->getEncode_webm()) {
$queue[] = $video->queue("webm"); $queue[] = $video->queue("webm");
} }
}else if($config->getEncode_mp3spectrum()){ } elseif ($config->getEncode_mp3spectrum()) {
if($config->getEncode_mp4()){ if ($config->getEncode_mp4()) {
$queue[] = $video->queue("mp4_spectrum"); $queue[] = $video->queue("mp4_spectrum");
} }
if($config->getEncode_webm()){ if ($config->getEncode_webm()) {
$queue[] = $video->queue("webm_spectrum"); $queue[] = $video->queue("webm_spectrum");
} }
}else{ } else {
$queue[] = $video->queue("mp3"); $queue[] = $video->queue("mp3");
$queue[] = $video->queue("ogg"); $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"}'; //echo '{"status":"error", "msg":' . json_encode($_FILES) . ', "type":"$_FILES Error"}';
status(["status" => "error", "msg" => print_r($_FILES,true), "type" => '$_FILES Error']); status(["status" => "error", "msg" => print_r($_FILES,true), "type" => '$_FILES Error']);
exit; 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); $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->setYoutubeId($obj->id);
$v->save(); $v->save();
} catch (Google_Service_Exception $e) { } catch (Google_Service_Exception $e) {
$obj->msg = sprintf(__("A service error occurred: %s"), $e->getMessage()); $obj->msg = sprintf(__("A service error occurred: %s"), $e->getMessage());
} catch (Google_Exception $e) { } catch (Google_Exception $e) {
@ -123,7 +123,6 @@ if ($client->getAccessToken()) {
$_SESSION['state'] = $state; $_SESSION['state'] = $state;
$authUrl = $client->createAuthUrl(); $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>"; $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); 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> <footer class="blockquote-footer">Apostle Paul in <cite title="Source Title">Romans 11:36</cite></footer>
</blockquote> </blockquote>
<div class="btn-group btn-group-justified"> <div class="btn-group btn-group-justified">
<a href="https://www.youphptube.com/" class="btn btn-success">Main 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://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://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://github.com/DanielnetoDotCom/YouPHPTube/issues" class="btn btn-warning">Issues and requests Site</a>
</div> </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 are running YouPHPTube version %s!"), $config->getVersion()); ?></span>
<span class="label label-success"> <span class="label label-success">
<?php printf(__("You can upload max of %s!"), get_max_file_size()); ?> <?php printf(__("You can upload max of %s!"), get_max_file_size()); ?>
</span> </span>
@ -39,8 +39,8 @@ require_once '../videos/configuration.php';
<span class="label label-success"> <span class="label label-success">
<?php printf(__("You have %s minutes of videos!"), number_format(getSecondsTotalVideosLength()/6, 2)); ?> <?php printf(__("You have %s minutes of videos!"), number_format(getSecondsTotalVideosLength()/6, 2)); ?>
</span> </span>
$obj->videoStorageLimitMinutes = $global['videoStorageLimitMinutes']; $obj->videoStorageLimitMinutes = $global['videoStorageLimitMinutes'];
$obj->currentStorageUsage = getSecondsTotalVideosLength(); $obj->currentStorageUsage = getSecondsTotalVideosLength();
</div> </div>

View file

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

View file

@ -60,7 +60,7 @@ foreach ($videos as $value) {
include $global['systemRootPath'] . 'view/include/head.php'; 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> <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> </head>
<body> <body>
<?php <?php
@ -117,17 +117,17 @@ foreach ($videos as $value) {
<div class="panel panel-default"> <div class="panel panel-default">
<div class="panel-heading when"># <?php echo __("Total Views"); ?></div> <div class="panel-heading when"># <?php echo __("Total Views"); ?></div>
<div class="panel-body"> <div class="panel-body">
<canvas id="myChartPie" height="200" ></canvas> <canvas id="myChartPie" height="200" ></canvas>
</div> </div>
</div> </div>
</div> </div>
<div class="col-md-8"> <div class="col-md-8">
<div class="panel panel-default"> <div class="panel panel-default">
<div class="panel-heading when"># <?php echo __("Timeline"); ?></div> <div class="panel-heading when"># <?php echo __("Timeline"); ?></div>
<div class="panel-body" id="timeline"> <div class="panel-body" id="timeline">
<canvas id="myChartLine" height="90" ></canvas> <canvas id="myChartLine" height="90" ></canvas>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
<div class="row"> <div class="row">
@ -157,7 +157,7 @@ foreach ($videos as $value) {
borderWidth: 1 borderWidth: 1
}] }]
}; };
var lineChartData = { var lineChartData = {
labels: <?php echo json_encode($label90Days); ?>, labels: <?php echo json_encode($label90Days); ?>,
datasets: [{ datasets: [{
@ -167,7 +167,7 @@ foreach ($videos as $value) {
data: <?php echo json_encode($statistc_last90Days); ?> data: <?php echo json_encode($statistc_last90Days); ?>
}] }]
}; };
var lineChartDataToday = { var lineChartDataToday = {
labels: <?php echo json_encode($labelToday); ?>, labels: <?php echo json_encode($labelToday); ?>,
datasets: [{ datasets: [{
@ -240,7 +240,7 @@ foreach ($videos as $value) {
} }
} }
}); });
var myChartLineToday = new Chart(ctxLineToday, { var myChartLineToday = new Chart(ctxLineToday, {
type: 'line', type: 'line',
data: lineChartDataToday, data: lineChartDataToday,

View file

@ -39,31 +39,31 @@ require_once $global['systemRootPath'] . 'objects/functions.php';
<ul class="nav nav-tabs"> <ul class="nav nav-tabs">
<li class="nav-item"> <li class="nav-item">
<a class="nav-link " href="#tabTheme" data-toggle="tab"> <a class="nav-link " href="#tabTheme" data-toggle="tab">
<span class="fa fa-cog"></span> <span class="fa fa-cog"></span>
<?php echo __("Themes"); ?> <?php echo __("Themes"); ?>
</a> </a>
</li> </li>
<li class="nav-item"> <li class="nav-item">
<a class="nav-link " href="#tabCompatibility" data-toggle="tab"> <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"); ?> <?php echo __("Compatibility Check"); ?>
</a> </a>
</li> </li>
<li class="nav-item active"> <li class="nav-item active">
<a class="nav-link " href="#tabRegular" id="tabRegularLink" data-toggle="tab"> <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"); ?> <?php echo __("Regular Configuration"); ?>
</a> </a>
</li> </li>
<li class="nav-item"> <li class="nav-item">
<a class="nav-link " href="#tabAdvanced" data-toggle="tab"> <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"); ?> <?php echo __("Advanced Configuration"); ?>
</a> </a>
</li> </li>
<li class="nav-item"> <li class="nav-item">
<a class="nav-link " href="#tabHead" data-toggle="tab"> <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"); ?> <?php echo __("Script Code"); ?>
</a> </a>
</li> </li>
@ -73,11 +73,11 @@ require_once $global['systemRootPath'] . 'objects/functions.php';
<fieldset> <fieldset>
<legend><?php echo __("Themes"); ?></legend> <legend><?php echo __("Themes"); ?></legend>
<h1 class="alert alert-warning"> <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"); ?> <?php echo __("Do not forget to save after choose your theme"); ?>
</h1> </h1>
<div class="alert alert-info"> <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/"); ?> <?php echo __("We would like to thanks http://bootswatch.com/"); ?>
</div> </div>
<?php <?php
@ -86,15 +86,15 @@ require_once $global['systemRootPath'] . 'objects/functions.php';
$file = basename($filename); // $file is set to "index.php" $file = basename($filename); // $file is set to "index.php"
$fileEx = basename($filename, ".css"); // $file is set to "index" $fileEx = basename($filename, ".css"); // $file is set to "index"
$savedTheme = $config->getTheme(); $savedTheme = $config->getTheme();
if($fileEx == $savedTheme){ if ($fileEx == $savedTheme) {
?> ?>
<script> <script>
$(document).ready(function () { $(document).ready(function () {
setTimeout(function () { setTimeout(function () {
$("#btn<?php echo ($fileEx); ?>").trigger("click"); $("#btn<?php echo ($fileEx); ?>").trigger("click");
}, 1000); }, 1000);
}); });
</script> </script>
<?php <?php
} }
?> ?>
@ -108,7 +108,7 @@ require_once $global['systemRootPath'] . 'objects/functions.php';
?> ?>
</fieldset> </fieldset>
</div> </div>
<div class="tab-pane" id="tabCompatibility"> <div class="tab-pane" id="tabCompatibility">
<div class="alert alert-success"> <div class="alert alert-success">
<span class="fa fa-film"></span> <span class="fa fa-film"></span>
<strong><?php <strong><?php
@ -128,7 +128,7 @@ require_once $global['systemRootPath'] . 'objects/functions.php';
} }
?> and you have <?php echo $global['videoStorageLimitMinutes']; ?> minutes of storage ?> and you have <?php echo $global['videoStorageLimitMinutes']; ?> minutes of storage
<div class="progress"> <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; ?>%"> aria-valuenow="<?php echo $percent; ?>" aria-valuemin="0" aria-valuemax="100" style="width: <?php echo $percent; ?>%">
<?php echo $percent; ?>% of your storage limit used <?php echo $percent; ?>% of your storage limit used
</div> </div>
@ -137,21 +137,21 @@ require_once $global['systemRootPath'] . 'objects/functions.php';
} }
?> ?>
</div> </div>
<?php <?php
if (isApache()) { if (isApache()) {
?> ?>
<div class="alert alert-success"> <div class="alert alert-success">
<span class="glyphicon glyphicon-check"></span> <span class="glyphicon glyphicon-check"></span>
<strong><?php echo $_SERVER['SERVER_SOFTWARE']; ?> is Present</strong> <strong><?php echo $_SERVER['SERVER_SOFTWARE']; ?> is Present</strong>
</div> </div>
<?php <?php
} else { } else {
?> ?>
<div class="alert alert-danger"> <div class="alert alert-danger">
<span class="glyphicon glyphicon-unchecked"></span> <span class="glyphicon glyphicon-unchecked"></span>
<strong>Your server is <?php echo $_SERVER['SERVER_SOFTWARE']; ?>, you must install Apache</strong> <strong>Your server is <?php echo $_SERVER['SERVER_SOFTWARE']; ?>, you must install Apache</strong>
</div> </div>
<?php <?php
} }
?> ?>
@ -163,14 +163,14 @@ require_once $global['systemRootPath'] . 'objects/functions.php';
<div class="alert alert-success"> <div class="alert alert-success">
<span class="glyphicon glyphicon-check"></span> <span class="glyphicon glyphicon-check"></span>
<strong>PHP <?php echo PHP_VERSION; ?> is Present</strong> <strong>PHP <?php echo PHP_VERSION; ?> is Present</strong>
</div> </div>
<?php <?php
} else { } else {
?> ?>
<div class="alert alert-danger"> <div class="alert alert-danger">
<span class="glyphicon glyphicon-unchecked"></span> <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> <strong>Your PHP version is <?php echo PHP_VERSION; ?>, you must install PHP 5.6.x or greater</strong>
</div> </div>
<?php <?php
} }
?> ?>
@ -182,7 +182,7 @@ require_once $global['systemRootPath'] . 'objects/functions.php';
<div class="alert alert-success"> <div class="alert alert-success">
<span class="glyphicon glyphicon-check"></span> <span class="glyphicon glyphicon-check"></span>
<strong>Mod Rewrite module is Present</strong> <strong>Mod Rewrite module is Present</strong>
</div> </div>
<?php <?php
} else { } else {
?> ?>
@ -195,7 +195,7 @@ require_once $global['systemRootPath'] . 'objects/functions.php';
Restart apache2 after<br> Restart apache2 after<br>
<pre><code>/etc/init.d/apache2 restart</code></pre> <pre><code>/etc/init.d/apache2 restart</code></pre>
</details> </details>
</div> </div>
<?php <?php
} }
?> ?>
@ -206,7 +206,7 @@ require_once $global['systemRootPath'] . 'objects/functions.php';
<div class="alert alert-success"> <div class="alert alert-success">
<span class="glyphicon glyphicon-check"></span> <span class="glyphicon glyphicon-check"></span>
<strong>Your videos directory is writable</strong> <strong>Your videos directory is writable</strong>
</div> </div>
<?php <?php
} else { } else {
?> ?>
@ -229,7 +229,7 @@ require_once $global['systemRootPath'] . 'objects/functions.php';
<br> <br>
<pre><code>sudo chmod -R 777 <?php echo $dir; ?></code></pre> <pre><code>sudo chmod -R 777 <?php echo $dir; ?></code></pre>
</details> </details>
</div> </div>
<?php <?php
} }
$pathToPHPini = php_ini_loaded_file(); $pathToPHPini = php_ini_loaded_file();
@ -244,7 +244,7 @@ require_once $global['systemRootPath'] . 'objects/functions.php';
<div class="alert alert-success"> <div class="alert alert-success">
<span class="glyphicon glyphicon-check"></span> <span class="glyphicon glyphicon-check"></span>
<strong>Your post_max_size is <?php echo ini_get('post_max_size'); ?></strong> <strong>Your post_max_size is <?php echo ini_get('post_max_size'); ?></strong>
</div> </div>
<?php <?php
} else { } 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> <strong>Your post_max_size is <?php echo ini_get('post_max_size'); ?>, it must be at least 100M</strong>
<details> <details>
Edit the <code>php.ini</code> file Edit the <code>php.ini</code> file
<br> <br>
<pre><code>sudo nano <?php echo $pathToPHPini; ?></code></pre> <pre><code>sudo nano <?php echo $pathToPHPini; ?></code></pre>
</details> </details>
</div> </div>
<?php <?php
} }
?> ?>
@ -268,7 +268,7 @@ require_once $global['systemRootPath'] . 'objects/functions.php';
<div class="alert alert-success"> <div class="alert alert-success">
<span class="glyphicon glyphicon-check"></span> <span class="glyphicon glyphicon-check"></span>
<strong>Your upload_max_filesize is <?php echo ini_get('upload_max_filesize'); ?></strong> <strong>Your upload_max_filesize is <?php echo ini_get('upload_max_filesize'); ?></strong>
</div> </div>
<?php <?php
} else { } 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> <strong>Your upload_max_filesize is <?php echo ini_get('upload_max_filesize'); ?>, it must be at least 100M</strong>
<details> <details>
Edit the <code>php.ini</code> file Edit the <code>php.ini</code> file
<br> <br>
<pre><code>sudo nano <?php echo $pathToPHPini; ?></code></pre> <pre><code>sudo nano <?php echo $pathToPHPini; ?></code></pre>
</details> </details>
</div> </div>
<?php <?php
} }
?> ?>
@ -294,17 +294,17 @@ require_once $global['systemRootPath'] . 'objects/functions.php';
<div class="form-group"> <div class="form-group">
<label class="col-md-4 control-label"> <label class="col-md-4 control-label">
<?php echo __("Your Logo"); ?> <?php echo __("Your Logo"); ?>
</label> </label>
<div class="col-md-8 "> <div class="col-md-8 ">
<div id="croppieLogo"></div> <div id="croppieLogo"></div>
<a id="logo-btn" class="btn btn-default btn-xs btn-block"><?php echo __("Upload a logo"); ?></a> <a id="logo-btn" class="btn btn-default btn-xs btn-block"><?php echo __("Upload a logo"); ?></a>
</div> </div>
<input type="file" id="logo" value="Choose a Logo" accept="image/*" style="display: none;" /> <input type="file" id="logo" value="Choose a Logo" accept="image/*" style="display: none;" />
</div> </div>
<div class="form-group"> <div class="form-group">
<label class="col-md-4 control-label"> <label class="col-md-4 control-label">
<?php echo __("Your Small Logo"); ?> (32x32) <?php echo __("Your Small Logo"); ?> (32x32)
</label> </label>
<div class="col-md-8 "> <div class="col-md-8 ">
<div id="croppieLogoSmall"></div> <div id="croppieLogoSmall"></div>
<a id="logoSmall-btn" class="btn btn-default btn-xs btn-block"><?php echo __("Upload a small logo"); ?></a> <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>
<div class="form-group"> <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="col-md-8 inputGroupContainer">
<div class="input-group"> <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" > <select class="form-control" id="mode" >
<option value="Youtube" <?php echo ($config->getMode() == "Youtube") ? "selected" : ""; ?>><?php echo __("Youtube"); ?></option> <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> <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>
<div class="form-group"> <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="col-md-8 inputGroupContainer">
<div class="input-group"> <div class="input-group">
<span class="input-group-addon"><i class="glyphicon glyphicon-globe"></i></span> <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> </div>
<div class="form-group"> <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="col-md-8 inputGroupContainer">
<div class="input-group"> <div class="input-group">
<span class="input-group-addon"><i class="glyphicon glyphicon-flag"></i></span> <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> </div>
<div class="form-group"> <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="col-md-8 inputGroupContainer">
<div class="input-group"> <div class="input-group">
<span class="input-group-addon"><i class="glyphicon glyphicon-envelope"></i></span> <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"> <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="col-md-8 inputGroupContainer">
<div class="input-group"> <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" > <select class="form-control" id="authCanUploadVideos" >
<option value="1" <?php echo ($config->getAuthCanUploadVideos() == 1) ? "selected" : ""; ?>><?php echo __("Yes"); ?></option> <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> <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>
<div class="form-group"> <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="col-md-8 inputGroupContainer">
<div class="input-group"> <div class="input-group">
<span class="input-group-addon"><i class="fa fa-commenting"></i></span> <span class="input-group-addon"><i class="fa fa-commenting"></i></span>
@ -381,22 +381,22 @@ require_once $global['systemRootPath'] . 'objects/functions.php';
</select> </select>
</div> </div>
</div> </div>
</div> </div>
<div class="form-group"> <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"> <div class="col-md-8">
<input data-toggle="toggle" type="checkbox" name="autoplay" id="autoplay" value="1" <?php <input data-toggle="toggle" type="checkbox" name="autoplay" id="autoplay" value="1" <?php
if (!empty($config->getAutoplay())) { if (!empty($config->getAutoplay())) {
echo "checked"; echo "checked";
} }
?>> ?>>
</div> </div>
</div> </div>
<div class="form-group"> <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="col-md-8">
<div class="input-group"> <div class="input-group">
<span class="input-group-addon"><i class="fa fa-facebook-square"></i></span> <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>
</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="col-md-8 inputGroupContainer">
<div class="input-group"> <div class="input-group">
<span class="input-group-addon"><i class="fa fa-id-card"></i></span> <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() ?>" > <input id="authFacebook_id" placeholder="<?php echo __("Facebook ID"); ?>" class="form-control" type="text" value="<?php echo $config->getAuthFacebook_id() ?>" >
</div> </div>
</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="col-md-8 inputGroupContainer">
<div class="input-group"> <div class="input-group">
<span class="input-group-addon"><i class="fa fa-key"></i></span> <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>
<div class="form-group"> <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="col-md-8">
<div class="input-group"> <div class="input-group">
<span class="input-group-addon"><i class="fa fa-google"></i></span> <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>
</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="col-md-8 inputGroupContainer">
<div class="input-group"> <div class="input-group">
<span class="input-group-addon"><i class="fa fa-id-card"></i></span> <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() ?>" > <input id="authGoogle_id" placeholder="<?php echo __("Google ID"); ?>" class="form-control" type="text" value="<?php echo $config->getAuthGoogle_id() ?>" >
</div> </div>
</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="col-md-8 inputGroupContainer">
<div class="input-group"> <div class="input-group">
<span class="input-group-addon"><i class="fa fa-key"></i></span> <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> <legend><?php echo __("Advanced configuration"); ?></legend>
<div class="form-group"> <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"> <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"> <small id="encoder_urlHelp" class="form-text text-muted">
<?php echo __("You need to set up an encoder server"); ?><br> <?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> <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> </small>
</div> </div>
</div> </div>
<div class="form-group"> <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"> <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> </div>
<div class="form-group"> <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"> <div class="col-md-10">
<input data-toggle="toggle" type="checkbox" name="disable_analytics" id="disable_analytics" value="1" <?php <input data-toggle="toggle" type="checkbox" name="disable_analytics" id="disable_analytics" value="1" <?php
if (!empty($config->getDisable_analytics())) { if (!empty($config->getDisable_analytics())) {
echo "checked"; 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> <small id="disable_analyticsHelp" class="form-text text-muted"><?php echo __("This help us to track and dettect errors"); ?></small>
</div> </div>
</div> </div>
<div class="form-group"> <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"> <div class="col-md-10">
<input data-toggle="toggle" type="checkbox" name="enableSmtp" id="enableSmtp" value="1" <?php <input data-toggle="toggle" type="checkbox" name="enableSmtp" id="enableSmtp" value="1" <?php
if (!empty($config->getSmtp())) { if (!empty($config->getSmtp())) {
echo "checked"; echo "checked";
} }
?> > ?> >
</div> </div>
</div> </div>
<div class="form-group"> <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"> <div class="col-md-10">
<input data-toggle="toggle" type="checkbox" name="enableSmtpAuth" id="enableSmtpAuth" value="1" <?php <input data-toggle="toggle" type="checkbox" name="enableSmtpAuth" id="enableSmtpAuth" value="1" <?php
if (!empty($config->getSmtpAuth())) { if (!empty($config->getSmtpAuth())) {
echo "checked"; echo "checked";
} }
?> > ?> >
</div> </div>
</div> </div>
<div class="form-group"> <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"> <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> <small id="smtpSecureHelp" class="form-text text-muted"><?php echo __("Use tls OR ssl"); ?></small>
</div> </div>
</div> </div>
<div class="form-group"> <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"> <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> <small id="smtpPortHelp" class="form-text text-muted"><?php echo __("465 OR 587"); ?></small>
</div> </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>
<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"> <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"> <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> </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> </fieldset>
<?php <?php
} else { } else {
@ -570,7 +570,7 @@ require_once $global['systemRootPath'] . 'objects/functions.php';
<legend><?php echo __("Script Code"); ?></legend> <legend><?php echo __("Script Code"); ?></legend>
<div class="form-group"> <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"> <div class="col-md-10">
<textarea id="head" class="form-control" type="text" rows="20" ><?php echo $config->getHead(); ?></textarea> <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> <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> </div>
<div class="form-group"> <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"> <div class="col-md-10">
<textarea id="adsense" class="form-control" type="text" rows="20" ><?php echo $config->getAdsense(); ?></textarea> <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> <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--> <!-- Text input-->
<div class="form-group"> <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="col-md-4 inputGroupContainer">
<div class="input-group"> <div class="input-group">
<span class="input-group-addon"><i class="glyphicon glyphicon-user"></i></span> <span class="input-group-addon"><i class="glyphicon glyphicon-user"></i></span>
@ -37,7 +37,7 @@ require_once '../videos/configuration.php';
<!-- Text input--> <!-- Text input-->
<div class="form-group"> <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="col-md-4 inputGroupContainer">
<div class="input-group"> <div class="input-group">
<span class="input-group-addon"><i class="glyphicon glyphicon-envelope"></i></span> <span class="input-group-addon"><i class="glyphicon glyphicon-envelope"></i></span>
@ -49,7 +49,7 @@ require_once '../videos/configuration.php';
<!-- Text input--> <!-- Text input-->
<div class="form-group"> <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="col-md-4 inputGroupContainer">
<div class="input-group"> <div class="input-group">
<span class="input-group-addon"><i class="glyphicon glyphicon-globe"></i></span> <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"> <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="col-md-4 inputGroupContainer">
<div class="input-group"> <div class="input-group">
<span class="input-group-addon"><img src="<?php echo $global['webSiteRootURL']; ?>captcha" id="captcha"></span> <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; font-size: 12px;
} }
html, html,
@ -9,16 +9,13 @@ body {
body { body {
padding-top: 60px; padding-top: 60px;
} }
.nopadding { .nopadding {
padding: 0 !important; padding: 0 !important;
margin: 0 !important; margin: 0 !important;
} }
.videoLink .duration {
.videoLink .duration{
position: absolute; position: absolute;
background: rgba(0,0, 0, 0.6)!important; background: rgba(0, 0, 0, 0.6)!important;
padding: 2px; padding: 2px;
color: #FFF; color: #FFF;
bottom: 5px; bottom: 5px;
@ -26,53 +23,51 @@ body {
font-size: 0.9em; font-size: 0.9em;
border-radius: 5px; border-radius: 5px;
} }
.videoLink .glyphicon-play-circle{ .videoLink .glyphicon-play-circle {
transition: all 0.3s ease-in-out; transition: all 0.3s ease-in-out;
top: 50%; top: 50%;
left: 50%; left: 50%;
margin: -25px 0 0 -25px; margin: -25px 0 0 -25px;
position: absolute; position: absolute;
color: rgba(255,255, 255, 0.3)!important; color: rgba(255, 255, 255, 0.3)!important;
font-size: 50px; font-size: 50px;
} }
.videoLink div {
.videoLink div{
transition: all 0.3s ease-in-out; transition: all 0.3s ease-in-out;
font-size: 1em; font-size: 1em;
} }
.videoLink div.details, .videoLink div.details div{ .videoLink div.details,
.videoLink div.details div {
font-size: 0.9em; font-size: 0.9em;
} }
.gallery:hover .glyphicon-play-circle,
.gallery:hover .glyphicon-play-circle, .videoLink:hover .glyphicon-play-circle{ .videoLink:hover .glyphicon-play-circle {
color: rgba(255,255, 255, 0.6)!important; color: rgba(255, 255, 255, 0.6)!important;
} }
.bottom-border {
.bottom-border{
border-bottom: 2px solid #F2F2F2; border-bottom: 2px solid #F2F2F2;
margin: 0; margin: 0;
padding: 5px; padding: 5px;
} }
h1,
h1,h2,h3,h4{ h2,
h3,
h4 {
margin: 5px; margin: 5px;
padding: 5px; padding: 5px;
} }
h1 {
h1{
font-size: 20px; font-size: 20px;
} }
h2{ h2 {
font-size: 18px; font-size: 18px;
} }
h3{ h3 {
font-size: 16px; font-size: 16px;
} }
h4{ h4 {
font-size: 14px; font-size: 14px;
} }
footer { footer {
color: #444; color: #444;
padding: 25px; padding: 25px;
@ -83,7 +78,7 @@ footer {
} }
footer .btn-outline:hover, footer .btn-outline:hover,
footer .btn-outline:focus, footer .btn-outline:focus,
footer .btn-outline:active{ footer .btn-outline:active {
color: #444; color: #444;
background: white; background: white;
border: solid 2px white; border: solid 2px white;
@ -97,20 +92,18 @@ footer .btn-outline {
} }
/* for main video */ /* for main video */
.video-content { .video-content {
flex:0 1 100%; flex: 0 1 100%;
height:50%; height: 50%;
display:flex; display: flex;
justify-content:flex-start; justify-content: flex-start;
} }
.main-video{ .main-video {
background-color: #000; background-color: #000;
margin-bottom: 10px; margin-bottom: 10px;
} }
/* end for main video */ /* end for main video */
.form-compact .form-control { .form-compact .form-control {
position: relative; position: relative;
height: auto; height: auto;
@ -124,16 +117,17 @@ footer .btn-outline {
border-radius: 0; border-radius: 0;
margin-bottom: -1px; 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-left-radius: 5px;
border-top-right-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-left-radius: 5px;
border-bottom-right-radius: 5px; border-bottom-right-radius: 5px;
margin-bottom: 10px; margin-bottom: 10px;
} }
@media (max-width: 767px) { @media (max-width: 767px) {
.navbar-form { .navbar-form {
padding: 0; padding: 0;
@ -142,17 +136,17 @@ footer .btn-outline {
/* Comments */ /* Comments */
.commenterName small { .commenterName small {
font-family:verdana; font-family: verdana;
font-size:0.9em; font-size: 0.9em;
} }
.commenterName { .commenterName {
margin-right:5px; margin-right: 5px;
} }
.commentText { .commentText {
clear: both; clear: both;
} }
.commentDetails { .commentDetails {
margin:0 0 0 60px; margin: 0 0 0 60px;
} }
/* End Comments */ /* End Comments */
@ -175,17 +169,21 @@ footer .btn-outline {
border: 0; border: 0;
margin-right: 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; 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; border: 0;
background: none !important; 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; 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; margin-top: 0px;
} }
.tabbable-line > .nav-tabs > li.active { .tabbable-line > .nav-tabs > li.active {
@ -213,40 +211,35 @@ footer .btn-outline {
.nowrapCell td { .nowrapCell td {
white-space: normal !important; white-space: normal !important;
} }
.watch8-action-buttons {
.watch8-action-buttons{
padding: 5px 10px 0 10px; padding: 5px 10px 0 10px;
margin: 5px 0 0 0; margin: 5px 0 0 0;
border-top: 2px solid #F2F2F2; border-top: 2px solid #F2F2F2;
} }
.bgWhite{ .bgWhite {
margin: 0 0 10px; margin: 0 0 10px;
border: 0; border: 0;
box-shadow: 0 1px 2px rgba(0,0,0,.1); box-shadow: 0 1px 2px rgba(0, 0, 0, .1);
-moz-box-sizing: border-box; -moz-box-sizing: border-box;
box-sizing: border-box; box-sizing: border-box;
padding: 10px; padding: 10px;
overflow: hidden; overflow: hidden;
text-overflow: ellipsis; text-overflow: ellipsis;
} }
.no-outline {
.no-outline{
border: 0; border: 0;
} }
.no-outline:focus,
.no-outline:focus, .no-outline:active,
.no-outline:active, .no-outline:hover {
.no-outline:hover{
background-color: transparent; background-color: transparent;
color: #000; color: #000;
} }
#showMore {
#showMore{
padding: 20px; padding: 20px;
margin: 10px; margin: 10px;
border-top: 2px solid #F2F2F2; border-top: 2px solid #F2F2F2;
} }
.watch-view-count { .watch-view-count {
line-height: 24px; line-height: 24px;
max-height: 24px; max-height: 24px;
@ -256,26 +249,25 @@ footer .btn-outline {
padding: -5px; padding: -5px;
border-bottom: 2px solid #167ac6; border-bottom: 2px solid #167ac6;
} }
#likeBtn.myVote span,
#likeBtn.myVote span, #likeBtn.myVote small { #likeBtn.myVote small {
color: #167ac6; color: #167ac6;
} }
#dislikeBtn.myVote span, #dislikeBtn.myVote small { #dislikeBtn.myVote span,
#dislikeBtn.myVote small {
color: #444; color: #444;
} }
/* fancy checkbox */ /* fancy checkbox */
.material-switch > input[type="checkbox"] { .material-switch > input[type="checkbox"] {
display: none; display: none;
} }
.material-switch > label { .material-switch > label {
cursor: pointer; cursor: pointer;
height: 0px; height: 0px;
position: relative; position: relative;
width: 40px; width: 40px;
} }
.material-switch > label::before { .material-switch > label::before {
background: rgb(0, 0, 0); background: rgb(0, 0, 0);
box-shadow: inset 0px 0px 10px rgba(0, 0, 0, 0.5); box-shadow: inset 0px 0px 10px rgba(0, 0, 0, 0.5);
@ -283,7 +275,7 @@ footer .btn-outline {
content: ''; content: '';
height: 16px; height: 16px;
margin-top: -8px; margin-top: -8px;
position:absolute; position: absolute;
opacity: 0.3; opacity: 0.3;
transition: all 0.4s ease-in-out; transition: all 0.4s ease-in-out;
width: 40px; width: 40px;
@ -311,34 +303,34 @@ footer .btn-outline {
} }
/* fancy checkbox end */ /* fancy checkbox end */
.label.fix-width { .label.fix-width {
min-width: 130px !important; min-width: 130px !important;
display: inline-block !important; display: inline-block !important;
text-align: left; text-align: left;
border-top-left-radius: 0; border-top-left-radius: 0;
border-bottom-left-radius: 0; border-bottom-left-radius: 0;
} }
.label.fix-width.label-primary { .label.fix-width.label-primary {
min-width: 70px !important; min-width: 70px !important;
text-align: right; text-align: right;
border-top-right-radius: 0; border-top-right-radius: 0;
border-bottom-right-radius: 0; border-bottom-right-radius: 0;
border-top-left-radius: 0.25em;; border-top-left-radius: 0.25em;
border-bottom-left-radius: 0.25em;; ;
border-bottom-left-radius: 0.25em;
;
} }
.popover-content,
.popover-content, .popover-title, .popover{ .popover-title,
color:#333 !important; .popover {
color: #333 !important;
} }
.videosDetails {
.videosDetails{
padding-left: 20px; padding-left: 20px;
} }
.divMainVideo .duration {
.divMainVideo .duration{
position: absolute; position: absolute;
background: rgba(0,0, 0, 0.6)!important; background: rgba(0, 0, 0, 0.6)!important;
padding: 3px; padding: 3px;
color: #FFF; color: #FFF;
bottom: 5px; bottom: 5px;
@ -346,10 +338,9 @@ footer .btn-outline {
font-size: 0.9em; font-size: 0.9em;
border-radius: 5px; border-radius: 5px;
} }
.gallery .duration {
.gallery .duration{
position: absolute; position: absolute;
background: rgba(0,0, 0, 0.6)!important; background: rgba(0, 0, 0, 0.6)!important;
padding: 3px; padding: 3px;
color: #FFF; color: #FFF;
top: 5px; top: 5px;
@ -357,96 +348,111 @@ footer .btn-outline {
font-size: 0.9em; font-size: 0.9em;
border-radius: 5px; border-radius: 5px;
} }
.gallery h2,
.gallery h2, .videosDetails .title{ .videosDetails .title {
font-size: 1em; font-size: 1em;
margin: 0; margin: 0;
padding: 0; padding: 0;
overflow: hidden; overflow: hidden;
text-overflow: ellipsis; text-overflow: ellipsis;
display: -webkit-box; display: -webkit-box;
line-height: 16px; /* fallback */ line-height: 16px; /* fallback */
max-height: 32px; /* fallback */ max-height: 32px; /* fallback */
min-height: 32px; /* fallback */ min-height: 32px; /* fallback */
-webkit-line-clamp: 2; /* number of lines to show */ -webkit-line-clamp: 2; /* number of lines to show */
-webkit-box-orient: vertical; -webkit-box-orient: vertical;
} }
.gallery .watch-view-count {
.gallery .watch-view-count{
font-size: 0.8em; font-size: 0.8em;
font-weight: normal; font-weight: normal;
border: 0; border: 0;
margin: 0; margin: 0;
padding: 0; padding: 0;
} }
.galleryVideo {
.galleryVideo{
overflow: hidden; overflow: hidden;
height: 190px; height: 190px;
border-bottom: solid 1px #EEE; border-bottom: solid 1px #EEE;
margin-bottom: 10px; margin-bottom: 10px;
} }
.galleryVideo .group { .galleryVideo .group {
overflow: hidden; overflow: hidden;
text-overflow: ellipsis; text-overflow: ellipsis;
} }
.autoplay span span {
.autoplay span span{
margin: 0 5px; margin: 0 5px;
font-weight: bold; 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{ -webkit-transform: rotate(90deg);
transform:rotate(90deg); /* Safari and Chrome */
-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 */
}
.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; background-color: #e62117;
color: #FFF; color: #FFF;
} }
.subscribeButton:hover, .subscribeButton:active, .subscribeButton:focus{ .subscribeButton:hover,
.subscribeButton:active,
.subscribeButton:focus {
background-color: #CC0000; background-color: #CC0000;
color: #FFF; color: #FFF;
} }
.subscribeButton span:before { .subscribeButton span:before {
content: "\f16a"; content: "\f16a";
} }
.subscribeButton.subscribed {
.subscribeButton.subscribed{
background-color: #DDD; background-color: #DDD;
color: #777; color: #777;
} }
.subscribeButton.subscribed span:before { .subscribeButton.subscribed span:before {
content: "\f00c"; content: "\f00c";
} }
.subscribeButton.subscribed:hover span:before { .subscribeButton.subscribed:hover span:before {
content: "\f057"; content: "\f057";
} }
.profileBg {
.profileBg{
padding: 20px; padding: 20px;
min-height: 200px; min-height: 200px;
margin: 10px 0; margin: 10px 0;
@ -455,16 +461,14 @@ img.rotate270, img.rotate-90{
-o-background-size: cover; -o-background-size: cover;
background-size: cover; background-size: cover;
} }
#sidebar {
#sidebar{
width: 300px; width: 300px;
position: absolute; position: absolute;
top: 0; top: 0;
height: 100vh; height: 100vh;
margin-top: 55px; margin-top: 55px;
} }
#sideBarContainer{ #sideBarContainer {
overflow-y: auto; overflow-y: auto;
position: absolute; position: absolute;
left: 0; left: 0;
@ -472,7 +476,7 @@ img.rotate270, img.rotate-90{
height: 100%; height: 100%;
width: 100%; width: 100%;
} }
#sideBarContainer ul{ #sideBarContainer ul {
margin-bottom: 150px; margin-bottom: 150px;
} }
.navbar-brand { .navbar-brand {
@ -483,17 +487,16 @@ img.rotate270, img.rotate-90{
.navbar-brand>img { .navbar-brand>img {
width: 120px; width: 120px;
} }
.list-inline { .list-inline {
display: flex; display: flex;
justify-content: left; justify-content: left;
} }
footer ul.list-inline{ footer ul.list-inline {
justify-content: center; justify-content: center;
} }
footer ul.list-inline li{ footer ul.list-inline li {
justify-content: center; justify-content: center;
align-items: center; align-items: center;
} }
/** header **/ /** header **/
@ -504,57 +507,54 @@ nav ul.items-container {
padding: 0px; padding: 0px;
} }
nav ul.items-container, nav ul.items-container,
nav ul.items-container li{ nav ul.items-container li {
list-style: none; list-style: none;
} }
nav ul.items-container li:first-child{ nav ul.items-container li:first-child {
flex: 1; flex: 1;
display: flex; display: flex;
} }
nav ul.items-container li:first-child ul.left-side{ nav ul.items-container li:first-child ul.left-side {
display: flex; display: flex;
align-items: center align-items: center
} }
nav ul.items-container li:last-child{ nav ul.items-container li:last-child {
margin-right: 20px; margin-right: 20px;
} }
nav ul.items-container li ul.right-menus { nav ul.items-container li ul.right-menus {
display: flex; display: flex;
flex-direction: row; flex-direction: row;
} }
nav ul.items-container li ul.right-menus li{ nav ul.items-container li ul.right-menus li {
margin-left: 20px; margin-left: 20px;
} }
/** header **/ /** header **/
.navbar .container {
.navbar .container{ padding: 0 2px;
padding: 0 2px;
align-items: center; align-items: center;
} }
.list-inline > li { .list-inline > li {
display: flex; display: flex;
} }
.navbar .list-inline{ .navbar .list-inline {
margin: 0; margin: 0;
display: flex; display: flex;
align-items: center; align-items: center;
} }
/* Play List */ /* Play List */
.playlistList{ .playlistList {
height: 400px; height: 400px;
overflow: hidden; overflow: hidden;
} }
.playlistList .nav {
.playlistList .nav{
overflow-y: auto; overflow-y: auto;
position: absolute; position: absolute;
top: 0; top: 0;
height: 100%; height: 100%;
overflow-x: hidden; overflow-x: hidden;
} }
.playlist-nav .navbar { .playlist-nav .navbar {
padding: 0; padding: 0;
max-height: none; max-height: none;
@ -574,7 +574,7 @@ nav ul.items-container li ul.right-menus li{
} }
/* End Play List */ /* End Play List */
.floatVideo{ .floatVideo {
position: fixed !important; position: fixed !important;
width: 550px; width: 550px;
top: 70px; top: 70px;
@ -582,15 +582,15 @@ nav ul.items-container li ul.right-menus li{
z-index: 100; z-index: 100;
overflow: visible; overflow: visible;
} }
.floatVideo #main-video{ .floatVideo #main-video {
-webkit-box-shadow: 2px 0px 19px 2px rgba(0,0,0,1); -webkit-box-shadow: 2px 0px 19px 2px rgba(0, 0, 0, 1);
-moz-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); box-shadow: 2px 0px 19px 2px rgba(0, 0, 0, 1);
-webkit-border-radius: 5px; -webkit-border-radius: 5px;
-moz-border-radius: 5px; -moz-border-radius: 5px;
border-radius: 5px; border-radius: 5px;
} }
#floatButtons{ #floatButtons {
z-index: 110; z-index: 110;
position: absolute; position: absolute;
right: -10px; right: -10px;
@ -598,21 +598,21 @@ nav ul.items-container li ul.right-menus li{
} }
#floatButtons .btn-outline:hover, #floatButtons .btn-outline:hover,
#floatButtons .btn-outline:focus, #floatButtons .btn-outline:focus,
#floatButtons .btn-outline:active{ #floatButtons .btn-outline:active {
color: rgba(255,255,255,1); color: rgba(255, 255, 255, 1);
background-color: rgba(0,0,0,0.5); background-color: rgba(0, 0, 0, 0.5);
} }
#floatButtons .btn-outline { #floatButtons .btn-outline {
color: rgba(255,255,255,0.3); color: rgba(255, 255, 255, 0.3);
background-color: rgba(0,0,0,0.1); background-color: rgba(0, 0, 0, 0.1);
transition: all 0.3s ease-in-out; transition: all 0.3s ease-in-out;
border-radius: 10px; border-radius: 10px;
} }
#videoContainer {
#videoContainer{ overflow: visible;
overflow: visible; background: black;
background: black;
} }
/** video manager progress bar */ /** video manager progress bar */
.progress { .progress {
position: relative; position: relative;
@ -632,7 +632,6 @@ nav ul.items-container li ul.right-menus li{
font-weight: 800; font-weight: 800;
padding: 3px 10px 2px; padding: 3px 10px 2px;
} }
.loader { .loader {
border: 5px solid #f3f3f3; /* Light grey */ border: 5px solid #f3f3f3; /* Light grey */
border-top: 5px solid #3498db; /* Blue */ border-top: 5px solid #3498db; /* Blue */
@ -641,57 +640,58 @@ nav ul.items-container li ul.right-menus li{
height: 30px; height: 30px;
animation: spin 2s linear infinite; animation: spin 2s linear infinite;
} }
@keyframes spin { @keyframes spin {
0% { transform: rotate(0deg); } 0% {
100% { transform: rotate(360deg); } transform: rotate(0deg);
}
100% {
transform: rotate(360deg);
}
} }
@media (max-width: 1200px) { @media (max-width: 1200px) {
.floatVideo{ .floatVideo {
width: 500px; width: 500px;
} }
.galleryVideo{ .galleryVideo {
height: 195px; height: 195px;
} }
} }
@media (max-width: 992px) { @media (max-width: 992px) {
.floatVideo{ .floatVideo {
width: 450px; width: 450px;
} }
.galleryVideo{ .galleryVideo {
height: 220px; height: 220px;
} }
} }
@media (max-width: 850px) { @media (max-width: 850px) {
.galleryVideo{ .galleryVideo {
height: 180px; height: 180px;
} }
} }
@media (max-width: 768px) { @media (max-width: 768px) {
.galleryVideo{ .galleryVideo {
height: 290px; height: 290px;
} }
} }
@media (max-width: 650px) { @media (max-width: 650px) {
.galleryVideo{ .galleryVideo {
height: 250px; height: 250px;
} }
} }
@media (max-width: 500px) { @media (max-width: 500px) {
.floatVideo{ .floatVideo {
width: 380px; width: 380px;
} }
.galleryVideo{ .galleryVideo {
height: 200px; height: 200px;
} }
} }
@media (max-width: 400px) { @media (max-width: 400px) {
.floatVideo{ .floatVideo {
width: 320px; width: 320px;
} }
.galleryVideo{ .galleryVideo {
height: 180px; height: 180px;
} }
} }

View file

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

View file

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

View file

@ -53,7 +53,7 @@ function isYoutubeDl() {
<legend><?php echo __("Download Video"); ?></legend> <legend><?php echo __("Download Video"); ?></legend>
<div class="form-group"> <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="col-md-8 inputGroupContainer">
<div class="input-group"> <div class="input-group">
<span class="input-group-addon"><i class="glyphicon glyphicon-film"></i></span> <span class="input-group-addon"><i class="glyphicon glyphicon-film"></i></span>
@ -63,7 +63,7 @@ function isYoutubeDl() {
</div> </div>
<!-- TODO audio only --> <!-- TODO audio only -->
<div class="form-group" style="display: none"> <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="col-md-8 inputGroupContainer">
<div class="input-group"> <div class="input-group">
<span class="input-group-addon"><i class="glyphicon glyphicon-headphones"></i></span> <span class="input-group-addon"><i class="glyphicon glyphicon-headphones"></i></span>
@ -91,7 +91,7 @@ function isYoutubeDl() {
$minutesTotal = getMinutesTotalVideosLength(); $minutesTotal = getMinutesTotalVideosLength();
?> ?>
<div class="alert alert-warning"> <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> </div>
<?php <?php
} }

View file

@ -7,7 +7,7 @@
<source src="<?php echo $global['webSiteRootURL']; ?>videos/<?php echo $video['filename']; ?>.mp3" type="audio/mpeg" /> <source src="<?php echo $global['webSiteRootURL']; ?>videos/<?php echo $video['filename']; ?>.mp3" type="audio/mpeg" />
<a href="<?php echo $global['webSiteRootURL']; ?>videos/<?php echo $video['filename']; ?>.mp3">horse</a> <a href="<?php echo $global['webSiteRootURL']; ?>videos/<?php echo $video['filename']; ?>.mp3">horse</a>
</audio> </audio>
</div> </div>
<div class="col-xs-12 col-sm-12 col-lg-2"></div> <div class="col-xs-12 col-sm-12 col-lg-2"></div>
</div><!--/row--> </div><!--/row-->

View file

@ -8,20 +8,20 @@ require_once '../../videos/configuration.php';
<meta name="viewport" content="width=device-width, initial-scale=1.0"/> <meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<title><?php echo $config->getWebSiteTitle(); ?></title> <title><?php echo $config->getWebSiteTitle(); ?></title>
<style type="text/css"> <style type="text/css">
</style> </style>
</head> </head>
<body leftmargin="10" rightmargin="10" marginwidth="10" topmargin="10" bottommargin="10" marginheight="10" offset="0" bgcolor="#f0f1f4"> <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;"> <table width="80%" cellpadding="10" cellspacing="0" border="0" align="center" bgcolor="#FFF" style="margin:0 auto;">
<tr> <tr>
<td align="center"><img src="<?php echo $global['webSiteRootURL'], $config->getLogo(); ?>" alt="<?php echo $config->getWebSiteTitle(); ?>"/></td> <td align="center"><img src="<?php echo $global['webSiteRootURL'], $config->getLogo(); ?>" alt="<?php echo $config->getWebSiteTitle(); ?>"/></td>
</tr> </tr>
<tr> <tr>
<td>{message}</td> <td>{message}</td>
</tr> </tr>
<tr> <tr>
<td></td> <td></td>
</tr> </tr>
</table> </table>
</body> </body>
</html> </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 src="<?php echo $global['webSiteRootURL']; ?>js/jquery-3.2.0.min.js" type="text/javascript"></script>
<script> <script>
var webSiteRootURL = '<?php echo $global['webSiteRootURL']; ?>'; var webSiteRootURL = '<?php echo $global['webSiteRootURL']; ?>';
</script> </script>
<?php <?php
if(!$config->getDisable_analytics()){ if (!$config->getDisable_analytics()) {
?> ?>
<script> <script>
// YouPHPTube Analytics // YouPHPTube Analytics
@ -36,7 +36,7 @@ if(!$config->getDisable_analytics()){
ga('create', 'UA-96597943-1', 'auto', 'youPHPTube'); ga('create', 'UA-96597943-1', 'auto', 'youPHPTube');
ga('youPHPTube.send', 'pageview'); ga('youPHPTube.send', 'pageview');
</script> </script>
<?php <?php
} }
echo $config->getHead(); echo $config->getHead();

View file

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

View file

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

View file

@ -34,8 +34,8 @@ if (!empty($ad)) {
echo " ad"; echo " ad";
} }
?>"> ?>">
<video poster="<?php echo $poster; ?>" controls crossorigin <video poster="<?php echo $poster; ?>" controls crossorigin
class="embed-responsive-item video-js vjs-default-skin <?php echo $vjsClass; ?> vjs-big-play-centered" class="embed-responsive-item video-js vjs-default-skin <?php echo $vjsClass; ?> vjs-big-play-centered"
id="mainVideo" data-setup='{ aspectRatio: "<?php echo $aspectRatio; ?>" }'> 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']; ?>.mp4" type="video/mp4">
<source src="<?php echo $global['webSiteRootURL']; ?>videos/<?php echo $playNowVideo['filename']; ?>.webm" type="video/webm"> <source src="<?php echo $global['webSiteRootURL']; ?>videos/<?php echo $playNowVideo['filename']; ?>.webm" type="video/webm">
@ -46,7 +46,7 @@ if (!empty($ad)) {
</p> </p>
</video> </video>
<?php if (!empty($logId)) { ?> <?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 <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']); $url = parse_url($ad['redirect']);
echo $url['host']; echo $url['host'];
@ -57,7 +57,7 @@ if (!empty($ad)) {
<?php } ?> <?php } ?>
</div> </div>
</div> </div>
</div> </div>
<div class="col-xs-12 col-sm-12 col-lg-2"></div> <div class="col-xs-12 col-sm-12 col-lg-2"></div>
</div><!--/row--> </div><!--/row-->

View file

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

View file

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

View file

@ -189,7 +189,7 @@ $userGroups = UserGroups::getAllUsersGroups();
closeOnConfirm: false closeOnConfirm: false
}, },
function () { function () {
modal.showPleaseWait(); modal.showPleaseWait();
$.ajax({ $.ajax({
url: 'deleteUser', 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="<?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"/> <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> </head>
<body> <body>
@ -39,15 +39,15 @@ $userGroups = UserGroups::getAllUsersGroups();
<span class="fa fa-user"></span> <?php echo __("Users"); ?> <span class="fa fa-user"></span> <?php echo __("Users"); ?>
</a> </a>
<a href="<?php echo $global['webSiteRootURL']; ?>charts" class="btn btn-info"> <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"); ?> <?php echo __("Video Chart"); ?>
</a> </a>
<a href="<?php echo $config->getEncoderURL(), "?webSiteRootURL=", urlencode($global['webSiteRootURL']), "&user=", urlencode(User::getUserName()), "&pass=", urlencode(User::getUserPass()); ?>" class="btn btn-default"> <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"); ?> <?php echo __("Encoder Site"); ?>
</a> </a>
<a href="<?php echo $global['webSiteRootURL']; ?>upload" class="btn btn-default"> <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"); ?> <?php echo __("Upload a MP4 File"); ?>
</a> </a>
@ -80,7 +80,7 @@ $userGroups = UserGroups::getAllUsersGroups();
} }
?> and you have <?php echo $global['videoStorageLimitMinutes']; ?> minutes of storage ?> and you have <?php echo $global['videoStorageLimitMinutes']; ?> minutes of storage
<div class="progress"> <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; ?>%"> aria-valuenow="<?php echo $percent; ?>" aria-valuemin="0" aria-valuemax="100" style="width: <?php echo $percent; ?>%">
<?php echo $percent; ?>% of your storage limit used <?php echo $percent; ?>% of your storage limit used
</div> </div>

View file

@ -58,7 +58,7 @@ $totalPages = ceil($total / $_POST['rowCount']);
<?php <?php
echo $config->getAdsense(); echo $config->getAdsense();
?> ?>
</div> </div>
<div class="container-fluid gallery" itemscope itemtype="http://schema.org/VideoObject"> <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-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"> <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 { } else {
$poster = "{$global['webSiteRootURL']}view/img/audio_wave.jpg"; $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']; ?>" /> <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 <?php
if (!empty($imgGif)) { 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" /> <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> <span class="duration"><?php echo Video::getCleanDuration($value['duration']); ?></span>
</a> </a>
<a href="<?php echo $global['webSiteRootURL']; ?>video/<?php echo $value['clean_title']; ?>" title="<?php echo $value['title']; ?>"> <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> </div>
<?php <?php
} }
?> ?>
</div> </div>
<div class="row"> <div class="row">
@ -135,7 +135,7 @@ $totalPages = ceil($total / $_POST['rowCount']);
<div class="alert alert-warning"> <div class="alert alert-warning">
<span class="glyphicon glyphicon-facetime-video"></span> <strong><?php echo __("Warning"); ?>!</strong> <?php echo __("We have not found any videos or audios to show"); ?>. <span class="glyphicon glyphicon-facetime-video"></span> <strong><?php echo __("Warning"); ?>!</strong> <?php echo __("We have not found any videos or audios to show"); ?>.
</div> </div>
<?php } ?> <?php } ?>
</div> </div>
<div class="col-xs-12 col-sm-1 col-md-1 col-lg-1"></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 bgWhite list-group-item">
<div class="row divMainVideo"> <div class="row divMainVideo">
<div class="col-xs-4 col-sm-4 col-lg-4"> <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> <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="thumbnailUrl" content="<?php echo $img; ?>" />
<meta itemprop="contentURL" content="<?php echo $global['webSiteRootURL'], $catLink, "video/", $video['clean_title']; ?>" /> <meta itemprop="contentURL" content="<?php echo $global['webSiteRootURL'], $catLink, "video/", $video['clean_title']; ?>" />
@ -158,7 +158,7 @@ if (!empty($video)) {
</h1> </h1>
<div class="col-xs-12 col-sm-12 col-lg-12"><?php echo $video['creator']; ?></div> <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> <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>
<div class="row"> <div class="row">
@ -189,7 +189,7 @@ if (!empty($video)) {
<input id="publicPlayList" name="publicPlayList" type="checkbox" checked="checked"/> <input id="publicPlayList" name="publicPlayList" type="checkbox" checked="checked"/>
<label for="publicPlayList" class="label-success"></label> <label for="publicPlayList" class="label-success"></label>
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
<button class="btn btn-success btn-block" id="addPlayList" ><?php echo __("Create a New Play List"); ?></button> <button class="btn btn-success btn-block" id="addPlayList" ><?php echo __("Create a New Play List"); ?></button>
</div> </div>
@ -202,7 +202,7 @@ if (!empty($video)) {
Sign in to add this video to a playlist. Sign in to add this video to a playlist.
<a href="<?php echo $global['webSiteRootURL']; ?>user" class="btn btn-primary"> <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"); ?> <?php echo __("Login"); ?>
</a> </a>
<?php <?php
@ -287,7 +287,7 @@ if (!empty($video)) {
<a href="#" class="btn btn-default no-outline" id="shareBtn"> <a href="#" class="btn btn-default no-outline" id="shareBtn">
<span class="fa fa-share"></span> <?php echo __("Share"); ?> <span class="fa fa-share"></span> <?php echo __("Share"); ?>
</a> </a>
<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 <?php
if (!User::isLogged()) { if (!User::isLogged()) {
?> ?>
@ -295,7 +295,7 @@ if (!empty($video)) {
<?php } ?>> <?php } ?>>
<span class="fa fa-thumbs-down"></span> <small><?php echo $video['dislikes']; ?></small> <span class="fa fa-thumbs-down"></span> <small><?php echo $video['dislikes']; ?></small>
</a> </a>
<a href="#" class="btn btn-default no-outline pull-right <?php echo ($video['myVote'] == 1) ? "myVote" : "" ?>" id="likeBtn" <a href="#" class="btn btn-default no-outline pull-right <?php echo ($video['myVote'] == 1) ? "myVote" : "" ?>" id="likeBtn"
<?php <?php
if (!User::isLogged()) { if (!User::isLogged()) {
?> ?>
@ -351,19 +351,19 @@ if (!empty($video)) {
<ul class="nav nav-tabs"> <ul class="nav nav-tabs">
<li class="nav-item"> <li class="nav-item">
<a class="nav-link " href="#tabShare" data-toggle="tab"> <a class="nav-link " href="#tabShare" data-toggle="tab">
<span class="fa fa-share"></span> <span class="fa fa-share"></span>
<?php echo __("Share"); ?> <?php echo __("Share"); ?>
</a> </a>
</li> </li>
<li class="nav-item"> <li class="nav-item">
<a class="nav-link " href="#tabEmbeded" data-toggle="tab"> <a class="nav-link " href="#tabEmbeded" data-toggle="tab">
<span class="fa fa-code"></span> <span class="fa fa-code"></span>
<?php echo __("Embeded"); ?> <?php echo __("Embeded"); ?>
</a> </a>
</li> </li>
<li class="nav-item"> <li class="nav-item">
<a class="nav-link" href="#tabEmail" data-toggle="tab"> <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"); ?> <?php echo __("E-mail"); ?>
</a> </a>
</li> </li>
@ -408,7 +408,7 @@ if (!empty($video)) {
<fieldset> <fieldset>
<!-- Text input--> <!-- Text input-->
<div class="form-group"> <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="col-md-8 inputGroupContainer">
<div class="input-group"> <div class="input-group">
<span class="input-group-addon"><i class="glyphicon glyphicon-envelope"></i></span> <span class="input-group-addon"><i class="glyphicon glyphicon-envelope"></i></span>
@ -431,7 +431,7 @@ if (!empty($video)) {
<div class="form-group"> <div class="form-group">
<label class="col-md-4 control-label"><?php echo __("Type the code"); ?></label> <label class="col-md-4 control-label"><?php echo __("Type the code"); ?></label>
<div class="col-md-8 inputGroupContainer"> <div class="col-md-8 inputGroupContainer">
<div class="input-group"> <div class="input-group">
<span class="input-group-addon"><img src="<?php echo $global['webSiteRootURL']; ?>captcha" id="captcha"></span> <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>
</div> </div>
<div class="row bgWhite list-group-item"> <div class="row bgWhite list-group-item">
<div class="row"> <div class="row">
<div class="col-xs-12 col-sm-12 col-lg-12"> <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-4 col-sm-2 col-lg-2 text-right"><strong><?php echo __("Description"); ?>:</strong></div>
<div class="col-xs-8 col-sm-10 col-lg-10" itemprop="description"><?php echo nl2br(textToLink($video['description'])); ?></div> <div class="col-xs-8 col-sm-10 col-lg-10" itemprop="description"><?php echo nl2br(textToLink($video['description'])); ?></div>
</div> </div>
</div> </div>
</div> </div>
@ -518,7 +518,7 @@ if (!empty($video)) {
if (!User::canComment()) { if (!User::canComment()) {
echo __("You cannot comment on videos"); echo __("You cannot comment on videos");
} }
?></textarea> ?></textarea>
<?php if (User::canComment()) { ?> <?php if (User::canComment()) { ?>
<span class="input-group-addon btn btn-success" id="saveCommentBtn" <?php <span class="input-group-addon btn btn-success" id="saveCommentBtn" <?php
if (!User::canComment()) { if (!User::canComment()) {
@ -590,7 +590,7 @@ if (!empty($video)) {
</div> </div>
</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 <?php
if (!empty($playlist_id)) { if (!empty($playlist_id)) {
include './include/playlist.php'; include './include/playlist.php';
@ -660,11 +660,11 @@ if (!empty($video)) {
<div class="details row text-muted" itemprop="description"> <div class="details row text-muted" itemprop="description">
<div> <div>
<strong><?php echo __("Category"); ?>: </strong> <strong><?php echo __("Category"); ?>: </strong>
<span class="<?php echo $autoPlayVideo['iconClass']; ?>"></span> <span class="<?php echo $autoPlayVideo['iconClass']; ?>"></span>
<?php echo $autoPlayVideo['category']; ?> <?php echo $autoPlayVideo['category']; ?>
</div> </div>
<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"); ?> <?php echo __("Views"); ?>
</div> </div>
<div><?php echo $autoPlayVideo['creator']; ?></div> <div><?php echo $autoPlayVideo['creator']; ?></div>
@ -697,7 +697,7 @@ if (!empty($video)) {
<!-- videos List --> <!-- videos List -->
<div id="videosList"> <div id="videosList">
<?php include './videosList.php'; ?> <?php include './videosList.php'; ?>
</div> </div>
<!-- End of videos List --> <!-- End of videos List -->
@ -744,7 +744,7 @@ if (!empty($video)) {
<div class="alert alert-warning"> <div class="alert alert-warning">
<span class="glyphicon glyphicon-facetime-video"></span> <strong><?php echo __("Warning"); ?>!</strong> <?php echo __("We have not found any videos or audios to show"); ?>. <span class="glyphicon glyphicon-facetime-video"></span> <strong><?php echo __("Warning"); ?>!</strong> <?php echo __("We have not found any videos or audios to show"); ?>.
</div> </div>
<?php } ?> <?php } ?>
</div> </div>
<?php <?php

View file

@ -29,33 +29,33 @@ foreach ($files as $value) {
break; break;
} }
} }
if($obj->orphan){ if ($obj->orphan) {
if(!empty($_GET['delete'])){ if (!empty($_GET['delete'])) {
$file = $dir.$obj->dirFilename; $file = $dir.$obj->dirFilename;
unlink($file); unlink($file);
}else{ } else {
$arrayOrphan[] = $obj; $arrayOrphan[] = $obj;
} }
}else{ } else {
$arrayNotOrphan[] = $obj; $arrayNotOrphan[] = $obj;
} }
$array[] = $obj; $array[] = $obj;
/* /*
$file = "{$global['systemRootPath']}videos/original_{$video['filename']}"; $file = "{$global['systemRootPath']}videos/original_{$video['filename']}";
if(file_exists($file)){ if (file_exists($file)) {
unlink($file); unlink($file);
} }
$file = "{$global['systemRootPath']}videos/{$video['filename']}.{$value}"; $file = "{$global['systemRootPath']}videos/{$video['filename']}.{$value}";
if(file_exists($file)){ if (file_exists($file)) {
unlink($file); unlink($file);
} }
$file = "{$global['systemRootPath']}videos/{$video['filename']}_progress_{$value}.txt"; $file = "{$global['systemRootPath']}videos/{$video['filename']}_progress_{$value}.txt";
if(file_exists($file)){ if (file_exists($file)) {
unlink($file); unlink($file);
} }
$file = "{$global['systemRootPath']}videos/{$video['filename']}.jpg"; $file = "{$global['systemRootPath']}videos/{$video['filename']}.jpg";
if(file_exists($file)){ if (file_exists($file)) {
unlink($file); unlink($file);
} }
* */ * */
} }
@ -63,8 +63,8 @@ foreach ($files as $value) {
function getMainName($filename) { function getMainName($filename) {
preg_match("/([a-z0-9_]{1,}(\.[a-z0-9_]{5,})?)(\.[a-z0-9]{0,4})?$/i", $filename, $matches); preg_match("/([a-z0-9_]{1,}(\.[a-z0-9_]{5,})?)(\.[a-z0-9]{0,4})?$/i", $filename, $matches);
$parts = explode("_progress_", $matches[1]); $parts = explode("_progress_", $matches[1]);
if(preg_match("/original_.*/", $parts[0])){ if (preg_match("/original_.*/", $parts[0])) {
$parts = explode("original_", $parts[0]); $parts = explode("original_", $parts[0]);
return $parts[1]; return $parts[1];
} }
return $parts[0]; return $parts[0];
@ -86,14 +86,14 @@ function getMainName($filename) {
<div class="container"> <div class="container">
<?php <?php
if(empty($arrayOrphan)){ if (empty($arrayOrphan)) {
?> ?>
<h1 class="alert alert-success"> <h1 class="alert alert-success">
<?php echo __("You dont have any orphan file"); ?> <?php echo __("You dont have any orphan file"); ?>
</h1> </h1>
<?php <?php
}else{ } else {
?> ?>
<ul class="list-group"> <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> <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> <legend><?php echo __("Sign Up"); ?></legend>
<div class="form-group"> <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="col-md-8 inputGroupContainer">
<div class="input-group"> <div class="input-group">
<span class="input-group-addon"><i class="glyphicon glyphicon-pencil"></i></span> <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>
<div class="form-group"> <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="col-md-8 inputGroupContainer">
<div class="input-group"> <div class="input-group">
<span class="input-group-addon"><i class="glyphicon glyphicon-user"></i></span> <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>
<div class="form-group"> <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="col-md-8 inputGroupContainer">
<div class="input-group"> <div class="input-group">
<span class="input-group-addon"><i class="glyphicon glyphicon-envelope"></i></span> <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>
<div class="form-group"> <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="col-md-8 inputGroupContainer">
<div class="input-group"> <div class="input-group">
<span class="input-group-addon"><i class="glyphicon glyphicon-lock"></i></span> <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>
<div class="form-group"> <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="col-md-8 inputGroupContainer">
<div class="input-group"> <div class="input-group">
<span class="input-group-addon"><i class="glyphicon glyphicon-lock"></i></span> <span class="input-group-addon"><i class="glyphicon glyphicon-lock"></i></span>

View file

@ -40,7 +40,7 @@ foreach ($tags as $value) {
</legend> </legend>
<div class="form-group"> <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="col-md-8 inputGroupContainer">
<div class="input-group"> <div class="input-group">
<span class="input-group-addon"><i class="glyphicon glyphicon-pencil"></i></span> <span class="input-group-addon"><i class="glyphicon glyphicon-pencil"></i></span>
@ -50,7 +50,7 @@ foreach ($tags as $value) {
</div> </div>
<div class="form-group"> <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="col-md-8 inputGroupContainer">
<div class="input-group"> <div class="input-group">
<span class="input-group-addon"><i class="glyphicon glyphicon-user"></i></span> <span class="input-group-addon"><i class="glyphicon glyphicon-user"></i></span>
@ -60,7 +60,7 @@ foreach ($tags as $value) {
</div> </div>
<div class="form-group"> <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="col-md-8 inputGroupContainer">
<div class="input-group"> <div class="input-group">
<span class="input-group-addon"><i class="glyphicon glyphicon-envelope"></i></span> <span class="input-group-addon"><i class="glyphicon glyphicon-envelope"></i></span>
@ -70,7 +70,7 @@ foreach ($tags as $value) {
</div> </div>
<div class="form-group"> <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="col-md-8 inputGroupContainer">
<div class="input-group"> <div class="input-group">
<span class="input-group-addon"><i class="glyphicon glyphicon-lock"></i></span> <span class="input-group-addon"><i class="glyphicon glyphicon-lock"></i></span>
@ -80,7 +80,7 @@ foreach ($tags as $value) {
</div> </div>
<div class="form-group"> <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="col-md-8 inputGroupContainer">
<div class="input-group"> <div class="input-group">
<span class="input-group-addon"><i class="glyphicon glyphicon-lock"></i></span> <span class="input-group-addon"><i class="glyphicon glyphicon-lock"></i></span>
@ -247,7 +247,7 @@ foreach ($tags as $value) {
<div class="form-group"> <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="col-md-8 inputGroupContainer">
<div class="input-group"> <div class="input-group">
<span class="input-group-addon"><i class="glyphicon glyphicon-user"></i></span> <span class="input-group-addon"><i class="glyphicon glyphicon-user"></i></span>
@ -258,7 +258,7 @@ foreach ($tags as $value) {
<div class="form-group"> <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="col-md-8 inputGroupContainer">
<div class="input-group"> <div class="input-group">
<span class="input-group-addon"><i class="glyphicon glyphicon-lock"></i></span> <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 '../videos/configuration.php';
require_once $global['systemRootPath'] . 'objects/video.php'; require_once $global['systemRootPath'] . 'objects/video.php';
$video = Video::getVideo(); $video = Video::getVideo();
if(empty($video)){ if (empty($video)) {
die(__("Video not found")); 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']; ?>.ogg" type="audio/ogg" />
<source src="<?php echo $global['webSiteRootURL']; ?>videos/<?php echo $video['filename']; ?>.mp3" type="audio/mpeg" /> <source src="<?php echo $global['webSiteRootURL']; ?>videos/<?php echo $video['filename']; ?>.mp3" type="audio/mpeg" />
<a href="<?php echo $global['webSiteRootURL']; ?>videos/<?php echo $video['filename']; ?>.mp3">horse</a> <a href="<?php echo $global['webSiteRootURL']; ?>videos/<?php echo $video['filename']; ?>.mp3">horse</a>
</audio> </audio>
<?php <?php
} else { } 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 }'> 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']; ?>.mp4" type="video/mp4">
<source src="<?php echo $global['webSiteRootURL']; ?>videos/<?php echo $video['filename']; ?>.webm" type="video/webm"> <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> <p><?php echo __("If you can't view this video, your browser does not support HTML5 videos"); ?></p>
</video> </video>
<?php <?php
} }
?> ?>

View file

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