Interlopers Resent post

Comments & Suggestions about Interlopers.net

Postby Fearian on Wed Jun 13, 2007 9:04 am

rember kids, this question could have been answered in a single post, with the wonders of SPELLING!

*recent*, like cent, no s.
User avatar
Fearian
May Contain Skills
May Contain Skills
 
Joined: Wed Nov 30, 2005 10:33 pm

Postby zombie@computer on Wed Jun 13, 2007 7:05 pm

Code: Select all
<?php
echo '<?xml version="1.0" encoding="iso-8859-1" ?>
<?xml-stylesheet type="text/xsl" href="templates/rss.xsl"?>';
?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:annotate="http://purl.org/rss/1.0/modules/annotate/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">

<channel>
<title>Forum latest</title>
<link>http://interlopers.net/forum/</link>
<description>All the latest forum messages</description>
<managingEditor>webmaster@interlopers.net</managingEditor>
<docs>http://blogs.law.harvard.edu/tech/rss</docs>
<generator>RSS Feed 2.2.3</generator>
<language>en</language>
<lastBuildDate><?=dated(strtotime ("now"));?></lastBuildDate>
<image>
   <url>http://interlopers.net/forum/templates/subSilver/images/logo_phpBB_med.gif</url>
   <title>Forum latest</title>
   <link>http://interlopers.net/forum/</link>
   <width>122</width>
   <height>56</height>
</image>
<?php
include("config.php");

mysql_connect($dbhost, $dbuser, $dbpasswd) or die("ERROR: can't connect to database");
mysql_select_db($dbname) or die("ERROR: Can't switch database");

$l= isset($_GET['p'])? intval($_GET['p']) : 10;
if ($l<0 || $l>50) $l=10;

$sql="SELECT
   p.topic_id,
   p.post_id,
   t.topic_title,
   u.user_id,
   u.username,
   p.post_time   
FROM
   phpbb_posts p,
   phpbb_users u,
   phpbb_topics t
WHERE
   t.topic_id = p.topic_id AND
   u.user_id = t.topic_poster
GROUP BY
   p.topic_id
ORDER BY
   p.post_time
LIMIT 0, $l";

$r= mysql_query($sql);

if (!$r) die("ERROR: Can't query database".mysql_error());
while ($res = mysql_fetch_assoc($r)) {
$res['username']=htmlentities($res['username']);
$res['topic_title']=htmlentities($res['topic_title']);
?>
<item>
<title><?=$res['topic_title'];?></title>
<link>http://www.interlopers.net/forum/viewtopic.php?t=<?=$res['topic_id'];?></link>
<pubDate><?=dated($res['post_time']);?></pubDate>
<guid isPermaLink="true">http://www.interlopers.net/forum/viewtopic.php?t=<?=$res['topic_id'];?></guid>
<description>
By &lt;a href=&quot;http://interlopers.net/forum/profile.php?mode=viewprofile&amp;u=<?=$res['user_id'];?>&quot;&gt;<?=$res['username'];?>&lt;/a&gt;
</description>
<dc:creator><?=$res['username'];?></dc:creator>
<dc:subject>Forum latest</dc:subject>
<annotate:reference rdf:resource="http://www.interlopers.net/forum/viewtopic.php?t=<?=$res['topic_id'];?>" />
<comments>http://www.interlopers.net/forum/posting.php?mode=quote&amp;p=<?=$res['post_id'];?></comments>
</item>
<?php
}
?>
</channel>
</rss>
<?php

function dated($date) {
   echo date('Y-m-d\Th:i:s',$date). substr_replace(date('O',$date),':',3,0);
}
save as "rss.php" (or whatever) in the phpbb forum directory and you are ready to go (i hope). :D

use rss.php?p=THIS to control the amount of posts, eg 1-50 to list that amount of messages at once
When you are up to your neck in shit, keep your head up high
zombie@computer
Forum Goer Elite™
Forum Goer Elite™
 
Joined: Fri Dec 31, 2004 5:58 pm
Location: Lent, Netherlands

Postby Blink on Wed Jun 13, 2007 7:18 pm

Already using that for the main RSS on the news.
User avatar
Blink
Cool 'n that
Cool 'n that
 
Joined: Fri Oct 08, 2004 4:16 pm
Location: UK

Postby zombie@computer on Wed Jun 13, 2007 8:02 pm

Blink wrote:Already using that for the main RSS on the news.
yea, but this is for the entire forum. Offcourse if you dont want it... :P
When you are up to your neck in shit, keep your head up high
zombie@computer
Forum Goer Elite™
Forum Goer Elite™
 
Joined: Fri Dec 31, 2004 5:58 pm
Location: Lent, Netherlands
Previous

Return to Feedback Corner

Who is online

Users browsing this forum: No registered users