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

Reply
 
Thread Tools
Details »»

Version: , by (Guest)
Developer Last Online: Jan 1970 Show Printable Version Email this Page

Version: Unknown Rating:
Released: 01-06-2001 Last Update: Never Installs: 0
 
No support by the author.

Hello everyone,

I built a PHP RSS library to include headlines from popular website into my homepage, it worked great and I used it to include my favourite sites slashdot, linuxtoday, and freshmeat of course

but I needed to add my favourite bulletin board site that uses VB, and I searched for RSS support in VB, but I didn't find any, so I downloaded the lite version of VB and installed it, and after 3 hours I have my RSS hack for VB, and it works great, I tested it for the full version and it works fine there

I thought someone might be intersted on it, here is the code, it is a stripped down "forumdisplay.php" file with little changes to make it produce RSS file.
Put it in the same directory with "forumdisplay.php", and you call it in the same way "rss.php?forumid=1"

Hope you like it and use it

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>

Show Your Support

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

Comments
  #2  
Old 01-07-2001, 12:06 PM
Guest
 
Posts: n/a
Default

do you have a sample of your site ?
Reply With Quote
  #3  
Old 01-07-2001, 05:27 PM
Guest
 
Posts: n/a
Default

<a href="http://www.rayed.f2s.com/vb/rss.php?forumid=1" target="_blank">http://www.rayed.f2s.com/vb/rss.php?forumid=1</a>

of course it won't show anything, you have to save it and view it with normal editor.
the server is free server that a use for testing, sometimes it get very very slow.
Reply With Quote
  #4  
Old 01-07-2001, 05:49 PM
Guest
 
Posts: n/a
Default

yeah freedom2surf really do my head in with the slowness.
Reply With Quote
  #5  
Old 04-01-2003, 01:34 PM
X-Fan's Avatar
X-Fan X-Fan is offline
 
Join Date: Jan 2002
Location: Adelaide, Australia
Posts: 496
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Is there any way to have this hack auto-generate a new RSS file for specified forums at the end of each day?

And how can someone display these news feeds on their Web sites, or via a ticker? I'd like to offer an "easy set-up" mehod for people to syndicate my site's news.
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 08:26 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04037 seconds
  • Memory Usage 2,233KB
  • 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
  • (5)post_thanks_box
  • (5)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (5)post_thanks_postbit_info
  • (4)postbit
  • (1)postbit_onlinestatus
  • (5)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
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • postbit_imicons
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete