All articles * news * review * preview * feature * game => All articles about 1 game * user => All articles about all games a user is tracking * format => All articles about games on a particular format */ if (!in_array($type, array("", "news", "review", "preview", "feature", "game", "user", "format"))) { //Make sure people can't inject anything die(); } } else { $type = null; } if (isset($_GET['id'])) { $id = $_GET['id']; } else { $id = null; } $title = "TotalVideoGames.com"; $copy = "Copyleft"; $description = "Description"; $date = date("D, d M Y H:i:s O"); $url = "http://www.totalvideogames.com/"; $imgUrl = "http://www.totalvideogames.com/app/tvg/templates/default/images/logo-rss.gif"; $numberOfItems = 100; switch($type) { case null: $items = tvg_article::getLatest(null, $numberOfItems, 0); break; case "news":case "review":case "preview":case "feature": $items = tvg_article::getLatest($type, $numberOfItems, 0); $title .= " ".ucfirst($type)." RSS Feed"; break; case "game": $id+=0; $items = tvg_article::getRelated($id, $numberOfItems, null, 0); $title .= " ".tvg_games::gI($id)->name." RSS Feed"; break; case "format": $fid = tvg_formats::lookupId($id); $items = tvg_article::getLatest(null, $numberOfItems, 0, $fid); if ($id!="Handhelds") { $title .= " ".tvg_formats::gI($fid)->name." RSS Feed"; } else { $title .= " Handhelds RSS Feed"; } break; case "user": $id+=0; $items = tvg_article::getUserLatest($id, $numberOfItems, 0); $title .= " - ".tvg_userDetails::gI($id)->title."'s Personalised RSS Feed"; break; } $rss =<< {$title}{$url}{$description}en-gb{$date}{$copy}15{$title}$imgUrl$url EOL; foreach ($items as $article) { $shortDescription = misc::htmlNumericEntities(html_entity_decode($article->summary, null, "UTF-8")); $title = misc::htmlNumericEntities(html_entity_decode($article->title, null, "UTF-8")); $u = $article->getUrl(); $r = array("title"=>$title." ".ucfirst($article->type), "date"=>date("D, d M Y H:i:s O", strtotime($article->date)), "shortDescription"=>$shortDescription, "url"=>$u); $rss .= << {$r['title']} {$r['shortDescription']} {$r['url']} {$r['url']} {$r['date']} EOL; } $rss .= ""; header("Content-Type: application/rss+xml"); echo $rss; ?>