mirror of
https://github.com/DanielnetoDotCom/YouPHPTube
synced 2025-10-03 01:39:24 +02:00

I will let the admin select what channels he wants to put on the first page. then I it will show the channels videos sorted by date DESC
32 lines
685 B
PHP
32 lines
685 B
PHP
<?php
|
|
|
|
require_once '../../videos/configuration.php';
|
|
|
|
header('Content-Type: application/json');
|
|
|
|
$resp = new stdClass();
|
|
$resp->error = true;
|
|
$resp->msg = "";
|
|
$resp->users_id = intval($_REQUEST['users_id']);
|
|
$resp->add = intval($_REQUEST['add']);
|
|
|
|
if (empty($resp->users_id)) {
|
|
forbiddenPage('User is empty');
|
|
}
|
|
|
|
if (!User::isAdmin()) {
|
|
forbiddenPage('Admin only');
|
|
}
|
|
|
|
$plugin = AVideoPlugin::loadPluginIfEnabled('Gallery');
|
|
|
|
if (empty($plugin)) {
|
|
forbiddenPage('Gallery not enabled');
|
|
}
|
|
|
|
|
|
$resp->response = Gallery::setAddChannelToGallery($resp->users_id, $resp->add);
|
|
|
|
$resp->error = empty($resp->response);
|
|
|
|
die(json_encode($resp));
|