Rss feed help needed - Help oh mighty Telli :)

  Post new topicReply to topicPrintable Version
<< View previous topic View next topic >>
Share: Del.icio.us  Digg  Google  Spurl  Blink  Furl  Y! MyWeb  
#1   Rss feed help needed - Help oh mighty Telli :)
ispgeek
CZ Newbie
 Codezwiz Site Donator
ispgeek has been a member for over 18 year's 18 Year Member
Gender: Male
Status: Offline
Joined: Nov 12, 2006
0.00 posts per day
Posts: 15
Points: 350
   
Hope all is well. I've got myself into a pickle and not quite sure what to do about it. It may be simple enough...I'm just not getting it.

I'm using the following code to generate my forums rss feed which works fine btw for twitter using twitterfeed. The problem I'm having is with Facebook RSS Graffiti not finding a pub date in each of my feeds. I need to add this but I will admit...I'm clueless how to add the "pubdate" element to this code.

<?php

include("mainfile.php");
global $prefix, $dbi, $sitename, $user, $cookie, $group_id;
    header("Content-Type: text/xml");
    echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>";
    echo "<rss version=\"0.91\">";
    echo "<channel>";
    echo "<title>".htmlspecialchars($sitename)."</title>\n";
    echo "<link>$nukeurl</link>\n";
    echo "<description>".htmlspecialchars($backend_title)."</description>\n";
    echo "<language>$backend_language</language>\n\n";
    $count = 1;
    $result1 = sql_query("SELECT topic_id, topic_last_post_id, topic_title FROM ".$prefix."_bbtopics ORDER BY topic_last_post_id DESC LIMIT 15", $dbi);
    while(list($topic_id, $topic_last_post_id, $topic_title) = sql_fetch_row($result1, $dbi)) {
   $result2 = sql_query("SELECT topic_id, poster_id, FROM_UNIXTIME(post_time,'%b %d, %Y at %T') as post_time FROM ".$prefix."_bbposts where post_id='$topic_last_post_id'", $dbi);
   list($topic_id, $poster_id, $post_time)=sql_fetch_row($result2, $dbi);

        echo "<item>\n";
        echo "<title>".htmlspecialchars($topic_title)."</title>\n";
        echo "<link>$nukeurl/modules.php?name=Forums&amp;file=viewtopic&amp;p=$topic_last_post_id#$topic_last_post_id</link>\n";
        echo "<guid>$nukeurl/modules.php?name=Forums&amp;file=viewtopic&amp;p=$topic_last_post_id#$topic_last_post_id</guid>\n";
        echo "</item>\n\n";


   }
    echo "</channel>\n";
    echo "</rss>";
?>


Any help you can offer would be appreciated.


Back to top Reply with quote
#2   
Telli
Site Admin
Occupation: Self Employed
Age: 46
Gender: Male
Fav. Sports Team: Detroit Red Wings
Website:
Status: Offline
Joined: May 26, 2003
1.03 posts per day
Posts: 8089
Points: 494,440
   

    echo "<description>".htmlspecialchars($backend_title)."</description>\n";
    echo "<language>$backend_language</language>\n";
    echo "<pubDate>".date('D, j M Y', time())."</pubDate>\n\n";


Change the time() for your timestamp.



_________________
The path of the righteous man is beset on all sides by the inequities of the selfish and the tyranny of evil men. Blessed is he, who in the name of charity and good will, shepherds the weak through the valley of darkness, for he is truly his brother's keeper and the finder of lost children. And I will strike down upon thee with great vengeance and furious anger those who would attempt to poison and destroy my brothers. And you will know my name is the Lord when I lay my vengeance upon thee. Ezekiel 25:17
Back to top Reply with quote
Display posts from previous:      
Add To: Del.icio.us  Digg  Google  Spurl  Blink  Furl  Y! MyWeb  
<< View previous topic View next topic >>
Post new topicReply to topic

Jump to 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum