1
0
Fork 0
mirror of https://github.com/DanielnetoDotCom/YouPHPTube synced 2025-10-03 01:39:24 +02:00
Oinktube/feed/index.php
DanielnetoDotCom 30f2e2cad9 Caching query
2021-01-19 15:28:19 -03:00

56 lines
No EOL
1.9 KiB
PHP

<?php
//header("Content-Type: application/rss+xml; charset=UTF8");
require_once '../videos/configuration.php';
require_once '../objects/video.php';
$_POST['sort']["created"] = "DESC";
$_POST['current'] = 1;
$_REQUEST['rowCount'] = getRowCount();
$showOnlyLoggedUserVideos = false;
$title = $config->getWebSiteTitle();
$link = $global['webSiteRootURL'];
$logo = "{$global['webSiteRootURL']}videos/userPhoto/logo.png";
$description = "";
$extraPluginFile = $global['systemRootPath'] . 'plugin/Customize/Objects/ExtraConfig.php';
if (file_exists($extraPluginFile) && AVideoPlugin::isEnabledByName("Customize")) {
require_once $extraPluginFile;
$ec = new ExtraConfig();
$description = $ec->getDescription();
}
if(!empty($_GET['channelName'])){
$user = User::getChannelOwner($_GET['channelName']);
$showOnlyLoggedUserVideos = $user['id'];
$title = User::getNameIdentificationById($user['id']);
$link = User::getChannelLink($user['id']);
$logo = User::getPhoto($user['id']);
}
$cacheName = "feedCache".json_encode($_GET);
$rows = ObjectYPT::getCache($cacheName, 0);
if(empty($rows)){
// send $_GET['catName'] to be able to filter by category
$rows = Video::getAllVideos("viewable", $showOnlyLoggedUserVideos);
}else{
$rows = object_to_array($rows);
}
if(!empty($_REQUEST['roku'])){
header('Content-Type: application/json');
include $global['systemRootPath'] . 'feed/roku.json.php';
}else if(empty($_REQUEST['mrss'])){
header('Content-Type: text/xml; charset=UTF8');
include $global['systemRootPath'] . 'feed/rss.php';
}else{
header('Content-Type: text/xml; charset=UTF8');
include $global['systemRootPath'] . 'feed/mrss.php';
}
function feedText($text){
return str_replace(array('&&'), array('&'), str_replace(array('&','<','>'), array('&amp;','&lt;','&gt;'), (strip_tags(br2nl($text)))));
}
?>