private function addPageToDB($eid, $slug, $title) { $link = "podcast/" . $slug . "/" . $eid; $queryPodcast = new queryPodcast(); $description = json_decode($queryPodcast->getPodcastData($slug), true); $description = $description["description"]; $page = new page(); $page->addPage($link, $title, $description, "Podcast", "Podcast"); }
<?php if (!isset($_GET)) { exit; } require_once dirname(__FILE__) . '/../inc/class.queryPodcast.php'; $query = new queryPodcast(); function autolink($text) { $reg_exUrl = "/((http|https|ftp|ftps)\\:\\/\\/[a-zA-Z0-9\\-\\.]+\\.[a-zA-Z]{2,3}(\\/\\S*)?)/"; if (preg_match($reg_exUrl, $text)) { return preg_replace($reg_exUrl, '<a href="${1}">${1}</a> ', $text); } else { return $text; } } $ROOT_URL = "https://www.rolandoislas.com/podcast/" . $_GET["podcast"] . "/"; $slug = $_GET['podcast']; $episodeData = json_decode($query->query($slug), true); $podcastData = json_decode($query->getPodcastData($slug), true); header('Content-Type: application/xml; charset=utf-8'); $xml = '<?xml version="1.0" encoding="utf-8"?> <rss version="2.0">'; $title = $podcastData["title"]; $description = $podcastData["description"]; $xml .= "\n<channel>\n<title>{$title}</title>\n<link>https://www.rolandoislas.com/podcast/{$slug}/</link>\n<description>{$description}</description>"; foreach ($episodeData as $episode) { $title = $episode["title"]; $link = $ROOT_URL . $episode["id"]; $guid = $episode["url"]; $description = "<![CDATA[" . stripslashes(nl2br(autolink($episode["description"]))) . "]]>";
<?php if (!isset($_GET)) { exit; } require_once dirname(__FILE__) . '/../inc/class.queryPodcast.php'; $query = new queryPodcast(); if (isset($_GET["redirect"])) { // Handle podcast redirects $data = $query->getRedirect($_GET["podcast"], $_GET["redirect"]); if ($_GET["redirect"] == "all") { echo json_encode($data); } else { header('Location: ' . $data); } exit; } $JSONArray = $query->query($_GET['podcast']); echo $JSONArray;