KyleMassacre

Untitled

Dec 2nd, 2013
47
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 2.09 KB | None | 0 0
  1. <?php
  2. include "../../libs/common.php";
  3. include "../../libs/db.php";
  4. include "../../libs/items.php";
  5. include "../../libs/stats.php";
  6. include "../../libs/roles.php";
  7. include "$baseDir/config/config.php";
  8. InitModules();
  9. $db = new Database($dbhost, $dbuser, $dbpass, $dbname);
  10. header ("content-type: text/xml; charset=UTF-8");
  11. ?>
  12. <rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" version="2.0">
  13.     <atom:link href="http://<?php echo $_SERVER["HTTP_HOST"].$_SERVER["PHP_SELF"]; ?>" rel="self" type="application/rss+xml"/>
  14.     <language>en-us</language>
  15.     <channel>
  16.         <title><?php echo $gameName; ?> Rss Feed</title>
  17.         <description>Latest and greatest news from <?php echo $gameName; ?></description>
  18.         <sy:updatePeriod>hourly</sy:updatePeriod>
  19.         <sy:updateFrequency>1</sy:updateFrequency>
  20.  
  21.         <?php
  22.  
  23.         $result = $db->Execute("select id, time, title, text, creator from gameupdates order by id desc");
  24.         foreach ($result as $row) :
  25.         $n = $db->LoadData("select username from users where id = ?", $row["creator"]);
  26.         //$text = str_replace(
  27.        // array("[b]","[/b]","[i]","[/i]","[u]","[/u]","[ul]","[/ul]","[li]","[/li]","[ol]","[/ol]","[/li]\n"),
  28.        // array("<b>","</b>","<em>","</em>","<span style=\"text-decoration: underline;\">","</span>","<ul>","</ul>","<li>","</li>","<ol>","</ol>","</li>"),
  29.        // $row["text"]);
  30.  
  31.         ?>
  32.             <item>
  33.             <guid isPermaLink="false"> <?php echo $row["id"]; ?></guid>
  34.             <pubDate><?php echo FormatShortDate($row["time"]); ?></pubDate>
  35.             <dc:creator><![CDATA[ <?php echo $n["username"]; ?> ]]></dc:creator>
  36.             <subject><![CDATA[ <?php echo $row["title"]; ?> ]]></subject>
  37.             <description>
  38.                 <![CDATA[ <?php echo PrettyMessage ($row["text"]); ?> ]]>
  39.             </description>
  40.         </item>
  41.         <?php endforeach; ?>
  42.         <copyright><![CDATA[ &copy; of <?php echo $gameName. date(" Y"); ?> ]]></copyright>
  43.     </channel>
  44. </rss>
Advertisement
Add Comment
Please, Sign In to add comment