mirror of
https://github.com/DanielnetoDotCom/YouPHPTube
synced 2025-10-03 01:39:24 +02:00
Offline player test
This commit is contained in:
parent
53dfc89fd2
commit
7d7f568a6f
2 changed files with 583 additions and 582 deletions
770
admin/index.php
770
admin/index.php
|
@ -1,385 +1,385 @@
|
||||||
<?php
|
<?php
|
||||||
$vars = [];
|
$vars = [];
|
||||||
require_once '../videos/configuration.php';
|
require_once '../videos/configuration.php';
|
||||||
require_once './functions.php';
|
require_once './functions.php';
|
||||||
|
if (!User::isAdmin()) {
|
||||||
if (!User::isAdmin()) {
|
header("Location: {$global['webSiteRootURL']}");
|
||||||
header("Location: {$global['webSiteRootURL']}");
|
exit;
|
||||||
exit;
|
}
|
||||||
}
|
adminSecurityCheck(true);
|
||||||
$isAdminPanel = 1;
|
$isAdminPanel = 1;
|
||||||
|
|
||||||
class MenuAdmin
|
class MenuAdmin
|
||||||
{
|
{
|
||||||
public $title;
|
public $title;
|
||||||
public $icon;
|
public $icon;
|
||||||
public $href;
|
public $href;
|
||||||
public $active = false;
|
public $active = false;
|
||||||
public $show = false;
|
public $show = false;
|
||||||
public $itens = [];
|
public $itens = [];
|
||||||
public $data_toggle;
|
public $data_toggle;
|
||||||
public $data_target;
|
public $data_target;
|
||||||
|
|
||||||
public function __construct($title, $icon, $href = "", $data_toggle = "", $data_target = "")
|
public function __construct($title, $icon, $href = "", $data_toggle = "", $data_target = "")
|
||||||
{
|
{
|
||||||
$this->title = $title;
|
$this->title = $title;
|
||||||
$this->icon = $icon;
|
$this->icon = $icon;
|
||||||
$this->href = $href;
|
$this->href = $href;
|
||||||
$this->data_toggle = $data_toggle;
|
$this->data_toggle = $data_toggle;
|
||||||
$this->data_target = $data_target;
|
$this->data_target = $data_target;
|
||||||
if (!empty($href)) {
|
if (!empty($href)) {
|
||||||
$fileName = basename($_SERVER["SCRIPT_NAME"]);
|
$fileName = basename($_SERVER["SCRIPT_NAME"]);
|
||||||
if ($href === $fileName) {
|
if ($href === $fileName) {
|
||||||
$this->active = true;
|
$this->active = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function addItem(MenuAdmin $menu)
|
public function addItem(MenuAdmin $menu)
|
||||||
{
|
{
|
||||||
$this->itens[] = $menu;
|
$this->itens[] = $menu;
|
||||||
if ($menu->active) {
|
if ($menu->active) {
|
||||||
$this->show = true;
|
$this->show = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$itens = [];
|
$itens = [];
|
||||||
|
|
||||||
$menu = new MenuAdmin(__("Dashboard"), "fa fa-tachometer-alt", "dashboard");
|
$menu = new MenuAdmin(__("Dashboard"), "fa fa-tachometer-alt", "dashboard");
|
||||||
$itens[] = $menu;
|
$itens[] = $menu;
|
||||||
/*
|
/*
|
||||||
$menu = new MenuAdmin(__("Premium Featrures"), "fas fa-star", "premium");
|
$menu = new MenuAdmin(__("Premium Featrures"), "fas fa-star", "premium");
|
||||||
$itens[] = $menu;
|
$itens[] = $menu;
|
||||||
*/
|
*/
|
||||||
$menu = new MenuAdmin(__("Settings"), "fa fa-wrench");
|
$menu = new MenuAdmin(__("Settings"), "fa fa-wrench");
|
||||||
$menu->addItem(new MenuAdmin(__("Remove Branding"), "far fa-edit", "customize_settings"));
|
$menu->addItem(new MenuAdmin(__("Remove Branding"), "far fa-edit", "customize_settings"));
|
||||||
$menu->addItem(new MenuAdmin(__("General Settings"), "fas fa-cog", "general_settings"));
|
$menu->addItem(new MenuAdmin(__("General Settings"), "fas fa-cog", "general_settings"));
|
||||||
$menu->addItem(new MenuAdmin(__("Site Settings"), "fas fa-sitemap", "site_settings"));
|
$menu->addItem(new MenuAdmin(__("Site Settings"), "fas fa-sitemap", "site_settings"));
|
||||||
$menu->addItem(new MenuAdmin(__("Social Login Settings"), "fas fa-sign-in-alt", "socialLogin_settings"));
|
$menu->addItem(new MenuAdmin(__("Social Login Settings"), "fas fa-sign-in-alt", "socialLogin_settings"));
|
||||||
$menu->addItem(new MenuAdmin(__("S3, B2, FTP settings"), "fas fa-hdd", "storage_settings"));
|
$menu->addItem(new MenuAdmin(__("S3, B2, FTP settings"), "fas fa-hdd", "storage_settings"));
|
||||||
$menu->addItem(new MenuAdmin(__("Payments Settings"), "far fa-money-bill-alt", "payments_settings"));
|
$menu->addItem(new MenuAdmin(__("Payments Settings"), "far fa-money-bill-alt", "payments_settings"));
|
||||||
$itens[] = $menu;
|
$itens[] = $menu;
|
||||||
|
|
||||||
|
|
||||||
$menu = new MenuAdmin(__("Contents"), "fas fa-list-ul");
|
$menu = new MenuAdmin(__("Contents"), "fas fa-list-ul");
|
||||||
$menu->addItem(new MenuAdmin(__("Videos"), "fas fa-play-circle", "videos"));
|
$menu->addItem(new MenuAdmin(__("Videos"), "fas fa-play-circle", "videos"));
|
||||||
$menu->addItem(new MenuAdmin(__("Live Stuff"), "fas fa-broadcast-tower", "live"));
|
$menu->addItem(new MenuAdmin(__("Live Stuff"), "fas fa-broadcast-tower", "live"));
|
||||||
$menu->addItem(new MenuAdmin(__("Users"), "glyphicon glyphicon-user", "users"));
|
$menu->addItem(new MenuAdmin(__("Users"), "glyphicon glyphicon-user", "users"));
|
||||||
$menu->addItem(new MenuAdmin(__("Users Groups"), "fa fa-users", "usersGroups"));
|
$menu->addItem(new MenuAdmin(__("Users Groups"), "fa fa-users", "usersGroups"));
|
||||||
$menu->addItem(new MenuAdmin(__("Categories"), "glyphicon glyphicon-list", "categories"));
|
$menu->addItem(new MenuAdmin(__("Categories"), "glyphicon glyphicon-list", "categories"));
|
||||||
$menu->addItem(new MenuAdmin(__("Backup"), "fas fa-undo-alt", "backup"));
|
$menu->addItem(new MenuAdmin(__("Backup"), "fas fa-undo-alt", "backup"));
|
||||||
$itens[] = $menu;
|
$itens[] = $menu;
|
||||||
|
|
||||||
$menu = new MenuAdmin(__("Design"), "fas fa-pen-fancy");
|
$menu = new MenuAdmin(__("Design"), "fas fa-pen-fancy");
|
||||||
$menu->addItem(new MenuAdmin(__("First Page Style"), "fas fa-columns", "design_first_page"));
|
$menu->addItem(new MenuAdmin(__("First Page Style"), "fas fa-columns", "design_first_page"));
|
||||||
$menu->addItem(new MenuAdmin(__("Player Skin"), "fas fa-play-circle", "design_player"));
|
$menu->addItem(new MenuAdmin(__("Player Skin"), "fas fa-play-circle", "design_player"));
|
||||||
$menu->addItem(new MenuAdmin(__("Themes"), "fas fa-palette", "design_themes"));
|
$menu->addItem(new MenuAdmin(__("Themes"), "fas fa-palette", "design_themes"));
|
||||||
$menu->addItem(new MenuAdmin(__("Colors"), "fas fa-palette", "design_colors"));
|
$menu->addItem(new MenuAdmin(__("Colors"), "fas fa-palette", "design_colors"));
|
||||||
//$menu->addItem(new MenuAdmin(__("Custom CSS"), "fab fa-css3-alt", "design_css"));
|
//$menu->addItem(new MenuAdmin(__("Custom CSS"), "fab fa-css3-alt", "design_css"));
|
||||||
$itens[] = $menu;
|
$itens[] = $menu;
|
||||||
|
|
||||||
$menu = new MenuAdmin(__("Monetize"), "fas fa-dollar-sign");
|
$menu = new MenuAdmin(__("Monetize"), "fas fa-dollar-sign");
|
||||||
$menu->addItem(new MenuAdmin(__("Site Advertisement with VAST Video ads"), "fas fa-money-check-alt", "monetize_vast"));
|
$menu->addItem(new MenuAdmin(__("Site Advertisement with VAST Video ads"), "fas fa-money-check-alt", "monetize_vast"));
|
||||||
$menu->addItem(new MenuAdmin(__("Pay User per Video View"), "far fa-money-bill-alt", "monetize_user"));
|
$menu->addItem(new MenuAdmin(__("Pay User per Video View"), "far fa-money-bill-alt", "monetize_user"));
|
||||||
$menu->addItem(new MenuAdmin(__("Create Subscription Plans"), "fas fa-money-bill-alt", "monetize_subscription"));
|
$menu->addItem(new MenuAdmin(__("Create Subscription Plans"), "fas fa-money-bill-alt", "monetize_subscription"));
|
||||||
//$menu->addItem(new MenuAdmin(__("Banner Script code"), "fas fa-money-check-alt", "advertisement_script"));
|
//$menu->addItem(new MenuAdmin(__("Banner Script code"), "fas fa-money-check-alt", "advertisement_script"));
|
||||||
$itens[] = $menu;
|
$itens[] = $menu;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
$menu = new MenuAdmin(__("Update Version"), "glyphicon glyphicon-refresh", "{$global['webSiteRootURL']}update/");
|
$menu = new MenuAdmin(__("Update Version"), "glyphicon glyphicon-refresh", "{$global['webSiteRootURL']}update/");
|
||||||
$itens[] = $menu;
|
$itens[] = $menu;
|
||||||
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
$menu = new MenuAdmin(__("Miscellaneous"), "fas fa-th");
|
$menu = new MenuAdmin(__("Miscellaneous"), "fas fa-th");
|
||||||
$menu->addItem(new MenuAdmin(__("Plugins"), "fas fa-puzzle-piece", "plugins"));
|
$menu->addItem(new MenuAdmin(__("Plugins"), "fas fa-puzzle-piece", "plugins"));
|
||||||
$menu->addItem(new MenuAdmin(__("Email All Users"), "fas fa-mail-bulk", "mail_all_users"));
|
$menu->addItem(new MenuAdmin(__("Email All Users"), "fas fa-mail-bulk", "mail_all_users"));
|
||||||
$itens[] = $menu;
|
$itens[] = $menu;
|
||||||
|
|
||||||
$menu = new MenuAdmin(__("Health Check"), "fas fa-notes-medical", "health_check");
|
$menu = new MenuAdmin(__("Health Check"), "fas fa-notes-medical", "health_check");
|
||||||
$itens[] = $menu;
|
$itens[] = $menu;
|
||||||
|
|
||||||
$_GET['page'] = xss_esc(@$_GET['page']);
|
$_GET['page'] = xss_esc(@$_GET['page']);
|
||||||
|
|
||||||
$includeHead = '';
|
$includeHead = '';
|
||||||
$includeBody = '';
|
$includeBody = '';
|
||||||
switch ($_GET['page']) {
|
switch ($_GET['page']) {
|
||||||
case "backup":
|
case "backup":
|
||||||
$includeBody = $global['systemRootPath'] . 'admin/backup.php';
|
$includeBody = $global['systemRootPath'] . 'admin/backup.php';
|
||||||
break;
|
break;
|
||||||
case "premium":
|
case "premium":
|
||||||
$includeBody = $global['systemRootPath'] . 'admin/premium.php';
|
$includeBody = $global['systemRootPath'] . 'admin/premium.php';
|
||||||
break;
|
break;
|
||||||
case "design_first_page":
|
case "design_first_page":
|
||||||
$includeBody = $global['systemRootPath'] . 'admin/design_first_page.php';
|
$includeBody = $global['systemRootPath'] . 'admin/design_first_page.php';
|
||||||
break;
|
break;
|
||||||
case "design_themes":
|
case "design_themes":
|
||||||
$includeBody = $global['systemRootPath'] . 'admin/design_themes.php';
|
$includeBody = $global['systemRootPath'] . 'admin/design_themes.php';
|
||||||
break;
|
break;
|
||||||
case "design_colors":
|
case "design_colors":
|
||||||
$includeBody = $global['systemRootPath'] . 'admin/design_colors.php';
|
$includeBody = $global['systemRootPath'] . 'admin/design_colors.php';
|
||||||
break;
|
break;
|
||||||
case "design_player":
|
case "design_player":
|
||||||
$includeBody = $global['systemRootPath'] . 'admin/design_player.php';
|
$includeBody = $global['systemRootPath'] . 'admin/design_player.php';
|
||||||
break;
|
break;
|
||||||
case "customize_settings":
|
case "customize_settings":
|
||||||
$includeBody = $global['systemRootPath'] . 'admin/customize_settings.php';
|
$includeBody = $global['systemRootPath'] . 'admin/customize_settings.php';
|
||||||
break;
|
break;
|
||||||
case "storage_settings":
|
case "storage_settings":
|
||||||
$includeBody = $global['systemRootPath'] . 'admin/storage_settings.php';
|
$includeBody = $global['systemRootPath'] . 'admin/storage_settings.php';
|
||||||
break;
|
break;
|
||||||
case "general_settings":
|
case "general_settings":
|
||||||
$includeBody = $global['systemRootPath'] . 'admin/general_settings.php';
|
$includeBody = $global['systemRootPath'] . 'admin/general_settings.php';
|
||||||
break;
|
break;
|
||||||
case "payments_settings":
|
case "payments_settings":
|
||||||
$includeBody = $global['systemRootPath'] . 'admin/payments_settings.php';
|
$includeBody = $global['systemRootPath'] . 'admin/payments_settings.php';
|
||||||
break;
|
break;
|
||||||
case "socialLogin_settings":
|
case "socialLogin_settings":
|
||||||
$includeBody = $global['systemRootPath'] . 'admin/socialLogin_settings.php';
|
$includeBody = $global['systemRootPath'] . 'admin/socialLogin_settings.php';
|
||||||
break;
|
break;
|
||||||
case "site_settings":
|
case "site_settings":
|
||||||
$includeHead = $global['systemRootPath'] . 'view/configurations_head.php';
|
$includeHead = $global['systemRootPath'] . 'view/configurations_head.php';
|
||||||
$includeBody = $global['systemRootPath'] . 'view/configurations_body.php';
|
$includeBody = $global['systemRootPath'] . 'view/configurations_body.php';
|
||||||
break;
|
break;
|
||||||
case "monetize_subscription":
|
case "monetize_subscription":
|
||||||
$includeHead = $global['systemRootPath'] . 'plugin/Subscription/page/editor_head.php';
|
$includeHead = $global['systemRootPath'] . 'plugin/Subscription/page/editor_head.php';
|
||||||
$includeBody = [];
|
$includeBody = [];
|
||||||
$includeBody[] = $global['systemRootPath'] . 'plugin/Subscription/page/editor_body.php';
|
$includeBody[] = $global['systemRootPath'] . 'plugin/Subscription/page/editor_body.php';
|
||||||
$includeBody[] = $global['systemRootPath'] . 'admin/monetize_subscription.php';
|
$includeBody[] = $global['systemRootPath'] . 'admin/monetize_subscription.php';
|
||||||
break;
|
break;
|
||||||
case "monetize_vast":
|
case "monetize_vast":
|
||||||
$includeHead = $global['systemRootPath'] . 'plugin/AD_Server/index_head.php';
|
$includeHead = $global['systemRootPath'] . 'plugin/AD_Server/index_head.php';
|
||||||
$includeBody = $global['systemRootPath'] . 'plugin/AD_Server/index_body.php';
|
$includeBody = $global['systemRootPath'] . 'plugin/AD_Server/index_body.php';
|
||||||
break;
|
break;
|
||||||
case "monetize_user":
|
case "monetize_user":
|
||||||
$includeBody = $global['systemRootPath'] . 'admin/monetize_user.php';
|
$includeBody = $global['systemRootPath'] . 'admin/monetize_user.php';
|
||||||
break;
|
break;
|
||||||
case "plugins":
|
case "plugins":
|
||||||
$includeHead = $global['systemRootPath'] . 'view/managerPlugins_head.php';
|
$includeHead = $global['systemRootPath'] . 'view/managerPlugins_head.php';
|
||||||
$includeBody = $global['systemRootPath'] . 'view/managerPlugins_body.php';
|
$includeBody = $global['systemRootPath'] . 'view/managerPlugins_body.php';
|
||||||
break;
|
break;
|
||||||
case "mail_all_users":
|
case "mail_all_users":
|
||||||
$includeBody = $global['systemRootPath'] . 'admin/mail_all_users.php';
|
$includeBody = $global['systemRootPath'] . 'admin/mail_all_users.php';
|
||||||
break;
|
break;
|
||||||
case "users":
|
case "users":
|
||||||
$includeHead = $global['systemRootPath'] . 'view/managerUsers_head.php';
|
$includeHead = $global['systemRootPath'] . 'view/managerUsers_head.php';
|
||||||
$includeBody = $global['systemRootPath'] . 'view/managerUsers_body.php';
|
$includeBody = $global['systemRootPath'] . 'view/managerUsers_body.php';
|
||||||
break;
|
break;
|
||||||
case "live":
|
case "live":
|
||||||
$includeBody = $global['systemRootPath'] . 'admin/live.php';
|
$includeBody = $global['systemRootPath'] . 'admin/live.php';
|
||||||
break;
|
break;
|
||||||
case "usersGroups":
|
case "usersGroups":
|
||||||
$includeHead = $global['systemRootPath'] . 'view/managerUsersGroups_head.php';
|
$includeHead = $global['systemRootPath'] . 'view/managerUsersGroups_head.php';
|
||||||
$includeBody = $global['systemRootPath'] . 'view/managerUsersGroups_body.php';
|
$includeBody = $global['systemRootPath'] . 'view/managerUsersGroups_body.php';
|
||||||
break;
|
break;
|
||||||
case "categories":
|
case "categories":
|
||||||
$includeHead = $global['systemRootPath'] . 'view/managerCategories_head.php';
|
$includeHead = $global['systemRootPath'] . 'view/managerCategories_head.php';
|
||||||
$includeBody = $global['systemRootPath'] . 'view/managerCategories_body.php';
|
$includeBody = $global['systemRootPath'] . 'view/managerCategories_body.php';
|
||||||
break;
|
break;
|
||||||
case "videos":
|
case "videos":
|
||||||
$includeHead = $global['systemRootPath'] . 'view/managerVideos_head.php';
|
$includeHead = $global['systemRootPath'] . 'view/managerVideos_head.php';
|
||||||
$includeBody = $global['systemRootPath'] . 'view/managerVideos_body.php';
|
$includeBody = $global['systemRootPath'] . 'view/managerVideos_body.php';
|
||||||
break;
|
break;
|
||||||
case "health_check":
|
case "health_check":
|
||||||
$includeBody = $global['systemRootPath'] . 'admin/health_check.php';
|
$includeBody = $global['systemRootPath'] . 'admin/health_check.php';
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
$includeHead = $global['systemRootPath'] . 'view/charts_head.php';
|
$includeHead = $global['systemRootPath'] . 'view/charts_head.php';
|
||||||
$includeBody = $global['systemRootPath'] . 'view/charts_body.php';
|
$includeBody = $global['systemRootPath'] . 'view/charts_body.php';
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html lang="<?php echo $config->getLanguage(); ?>">
|
<html lang="<?php echo $config->getLanguage(); ?>">
|
||||||
<head>
|
<head>
|
||||||
<?php
|
<?php
|
||||||
echo getHTMLTitle(__("Administration"));
|
echo getHTMLTitle(__("Administration"));
|
||||||
?>
|
?>
|
||||||
<?php
|
<?php
|
||||||
include $global['systemRootPath'] . 'view/include/head.php';
|
include $global['systemRootPath'] . 'view/include/head.php';
|
||||||
if (!empty($includeHead) && file_exists($includeHead)) {
|
if (!empty($includeHead) && file_exists($includeHead)) {
|
||||||
echo "<!-- Include $includeHead -->";
|
echo "<!-- Include $includeHead -->";
|
||||||
include $includeHead;
|
include $includeHead;
|
||||||
echo "<!-- END Include $includeHead -->";
|
echo "<!-- END Include $includeHead -->";
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
<style>
|
<style>
|
||||||
@media (max-width: 767px) {
|
@media (max-width: 767px) {
|
||||||
.affix {
|
.affix {
|
||||||
position: static;
|
position: static;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.leftMenu .panel-body {
|
.leftMenu .panel-body {
|
||||||
padding: 0px;
|
padding: 0px;
|
||||||
}
|
}
|
||||||
.adminLeftMenu.panel-default i, .adminLeftMenu.panel-default{
|
.adminLeftMenu.panel-default i, .adminLeftMenu.panel-default{
|
||||||
-webkit-transition: opacity 0.5s ease-in-out;
|
-webkit-transition: opacity 0.5s ease-in-out;
|
||||||
-moz-transition: opacity 0.5s ease-in-out;
|
-moz-transition: opacity 0.5s ease-in-out;
|
||||||
transition: opacity 0.5s ease-in-out;
|
transition: opacity 0.5s ease-in-out;
|
||||||
}
|
}
|
||||||
.adminLeftMenu.panel-default i{
|
.adminLeftMenu.panel-default i{
|
||||||
opacity: 0.2;
|
opacity: 0.2;
|
||||||
}
|
}
|
||||||
.adminLeftMenu:hover.panel-default i{
|
.adminLeftMenu:hover.panel-default i{
|
||||||
opacity: 1;
|
opacity: 1;
|
||||||
}
|
}
|
||||||
.adminLeftMenu.panel-default{
|
.adminLeftMenu.panel-default{
|
||||||
opacity: 0.6;
|
opacity: 0.6;
|
||||||
}
|
}
|
||||||
.adminLeftMenu:hover.panel-default{
|
.adminLeftMenu:hover.panel-default{
|
||||||
opacity: 1;
|
opacity: 1;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
</head>
|
</head>
|
||||||
<body class="<?php echo $global['bodyClass']; ?>">
|
<body class="<?php echo $global['bodyClass']; ?>">
|
||||||
<?php
|
<?php
|
||||||
include $global['systemRootPath'] . 'view/include/navbar.php';
|
include $global['systemRootPath'] . 'view/include/navbar.php';
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<div class="container-fluid">
|
<div class="container-fluid">
|
||||||
<br>
|
<br>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class=" col-lg-2 col-md-3 col-sm-3 fixed affix leftMenu">
|
<div class=" col-lg-2 col-md-3 col-sm-3 fixed affix leftMenu">
|
||||||
<div class="panel-group" id="accordion">
|
<div class="panel-group" id="accordion">
|
||||||
<?php
|
<?php
|
||||||
$panel = 'panel-default';
|
$panel = 'panel-default';
|
||||||
if (empty($_REQUEST['page'])) {
|
if (empty($_REQUEST['page'])) {
|
||||||
$panel = 'panel-primary';
|
$panel = 'panel-primary';
|
||||||
}
|
}
|
||||||
foreach ($itens as $key => $value) {
|
foreach ($itens as $key => $value) {
|
||||||
$uid = uniqid();
|
$uid = uniqid();
|
||||||
$href = 'data-toggle="collapse" data-parent="#accordion" href="#collapse' . $uid . '"';
|
$href = 'data-toggle="collapse" data-parent="#accordion" href="#collapse' . $uid . '"';
|
||||||
if (!empty($value->href)) {
|
if (!empty($value->href)) {
|
||||||
$href = 'href="' . $global['webSiteRootURL'] . 'admin/?page=' . $value->href . '"';
|
$href = 'href="' . $global['webSiteRootURL'] . 'admin/?page=' . $value->href . '"';
|
||||||
}
|
}
|
||||||
if (!empty($_REQUEST['page']) && $_REQUEST['page'] == $value->href) {
|
if (!empty($_REQUEST['page']) && $_REQUEST['page'] == $value->href) {
|
||||||
$panel = 'panel-primary';
|
$panel = 'panel-primary';
|
||||||
} else {
|
} else {
|
||||||
foreach ($value->itens as $key2 => $value2) {
|
foreach ($value->itens as $key2 => $value2) {
|
||||||
if (!empty($_REQUEST['page']) && $_REQUEST['page'] === $value2->href) {
|
if (!empty($_REQUEST['page']) && $_REQUEST['page'] === $value2->href) {
|
||||||
$panel = 'panel-primary';
|
$panel = 'panel-primary';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} ?>
|
} ?>
|
||||||
<div class="panel <?php echo $panel; ?> adminLeftMenu <?php echo getCSSAnimationClassAndStyle('animate__bounceInLeft', 'menu'); ?>">
|
<div class="panel <?php echo $panel; ?> adminLeftMenu <?php echo getCSSAnimationClassAndStyle('animate__bounceInLeft', 'menu'); ?>">
|
||||||
<div class="panel-heading">
|
<div class="panel-heading">
|
||||||
<h4 class="panel-title">
|
<h4 class="panel-title">
|
||||||
<a <?php echo $href; ?> >
|
<a <?php echo $href; ?> >
|
||||||
<i class="<?php echo $value->icon; ?> "></i> <?php echo $value->title; ?>
|
<i class="<?php echo $value->icon; ?> "></i> <?php echo $value->title; ?>
|
||||||
</a>
|
</a>
|
||||||
</h4>
|
</h4>
|
||||||
</div>
|
</div>
|
||||||
<?php
|
<?php
|
||||||
if (!empty($value->itens)) {
|
if (!empty($value->itens)) {
|
||||||
$in = '';
|
$in = '';
|
||||||
if (!empty($_GET['page'])) {
|
if (!empty($_GET['page'])) {
|
||||||
foreach ($value->itens as $search) {
|
foreach ($value->itens as $search) {
|
||||||
if ($_GET['page'] === $search->href) {
|
if ($_GET['page'] === $search->href) {
|
||||||
$in = "in";
|
$in = "in";
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} ?>
|
} ?>
|
||||||
<div id="collapse<?php echo $uid; ?>" class="panel-collapse collapse <?php echo $in; ?>">
|
<div id="collapse<?php echo $uid; ?>" class="panel-collapse collapse <?php echo $in; ?>">
|
||||||
<div class="panel-body">
|
<div class="panel-body">
|
||||||
<table class="table">
|
<table class="table">
|
||||||
<?php
|
<?php
|
||||||
$active = '';
|
$active = '';
|
||||||
if (empty($_GET['page'])) {
|
if (empty($_GET['page'])) {
|
||||||
$active = "active";
|
$active = "active";
|
||||||
}
|
}
|
||||||
foreach ($value->itens as $key2 => $value2) {
|
foreach ($value->itens as $key2 => $value2) {
|
||||||
if (!empty($_GET['page']) && $_GET['page'] === $value2->href) {
|
if (!empty($_GET['page']) && $_GET['page'] === $value2->href) {
|
||||||
$active = "active";
|
$active = "active";
|
||||||
} ?>
|
} ?>
|
||||||
<tr>
|
<tr>
|
||||||
<td class="<?php echo $active; ?>">
|
<td class="<?php echo $active; ?>">
|
||||||
<a href="<?php echo "{$global['webSiteRootURL']}admin/?page=" . $value2->href; ?>"><i class="<?php echo $value2->icon; ?>"></i> <?php echo $value2->title; ?></a>
|
<a href="<?php echo "{$global['webSiteRootURL']}admin/?page=" . $value2->href; ?>"><i class="<?php echo $value2->icon; ?>"></i> <?php echo $value2->title; ?></a>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<?php
|
<?php
|
||||||
$active = '';
|
$active = '';
|
||||||
} ?>
|
} ?>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<?php
|
<?php
|
||||||
} ?>
|
} ?>
|
||||||
</div>
|
</div>
|
||||||
<?php
|
<?php
|
||||||
$panel = 'panel-default';
|
$panel = 'panel-default';
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class=" col-lg-10 col-md-9 col-sm-9 col-sm-offset-3 col-md-offset-3 col-lg-offset-2 ">
|
<div class=" col-lg-10 col-md-9 col-sm-9 col-sm-offset-3 col-md-offset-3 col-lg-offset-2 ">
|
||||||
<?php
|
<?php
|
||||||
if (!empty($includeBody)) {
|
if (!empty($includeBody)) {
|
||||||
if (is_array($includeBody)) {
|
if (is_array($includeBody)) {
|
||||||
foreach ($includeBody as $value) {
|
foreach ($includeBody as $value) {
|
||||||
if (file_exists($value)) {
|
if (file_exists($value)) {
|
||||||
include $value;
|
include $value;
|
||||||
} else {
|
} else {
|
||||||
?>
|
?>
|
||||||
<div class="alert alert-danger">
|
<div class="alert alert-danger">
|
||||||
<?php echo __('Please forgive us for bothering you, but unfortunately you do not have this plugin yet. But do not hesitate to purchase it in our online store'); ?>
|
<?php echo __('Please forgive us for bothering you, but unfortunately you do not have this plugin yet. But do not hesitate to purchase it in our online store'); ?>
|
||||||
<a class="btn btn-danger" href="https://youphp.tube/marketplace/"><?php echo __('Plugin Store'); ?></a>
|
<a class="btn btn-danger" href="https://youphp.tube/marketplace/"><?php echo __('Plugin Store'); ?></a>
|
||||||
</div>
|
</div>
|
||||||
<?php
|
<?php
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (file_exists($includeBody)) {
|
if (file_exists($includeBody)) {
|
||||||
include $includeBody;
|
include $includeBody;
|
||||||
} else {
|
} else {
|
||||||
?>
|
?>
|
||||||
<div class="alert alert-danger">
|
<div class="alert alert-danger">
|
||||||
<?php echo __('Please forgive us for bothering you, but unfortunately you do not have this plugin yet. But do not hesitate to purchase it in our online store'); ?>
|
<?php echo __('Please forgive us for bothering you, but unfortunately you do not have this plugin yet. But do not hesitate to purchase it in our online store'); ?>
|
||||||
<a class="btn btn-danger" href="https://youphp.tube/marketplace/"><?php echo __('Plugin Store'); ?></a>
|
<a class="btn btn-danger" href="https://youphp.tube/marketplace/"><?php echo __('Plugin Store'); ?></a>
|
||||||
</div>
|
</div>
|
||||||
<?php
|
<?php
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
include_once $global['systemRootPath'] . 'view/include/footer.php';
|
include_once $global['systemRootPath'] . 'view/include/footer.php';
|
||||||
?>
|
?>
|
||||||
<script>
|
<script>
|
||||||
|
|
||||||
$(document).ready(function () {
|
$(document).ready(function () {
|
||||||
$('.adminOptionsForm').submit(function (e) {
|
$('.adminOptionsForm').submit(function (e) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
modal.showPleaseWait();
|
modal.showPleaseWait();
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: '<?php echo $global['webSiteRootURL']; ?>admin/save.json.php',
|
url: '<?php echo $global['webSiteRootURL']; ?>admin/save.json.php',
|
||||||
data: $(this).serialize(),
|
data: $(this).serialize(),
|
||||||
type: 'post',
|
type: 'post',
|
||||||
success: function (response) {
|
success: function (response) {
|
||||||
modal.hidePleaseWait();
|
modal.hidePleaseWait();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
$('.pluginSwitch').change(function (e) {
|
$('.pluginSwitch').change(function (e) {
|
||||||
modal.showPleaseWait();
|
modal.showPleaseWait();
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: '<?php echo $global['webSiteRootURL']; ?>objects/pluginSwitch.json.php',
|
url: '<?php echo $global['webSiteRootURL']; ?>objects/pluginSwitch.json.php',
|
||||||
data: {"uuid": $(this).attr('uuid'), "name": $(this).attr('name'), "dir": $(this).attr('name'), "enable": $(this).is(":checked")},
|
data: {"uuid": $(this).attr('uuid'), "name": $(this).attr('name'), "dir": $(this).attr('name'), "enable": $(this).is(":checked")},
|
||||||
type: 'post',
|
type: 'post',
|
||||||
success: function (response) {
|
success: function (response) {
|
||||||
modal.hidePleaseWait();
|
modal.hidePleaseWait();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
395
view/update.php
395
view/update.php
|
@ -1,197 +1,198 @@
|
||||||
<?php
|
<?php
|
||||||
global $global, $config;
|
global $global, $config;
|
||||||
if (!isset($global['systemRootPath'])) {
|
if (!isset($global['systemRootPath'])) {
|
||||||
require_once '../videos/configuration.php';
|
require_once '../videos/configuration.php';
|
||||||
}
|
}
|
||||||
_session_start();
|
_session_start();
|
||||||
unset($_SESSION['sessionCache']['thereIsAnyRemoteUpdate']);
|
unset($_SESSION['sessionCache']['thereIsAnyRemoteUpdate']);
|
||||||
unset($_SESSION['sessionCache']['thereIsAnyUpdate']);
|
unset($_SESSION['sessionCache']['thereIsAnyUpdate']);
|
||||||
session_write_close();
|
session_write_close();
|
||||||
require_once $global['systemRootPath'] . 'objects/user.php';
|
require_once $global['systemRootPath'] . 'objects/user.php';
|
||||||
//check if there is a update
|
//check if there is a update
|
||||||
if (!User::isAdmin()) {
|
if (!User::isAdmin()) {
|
||||||
forbiddenPage("");
|
forbiddenPage("");
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
// remove cache dir before the script starts to let the script recreate the javascript and css files
|
adminSecurityCheck(true);
|
||||||
if (!empty($_POST['updateFile'])) {
|
// remove cache dir before the script starts to let the script recreate the javascript and css files
|
||||||
$dir = Video::getStoragePath()."cache";
|
if (!empty($_POST['updateFile'])) {
|
||||||
rrmdir($dir);
|
$dir = Video::getStoragePath()."cache";
|
||||||
}
|
rrmdir($dir);
|
||||||
?>
|
}
|
||||||
<!DOCTYPE html>
|
?>
|
||||||
<html lang="<?php echo $config->getLanguage(); ?>">
|
<!DOCTYPE html>
|
||||||
<head>
|
<html lang="<?php echo $config->getLanguage(); ?>">
|
||||||
<title><?php echo __("Update AVideo System") . $config->getPageTitleSeparator() . $config->getWebSiteTitle(); ?></title>
|
<head>
|
||||||
<?php
|
<title><?php echo __("Update AVideo System") . $config->getPageTitleSeparator() . $config->getWebSiteTitle(); ?></title>
|
||||||
include $global['systemRootPath'] . 'view/include/head.php';
|
<?php
|
||||||
?>
|
include $global['systemRootPath'] . 'view/include/head.php';
|
||||||
<style>
|
?>
|
||||||
html{
|
<style>
|
||||||
height: unset;
|
html{
|
||||||
}
|
height: unset;
|
||||||
body {
|
}
|
||||||
background-color: #193c6d;
|
body {
|
||||||
filter: progid: DXImageTransform.Microsoft.gradient(gradientType=1, startColorstr='#003073', endColorstr='#029797');
|
background-color: #193c6d;
|
||||||
background-image: url(//img.alicdn.com/tps/TB1d.u8MXXXXXXuXFXXXXXXXXXX-1900-790.jpg);
|
filter: progid: DXImageTransform.Microsoft.gradient(gradientType=1, startColorstr='#003073', endColorstr='#029797');
|
||||||
background-size: 100%;
|
background-image: url(//img.alicdn.com/tps/TB1d.u8MXXXXXXuXFXXXXXXXXXX-1900-790.jpg);
|
||||||
background-image: -webkit-gradient(linear, 0 0, 100% 100%, color-stop(0, #003073), color-stop(100%, #029797));
|
background-size: 100%;
|
||||||
background-image: -webkit-linear-gradient(135deg, #003073, #029797);
|
background-image: -webkit-gradient(linear, 0 0, 100% 100%, color-stop(0, #003073), color-stop(100%, #029797));
|
||||||
background-image: -moz-linear-gradient(45deg, #003073, #029797);
|
background-image: -webkit-linear-gradient(135deg, #003073, #029797);
|
||||||
background-image: -ms-linear-gradient(45deg, #003073 0, #029797 100%);
|
background-image: -moz-linear-gradient(45deg, #003073, #029797);
|
||||||
background-image: -o-linear-gradient(45deg, #003073, #029797);
|
background-image: -ms-linear-gradient(45deg, #003073 0, #029797 100%);
|
||||||
background-image: linear-gradient(135deg, #003073, #029797);
|
background-image: -o-linear-gradient(45deg, #003073, #029797);
|
||||||
margin: 0px;
|
background-image: linear-gradient(135deg, #003073, #029797);
|
||||||
overflow: hidden;
|
margin: 0px;
|
||||||
height: 100%;
|
overflow: hidden;
|
||||||
}
|
height: 100%;
|
||||||
.alert{
|
}
|
||||||
text-align: center;
|
.alert{
|
||||||
}
|
text-align: center;
|
||||||
#updateInfo{
|
}
|
||||||
position: absolute;
|
#updateInfo{
|
||||||
top: 60px;
|
position: absolute;
|
||||||
z-index: 1;
|
top: 60px;
|
||||||
width: 500px;
|
z-index: 1;
|
||||||
left: 50%;
|
width: 500px;
|
||||||
margin-left: -250px;
|
left: 50%;
|
||||||
}
|
margin-left: -250px;
|
||||||
</style>
|
}
|
||||||
</head>
|
</style>
|
||||||
<body class="<?php echo $global['bodyClass']; ?>">
|
</head>
|
||||||
<?php
|
<body class="<?php echo $global['bodyClass']; ?>">
|
||||||
include $global['systemRootPath'] . 'view/include/navbar.php';
|
<?php
|
||||||
?>
|
include $global['systemRootPath'] . 'view/include/navbar.php';
|
||||||
<div class="container-fluid">
|
?>
|
||||||
<div id="updateInfo">
|
<div class="container-fluid">
|
||||||
<div style="">
|
<div id="updateInfo">
|
||||||
<img style="max-height: 20vh;
|
<div style="">
|
||||||
display: block;
|
<img style="max-height: 20vh;
|
||||||
margin-left: auto;
|
display: block;
|
||||||
margin-right: auto;" src="https://youphp.tube/marketplace/img/avideo_logo.png" class="img img-responsive"/>
|
margin-left: auto;
|
||||||
</div>
|
margin-right: auto;" src="https://youphp.tube/marketplace/img/avideo_logo.png" class="img img-responsive"/>
|
||||||
<div class="alert alert-success">
|
</div>
|
||||||
<i class="fas fa-cog fa-spin"></i> <?php printf(__("You are running AVideo version %s!"), $config->getVersion()); ?>
|
<div class="alert alert-success">
|
||||||
</div>
|
<i class="fas fa-cog fa-spin"></i> <?php printf(__("You are running AVideo version %s!"), $config->getVersion()); ?>
|
||||||
<?php
|
</div>
|
||||||
if (empty($_POST['updateFile'])) {
|
<?php
|
||||||
$updateFiles = getUpdatesFilesArray();
|
if (empty($_POST['updateFile'])) {
|
||||||
if (!empty($updateFiles)) {
|
$updateFiles = getUpdatesFilesArray();
|
||||||
?>
|
if (!empty($updateFiles)) {
|
||||||
<div class="alert alert-warning">
|
?>
|
||||||
<form method="post" class="form-compact well form-horizontal" >
|
<div class="alert alert-warning">
|
||||||
<fieldset>
|
<form method="post" class="form-compact well form-horizontal" >
|
||||||
<legend><?php echo __("Update AVideo System"); ?></legend>
|
<fieldset>
|
||||||
<label for="updateFile" class="sr-only"><?php echo __("Select the update"); ?></label>
|
<legend><?php echo __("Update AVideo System"); ?></legend>
|
||||||
<select class="selectpicker" data-width="fit" name="updateFile" id="updateFile" required autofocus>
|
<label for="updateFile" class="sr-only"><?php echo __("Select the update"); ?></label>
|
||||||
<?php
|
<select class="selectpicker" data-width="fit" name="updateFile" id="updateFile" required autofocus>
|
||||||
$disabled = '';
|
<?php
|
||||||
foreach ($updateFiles as $value) {
|
$disabled = '';
|
||||||
echo "<option value=\"{$value['filename']}\" {$disabled}>Version {$value['version']}</option>";
|
foreach ($updateFiles as $value) {
|
||||||
$disabled = "disabled";
|
echo "<option value=\"{$value['filename']}\" {$disabled}>Version {$value['version']}</option>";
|
||||||
} ?>
|
$disabled = "disabled";
|
||||||
</select>
|
} ?>
|
||||||
<?php printf(__("We detected a total of %s pending updates, if you want to do it now click (Update Now) button"), "<strong class='badge'>" . count($updateFiles) . "</strong>"); ?>
|
</select>
|
||||||
<hr>
|
<?php printf(__("We detected a total of %s pending updates, if you want to do it now click (Update Now) button"), "<strong class='badge'>" . count($updateFiles) . "</strong>"); ?>
|
||||||
<button type="submit" class="btn btn-warning btn-lg center-block " href="?update=1" > <span class="glyphicon glyphicon-refresh"></span> <?php echo __("Update Now"); ?> </button>
|
<hr>
|
||||||
</fieldset>
|
<button type="submit" class="btn btn-warning btn-lg center-block " href="?update=1" > <span class="glyphicon glyphicon-refresh"></span> <?php echo __("Update Now"); ?> </button>
|
||||||
</form>
|
</fieldset>
|
||||||
</div>
|
</form>
|
||||||
|
</div>
|
||||||
<script>
|
|
||||||
$(document).ready(function () {
|
<script>
|
||||||
$('#updateFile').selectpicker();
|
$(document).ready(function () {
|
||||||
});
|
$('#updateFile').selectpicker();
|
||||||
</script>
|
});
|
||||||
<?php
|
</script>
|
||||||
} elseif ($version = thereIsAnyRemoteUpdate()) {
|
<?php
|
||||||
?>
|
} elseif ($version = thereIsAnyRemoteUpdate()) {
|
||||||
<div class="alert alert-warning">
|
?>
|
||||||
Our repository is now running at version <?php echo $version->version; ?>.
|
<div class="alert alert-warning">
|
||||||
You can follow this <a target="_blank" href="https://github.com/WWBN/AVideo/wiki/How-to-Update-your-AVideo-Platform" class="btn btn-warning btn-xs" rel="noopener noreferrer">Update Tutorial</a>
|
Our repository is now running at version <?php echo $version->version; ?>.
|
||||||
to update your files and get the latest version.
|
You can follow this <a target="_blank" href="https://github.com/WWBN/AVideo/wiki/How-to-Update-your-AVideo-Platform" class="btn btn-warning btn-xs" rel="noopener noreferrer">Update Tutorial</a>
|
||||||
</div>
|
to update your files and get the latest version.
|
||||||
<?php
|
</div>
|
||||||
} else {
|
<?php
|
||||||
?>
|
} else {
|
||||||
<div class="alert alert-success">
|
?>
|
||||||
<h2><i class="fas fa-check"></i> <?php echo __("Your system is up to date"); ?></h2>
|
<div class="alert alert-success">
|
||||||
</div>
|
<h2><i class="fas fa-check"></i> <?php echo __("Your system is up to date"); ?></h2>
|
||||||
<?php
|
</div>
|
||||||
}
|
<?php
|
||||||
} else {
|
}
|
||||||
$obj = new stdClass();
|
} else {
|
||||||
$templine = '';
|
$obj = new stdClass();
|
||||||
$logfile = Video::getStoragePath()."avideo.";
|
$templine = '';
|
||||||
if (file_exists($logfile . "log")) {
|
$logfile = Video::getStoragePath()."avideo.";
|
||||||
unlink($logfile . "log");
|
if (file_exists($logfile . "log")) {
|
||||||
_error_log("avideo.log deleted by update");
|
unlink($logfile . "log");
|
||||||
}
|
_error_log("avideo.log deleted by update");
|
||||||
if (file_exists($logfile . "js.log")) {
|
}
|
||||||
unlink($logfile . "js.log");
|
if (file_exists($logfile . "js.log")) {
|
||||||
_error_log("avideo.js.log deleted by update");
|
unlink($logfile . "js.log");
|
||||||
}
|
_error_log("avideo.js.log deleted by update");
|
||||||
$lines = file("{$global['systemRootPath']}updatedb/{$_POST['updateFile']}");
|
}
|
||||||
$obj->error = '';
|
$lines = file("{$global['systemRootPath']}updatedb/{$_POST['updateFile']}");
|
||||||
foreach ($lines as $line) {
|
$obj->error = '';
|
||||||
if (substr($line, 0, 2) == '--' || $line == '') {
|
foreach ($lines as $line) {
|
||||||
continue;
|
if (substr($line, 0, 2) == '--' || $line == '') {
|
||||||
}
|
continue;
|
||||||
$templine .= $line;
|
}
|
||||||
if (substr(trim($line), -1, 1) == ';') {
|
$templine .= $line;
|
||||||
if (!$global['mysqli']->query($templine)) {
|
if (substr(trim($line), -1, 1) == ';') {
|
||||||
$obj->error = ('Error performing query \'<strong>' . $templine . '\': ' . $global['mysqli']->error . '<br /><br />');
|
if (!$global['mysqli']->query($templine)) {
|
||||||
echo json_encode($obj);
|
$obj->error = ('Error performing query \'<strong>' . $templine . '\': ' . $global['mysqli']->error . '<br /><br />');
|
||||||
//exit;
|
echo json_encode($obj);
|
||||||
}
|
//exit;
|
||||||
$templine = '';
|
}
|
||||||
}
|
$templine = '';
|
||||||
}
|
}
|
||||||
|
}
|
||||||
// insert configuration if is version 1.0
|
|
||||||
if ($config->currentVersionLowerThen('1.0')) {
|
// insert configuration if is version 1.0
|
||||||
$sql = "DELETE FROM configurations WHERE id = 1 ";
|
if ($config->currentVersionLowerThen('1.0')) {
|
||||||
if ($global['mysqli']->query($sql) !== true) {
|
$sql = "DELETE FROM configurations WHERE id = 1 ";
|
||||||
$obj->error = "Error deleting configuration: " . $global['mysqli']->error;
|
if ($global['mysqli']->query($sql) !== true) {
|
||||||
echo json_encode($obj);
|
$obj->error = "Error deleting configuration: " . $global['mysqli']->error;
|
||||||
exit;
|
echo json_encode($obj);
|
||||||
}
|
exit;
|
||||||
|
}
|
||||||
$sql = "INSERT INTO configurations (id, video_resolution, users_id, version, created, modified) VALUES (1, '426:240', " . User::getId() . ",'1.0', now(), now())";
|
|
||||||
if ($global['mysqli']->query($sql) !== true) {
|
$sql = "INSERT INTO configurations (id, video_resolution, users_id, version, created, modified) VALUES (1, '426:240', " . User::getId() . ",'1.0', now(), now())";
|
||||||
$obj->error = "Error creating configuration: " . $global['mysqli']->error;
|
if ($global['mysqli']->query($sql) !== true) {
|
||||||
echo json_encode($obj);
|
$obj->error = "Error creating configuration: " . $global['mysqli']->error;
|
||||||
exit;
|
echo json_encode($obj);
|
||||||
}
|
exit;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
if ($config->currentVersionEqual('1.0')) {
|
|
||||||
$sql = "UPDATE configurations SET users_id = " . User::getId() . ", version = '1.1', webSiteTitle = '{$global['webSiteTitle']}', language = '{$global['language']}', contactEmail = '{$global['contactEmail']}', modified = now() WHERE id = 1";
|
if ($config->currentVersionEqual('1.0')) {
|
||||||
if ($global['mysqli']->query($sql) !== true) {
|
$sql = "UPDATE configurations SET users_id = " . User::getId() . ", version = '1.1', webSiteTitle = '{$global['webSiteTitle']}', language = '{$global['language']}', contactEmail = '{$global['contactEmail']}', modified = now() WHERE id = 1";
|
||||||
$obj->error = "Error creating configuration: " . $global['mysqli']->error;
|
if ($global['mysqli']->query($sql) !== true) {
|
||||||
echo json_encode($obj);
|
$obj->error = "Error creating configuration: " . $global['mysqli']->error;
|
||||||
exit;
|
echo json_encode($obj);
|
||||||
}
|
exit;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
//$renamed = rename("{$global['systemRootPath']}updateDb.sql", "{$global['systemRootPath']}updateDb.sql.old");?>
|
|
||||||
<div class="alert alert-success">
|
//$renamed = rename("{$global['systemRootPath']}updateDb.sql", "{$global['systemRootPath']}updateDb.sql.old");?>
|
||||||
<?php
|
<div class="alert alert-success">
|
||||||
printf(__("Your update from file %s is done, click continue"), $_POST['updateFile']); ?><hr>
|
<?php
|
||||||
<a class="btn btn-success" href="?done=1" > <span class="glyphicon glyphicon-ok"></span> <?php echo __("Continue"); ?> </a>
|
printf(__("Your update from file %s is done, click continue"), $_POST['updateFile']); ?><hr>
|
||||||
</div>
|
<a class="btn btn-success" href="?done=1" > <span class="glyphicon glyphicon-ok"></span> <?php echo __("Continue"); ?> </a>
|
||||||
<?php
|
</div>
|
||||||
}
|
<?php
|
||||||
?>
|
}
|
||||||
</div>
|
?>
|
||||||
|
</div>
|
||||||
</div>
|
|
||||||
<?php
|
</div>
|
||||||
include $global['systemRootPath'] . 'view/include/footer.php';
|
<?php
|
||||||
?>
|
include $global['systemRootPath'] . 'view/include/footer.php';
|
||||||
<script src="<?php echo getCDN(); ?>js/three.js" type="text/javascript"></script>
|
?>
|
||||||
</body>
|
<script src="<?php echo getCDN(); ?>js/three.js" type="text/javascript"></script>
|
||||||
</html>
|
</body>
|
||||||
<?php
|
</html>
|
||||||
exit;
|
<?php
|
||||||
?>
|
exit;
|
||||||
|
?>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue