mirror of
https://github.com/DanielnetoDotCom/YouPHPTube
synced 2025-10-04 18:29:39 +02:00
30 lines
727 B
PHP
30 lines
727 B
PHP
<?php
|
|
|
|
header('Content-Type: application/json');
|
|
require_once '../../../videos/configuration.php';
|
|
require_once $global['systemRootPath'] . 'plugin/AD_Server/Objects/VastCampaignsVideos.php';
|
|
|
|
$obj = new stdClass();
|
|
$obj->error = true;
|
|
$obj->msg = "";
|
|
|
|
$plugin = AVideoPlugin::loadPluginIfEnabled('AD_Server');
|
|
|
|
if (!User::isAdmin()) {
|
|
$obj->msg = "You can't do this";
|
|
die(json_encode($obj));
|
|
}
|
|
|
|
$id = intval($_POST['inputVideoAd_id']);
|
|
|
|
$o = new VastCampaignsVideos($id);
|
|
$o->setVast_campaigns_id($_POST['vast_campaigns_id']);
|
|
$o->setVideos_id($_POST['videos_id']);
|
|
$o->setLink($_POST['uri']);
|
|
$o->setAd_title($_POST['title']);
|
|
$o->setStatus('a');
|
|
|
|
if ($o->save()) {
|
|
$obj->error = false;
|
|
}
|
|
echo json_encode($obj);
|