I have a RSS feeds that store the RSS data into the database. There are multiple feeds that are all identified by a feed id. (so cnn.com would be feed 1, tmz.com would be feed 2, etc...)
I want to select the and display the RSS feed on my forums based on the forum ID and have a default for areas that don't have a forum ID specified (ie...forumhome). I am hoping to display 5 results at a time
I am pecking around VB.org and found the
$result= $vbulletin->db->query_read("SELECT `feedID` , `ItemTitle` , `ItemLink`
FROM `feedItems`
WHERE feedID =1
LIMIT 5");
but I am unsure how to go about putting the results from $results into a variable and running a while loop. I also see that $results is a common variable to use, can I use another variable or is $results the best to use for vbulletin apps?
Also - would the code for this be better in a plugin, or called from an external file via plugin?
Thanks!
-------------------------------------------------------------------
OK - I'm trying this but it's not working ...can someone help please?
Code:
$query2 = $vbulletin->db->query_read(
"SELECT feedID , ItemTitle , ItemLink
FROM feedItems
WHERE feedID =1
LIMIT 5");
while ($rssres = $db->fetch_array($query2))
{
$latestrss = $rssres['ItemTitle'] <br />;
}
Nothing show up. The hook location is global start. The tables don't have the vb table prefix attached.
-----------------------------------------------------------------
Code:
$rss_get = $db->query_read("SELECT * FROM feedItems");
while ($subcat = $db->fetch_array($rss_get)) {
$rss_feed = $subcat["ItemTitle"];
}
when I put $rss_feed on the navbar template I only get the last record in the feedItems table. How would I go about displaying all the records?
----
ughh......this thing keeps merging my posts....