1
0
Fork 0
mirror of https://github.com/DanielnetoDotCom/YouPHPTube synced 2025-10-03 01:39:24 +02:00
Oinktube/plugin/Gallery/channelToGallery.json.php
Daniel fa6be4f09e https://github.com/WWBN/AVideo/issues/6372
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
2022-03-10 19:45:50 -03:00

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));