Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > General > Member Archives
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Latest Threads in RSS Feed (need help) Details »»
Latest Threads in RSS Feed (need help)
Version: , by Marshalus Marshalus is offline
Developer Last Online: Jul 2020 Show Printable Version Email this Page

Version: Unknown Rating:
Released: 10-29-2002 Last Update: Never Installs: 0
 
No support by the author.

OK, I digging though the bowels of the site, and stumbled apon a RSS feed hack that will pull the most recent threads from a forum you specify, and deliver them up in RSS format.

What I want to do, instead of having to specify the forum, is just have it dish out the latest threads from all forums.

Here is what I have to work with:
Code:
<?php echo '<?xml version="1.0"?>'; ?>

<!DOCTYPE rss PUBLIC "-//Netscape Communications//DTD RSS 0.91//EN"
             "http://my.netscape.com/publish/formats/rss-0.91.dtd">

<rss version="0.91">

  <channel>

<?php

echo "<!--\n";
require("global.php");
echo "-->\n";

	echo "<title>$bbtitle</title>\n";
	echo "<link>$bburl</link>\n";

// set defaults
if (isset($perpage)==0 or $perpage==0) {
  $perpage=$maxthreads;
}

$forumid = verifyid("forum",$forumid);


$foruminfo=$DB_site->query_first("SELECT title,description,active FROM forum WHERE forumid=$forumid");
$forumtitle=htmlspecialchars($foruminfo[title]);
if ($foruminfo[active]==0) {
  echo "<item><title>Forum Not Active</title></item></channel></rss>";
  exit;
}

$description=htmlspecialchars($foruminfo[description]);
$forumtitle=htmlspecialchars($foruminfo[title]);

$threads=$DB_site->query("SELECT threadid,title,lastpost,replycount,postusername FROM thread WHERE forumid=$forumid ORDER BY lastpost DESC LIMIT 0,$perpage");
while ($thread=$DB_site->fetch_array($threads)) {

  $threadtitle=htmlspecialchars($thread[title]);
  $threadid=$thread[threadid];

  $notes=htmlspecialchars($thread[notes]);
  $replies=$thread[replycount];
  $firstposter=htmlspecialchars($thread[postusername]);
  $lastreplydate=date($dateformat,$thread[lastpost]+($timeoffset*3600));
  $lastreplytime=date($timeformat,$thread[lastpost]+($timeoffset*3600));

 echo "<item>\n";
 echo "<title>$threadtitle</title>\n";
 echo "<link>". $bburl ."/showthread.php?threadid=$threadid</link>\n";
 echo "<description> $firstposter - $replies - $lastreplytime </description>\n";
 echo "</item>\n";

}

?>

  </channel>

</rss>
This would be very useful for programs like Trillian that can pull RSS news feeds, or for syndicating your latest threads on other websites.

Any help would be appreciated.

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #22  
Old 07-31-2003, 09:48 AM
iJason iJason is offline
 
Join Date: Feb 2002
Posts: 34
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I found that I have to change my computers time to an hour later each time I wanted to update.. That's so lame
Reply With Quote
  #23  
Old 12-18-2003, 02:12 PM
mashby's Avatar
mashby mashby is offline
 
Join Date: Jan 2002
Location: Nashville, TN - USA
Posts: 736
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Has this become an official hack? I'm very interested in installing this on my board, but it's a little unclear how to install this puppy.

Any feedback would be appreciated.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 04:03 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.03656 seconds
  • Memory Usage 2,234KB
  • Queries Executed 20 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)bbcode_code
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (3)post_thanks_box
  • (3)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (3)post_thanks_postbit_info
  • (2)postbit
  • (3)postbit_onlinestatus
  • (3)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete