Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> Seeking applications ...
Author Message
blarneystone
Client


Joined: Sep 18, 2004
Posts: 62

PostPosted: Sat Nov 13, 2004 10:32 am Reply with quote

Hi,

I use Forumnews advanced from portedmods.com to publish my front page stories. It does a standard RSS feed that shows the title and link only. I'd like to be able to pull the first paragraph of the story too and add it to the <description></description> elements of the feed.

Below is the backend.php for forumnews....

Code:
{ // Begin Forum News Advance


if ($cat != "") {
   
   $sql = "SELECT news_id FROM ".$prefix."_bbnews WHERE news_category LIKE '%$cat%' LIMIT 1";
   $result = $db->sql_query($sql);
   $cat_id = $db->sql_fetchrow($result);
   if ($cat_id == "") {
      $sql = "SELECT topic_id, topic_title, news_id FROM ".$prefix."_bbtopics WHERE news_id NOT LIKE 0 ORDER BY topic_id DESC LIMIT 10";
      $result = $db->sql_query($sql);
      } else {
      $sql = "SELECT topic_id, topic_title, news_id FROM ".$prefix."_bbtopics WHERE $cat_id='$news_id' ORDER BY topic_id DESC LIMIT 10";
      $result = $db->sql_query($sql);
   }
} else {
      $sql = "SELECT topic_id, topic_title, news_id FROM ".$prefix."_bbtopics WHERE news_id NOT LIKE 0 ORDER BY topic_id DESC LIMIT 10";
      $result = $db->sql_query($sql);
}
echo "<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?>\n\n";
echo "<!DOCTYPE rss PUBLIC \"-//Netscape Communications//DTD RSS 0.91//EN\"\n";
echo " \"http://my.netscape.com/publish/formats/rss-0.91.dtd\">\n\n";
echo "<rss version=\"0.91\">\n\n";
echo "<channel>\n";
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";

while ($row = $db->sql_fetchrow($result)) {
    echo "<item>\n";
    echo "<title>".htmlspecialchars($row[topic_title])."</title>\n";
    echo "<link>$nukeurl/modules.php?name=ForumNews&amp;id=$row[topic_id]</link>\n";
    echo "</item>\n\n";
}
echo "</channel>\n";
echo "</rss>";
} // End Forum News Advance


can anyone help me with a solution to this?

(P.S. is every forum post formatted to center?)
 
View user's profile Send private message Visit poster's website
hitwalker
Sells PC To Pay For Divorce


Joined:
Posts: 5661

PostPosted: Sat Nov 13, 2004 4:57 pm Reply with quote

well that would be some re-writing for someone who knows what he's doing....
maybe im completely wrong but showing the story should be stripped somehow...
the below code is from my center block that uses the same and perhaps you can mess around with it.
but if its excepted in rss im not sure...

Code:


global $prefix, $dbi, $sitename;
$strip = "15";

$result = sql_query("select lid, title from $prefix"._nsngd_downloads." order by hits DESC limit 0,10", $dbi);
$result = sql_query("select cid, lid, title from $prefix"._nsngd_downloads ." order by lid DESC limit 0,10", $dbi);
$content .= "<td valign=\"top\"><b>$textdowns</b><br>";
while(list($cid, $lid, $title) = sql_fetch_row($result, $dbi)) {
$linkstrip5 = stripslashes($title);
$linkstrip6 = substr($linkstrip5, 0, $strip) . "..";
$content .= "<img src=\"images/down1.gif\">&nbsp;$a <a href=\"modules.php?name=Downloads&amp;op=getit&amp;lid=$lid\">$linkstrip6</a><br>";
    $a++;
 
View user's profile Send private message
Display posts from previous:       
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> Seeking applications ...

View next topic
View previous topic
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 can attach files in this forum
You can download files in this forum


Powered by phpBB © 2001-2007 phpBB Group
All times are GMT - 6 Hours
 
Forums ©