Previous Thread
Next Thread
Print Thread
Rate Thread
Page 1 of 2 1 2
Joined: Mar 2001
Posts: 644
Member
Member
Offline
Joined: Mar 2001
Posts: 644
Mod Name / Version: RSS Feed For Threads

Description: This addon will allow you and your members to set up an RSS feed for your site.

This current version supports 3 feeds:

1. New posts for today

2. New posts yesterday

3. News posts from a news forum specified

Working Under: UBB.Threads 6.3

Mod Status: Beta

Any pre-requisites: None

Author(s): Conaz (Documented and modified slightly for Threadsdev users by Zackary)

Date: 11/26/03

Credits: Conaz for the original idea for my site and those members of Threadsdev who expressed interest in this feature

Files Altered: None

New Files: rss.php

Database Altered: No

Info/Instructions: Edit the config options at the beginning of the file as specified for your threads install.

Rename from rss.txt to rss.php

Upload this where you feel appropriate.

I chose /threads/addons/rss for mine.

To use this in your favorite RSS program, simply format your URL as follows:

Code
 <br />http://www.mysite.com/path_to_rss_file/rss.php?username=YOUR_THREADS_USERNAME&password=YOUR_THREADS_PASSWORD&option=-t <br />


If your username has a space, remember to replace the space with %20.

The two feeds currently available are:

-t = New posts today

-y = New posts yesterday

Remember this is in BETA and future revisions will come soon to add support for new replies.

If you are looking for a free RSS program, give Feedreader a try. http://www.feedreader.com

Disclaimer: Please backup every file that you intend to modify.
If the modification modifies the database, it's a good idea to backup your database before doing so.

Note: If you modify your UBB.Threads code, you may be giving up your right for "official" support from Infopop.If you need official support, you'll need to restore unmodified files.


[Updated to version 1.1b to fix a mistake with table prefix options.]

[Updated to version 1.2b to add a new option to show new posts only from a specific forum, i.e. a news forum]

[Updated to version 1.3b, to (hopefully) fix 2 digit group number permissions issue.]

[Fixed typo's. ]
Attachments
100614-rss.txt (0 Bytes, 131 downloads)

Last edited by Zackary; 12/12/2003 12:53 PM.
Sponsored Links
Joined: Nov 2001
Posts: 10,369
I type Like navaho
I type Like navaho
Joined: Nov 2001
Posts: 10,369
Very cool!

Thanks.

Joined: Apr 2001
Posts: 3,266
Member
Member
Offline
Joined: Apr 2001
Posts: 3,266
I need to brush up on where to submit RSS feeds as it has been a while since I read up on it.

Great Work. Nice and Simply and a few query changes and one can change it to suit their needs

Joined: Mar 2001
Posts: 644
Member
Member
Offline
Joined: Mar 2001
Posts: 644
Thanks guys. I'll pass on the nice words to my friend.

I did forget to mention one thing... if your username has a space in it, change the space to a %20 in the URL and it will work.

I'm sure many knew that, but just wanted to cover all bases.

Joined: Apr 2001
Posts: 3,266
Member
Member
Offline
Joined: Apr 2001
Posts: 3,266
Zackary also note the following

I was going to code up one that allowed anonymous viewers without the authentication however this works as well.

http://www.mysite.com/path_to_rss_file/rss.php?option=-t


So the good thing here is users who wish to submit their info to RSS SUBMISSION engines so users can look them up simply put the above links for people searching for feeds

Sponsored Links
Joined: Mar 2001
Posts: 644
Member
Member
Offline
Joined: Mar 2001
Posts: 644
Yes sorry, forgot to mention that you didn't have to specify username. If you don't, you'll see the same as a guest user.

If you DO specify username and password, you'll see all forums you have access to.

Joined: May 2003
Posts: 1,068
Junior Member
Junior Member
Offline
Joined: May 2003
Posts: 1,068
Neat mod there Zackary, I am trying to incorporate a link to a page on this in my ubbt_registerednav. I would like to hve it come up in a popup window but I can't seem to get it to read the code right, can you guys tell me how to make this work? TIA

Code
 <a href="#" onClick="MM_openBrWindow('http://www.vhfans.com/rss.htm','','scrollbars=yes,width=640,height=350')">RSS</a> 

Joined: Sep 2003
Posts: 488
Code Monkey
Code Monkey
Joined: Sep 2003
Posts: 488
Hi,

You'll want to do it like this...

Code
<html> <br /><head> <br /><script language="JavaScript"> <br /><!-- <br />function MM_openBrWindow(theURL,winName,features) { <br />  window.open(theURL,winName,features); <br />} <br />//--> <br /></script> <br /></head> <br /><? //UBBTREMARK <br />echo <<<UBBTPRINT <br />$tbopen <br /><tr> <br /><td align="center" class="menubar"> <br />$privateslink <br />$adminlink <br /><a href="#" onClick="MM_openBrWindow('http://www.vhfans.com/rss.htm','','scrollbars=yes,width=640,height=350')">RSS</a> <br /> | <br /><a href = "{$config['homeurl']}/index.php?Cat=$Cat" $target>Entrance</a> <br /> | <br /><a href = "$phpurl/$FrontPage.php?Cat=$Cat" $target>{$ubbt_lang['FORUM_IND']}</a> <br /> | <br /><a href = "$phpurl/search.php?Cat=$Cat" $target>{$ubbt_lang['TEXT_SEARCH']}</a> <br /> | <br /><a href = "$phpurl/login.php?Cat=$Cat" $target>{$ubbt_lang['CONTROL_PANEL']}</a> <br /> | <br /><a href = "$phpurl/online.php?Cat=$Cat" $target>{$ubbt_lang['WHO_ON']}</a> <br /> | <br /><a href = "$phpurl/faq.php?Cat=$Cat" $target>{$ubbt_lang['FAQ_TEXT']}</a> <br /> | <br /><a href = "$phpurl/logout.php?Cat=$Cat" $target>{$ubbt_lang['LOGOUT_TEXT']}</a> <br />$members_link <br /></td> <br /></tr> <br />$tbclose <br /><br /> <br />UBBTPRINT; <br />/* UBBTREMARK */ ?>


Notice the new section I added on top. Without that it won't work :-)

Joined: May 2003
Posts: 1,068
Junior Member
Junior Member
Offline
Joined: May 2003
Posts: 1,068
Excellent! Works great, thanks.

Joined: Jul 2001
Posts: 1,157
Likes: 82
coffee and code
coffee and code
Joined: Jul 2001
Posts: 1,157
Likes: 82
what exactly is this for? I did some reading up on RSS and im still at a loss


Current developer of UBB.threads PHP Forum Software
Current Release: UBBT 7.7.5 // Preview: UBBT 8.0.0
isaac @ id242.com // my forum @ CelicaHobby.com
Sponsored Links
Joined: May 2003
Posts: 1,068
Junior Member
Junior Member
Offline
Joined: May 2003
Posts: 1,068
I am just learning about it myslef, best I can tell is that it's some sort of mached up news reader that uses RSS in place of NNTP (am I close?). I downloaded the free reader linked above, dropped the script in and it appears to work great. I guess if others want to pick up a news feed from your site this would be the way to give it to them.

Joined: Sep 2003
Posts: 488
Code Monkey
Code Monkey
Joined: Sep 2003
Posts: 488
Any thoughts on how a specific board can be used instead of 'em all?

For example, say I only wanted it to list new posts for the board found at the following URL...

http://www.mysite.com/ubbthreads/postlist.php?Cat=&Board=news

Is that easy to do?

Joined: Mar 2001
Posts: 644
Member
Member
Offline
Joined: Mar 2001
Posts: 644
Surey Twisty, that should be fairly easy...

But because of my being overstuffed with Thanksgiving food, I can't even think straight enough to test it out.

I'll try to post a solution tomorrow for ya.

That is if someone doesn't beat me to it first...

Joined: Sep 2003
Posts: 488
Code Monkey
Code Monkey
Joined: Sep 2003
Posts: 488
By all means, recover

Joined: Mar 2001
Posts: 644
Member
Member
Offline
Joined: Mar 2001
Posts: 644
I know this is easy... but I think my brain is on perma-vacation.

Dropped a note to my friend, he'll get back with the way to do this.

On another note, I noticed a couple mistakes I made in the file regarding table prefixes... please download the updated version on the first post of this thread.

Joined: Mar 2003
Posts: 215
Junior Member
Junior Member
Offline
Joined: Mar 2003
Posts: 215
Just tried this out quickly to see what it's about.

It's returning subject headlines in forums that I'm not a group member in and shouldn't see.

Joined: Apr 2001
Posts: 3,266
Member
Member
Offline
Joined: Apr 2001
Posts: 3,266
I just tested this out what you said and it shows the proper groups for me.

I tested with several different test accounts I have as well as admin account.

Joined: Mar 2001
Posts: 644
Member
Member
Offline
Joined: Mar 2001
Posts: 644
Yes we tested the permissions thing extensively to make sure that only the forums you have permissions for would be visible.

That is why the username and password is required, if you don't enter those you should only see the forums that have guest access.

Joined: Sep 2003
Posts: 488
Code Monkey
Code Monkey
Joined: Sep 2003
Posts: 488
Thanks, much appreciated :-)

Joined: Mar 2001
Posts: 644
Member
Member
Offline
Joined: Mar 2001
Posts: 644
Ok, new version posted again... (will be posted after I post this msg. )

New option -news (instead of -t or -y).

Added new config line newsboard, enter your news board keyword in there and your users will be able to see only new posts, from today, that are posted to the news board.

Sorry for the delay, my brain kicked in about 30 min ago... Turkey is a wonderful thing!

Joined: Nov 2001
Posts: 10,369
I type Like navaho
I type Like navaho
Joined: Nov 2001
Posts: 10,369
I've installed this here:

https://www.ubbdev.com/forum/rss.php


I'm a n00b to all this ,but it seems to throw an error if you don't pass a username/password.

Joined: Apr 2001
Posts: 3,266
Member
Member
Offline
Joined: Apr 2001
Posts: 3,266
Weird Josh works fine for me without a username and password. It just throws the same as an anonymous user on a board can see

Maybe something to do with this new server configuration? Safe Mode ON?

http://www.reeftalk.com/rss.php

Joined: Mar 2003
Posts: 215
Junior Member
Junior Member
Offline
Joined: Mar 2003
Posts: 215
I looked into my claim a bit more.

I have a forum that has read/write access only to group 11.

The account I use is not a member of group 11, but is a member of group 1.

$allowAccess ends up "yes" for posts in the forum that has access only to group 11.

The following statement fails when dealing with double digit groups:
if (preg_match("/$Grouparray[$x]/", $dbReadPerm))

If I'm in group -1-, and read access is for group -11-, $Grouparray[$x] is '1' not '-1-'. so preg_match("1", "-11-") is true. Group 2 would match -12- etc.

"/$Grouparray[$x]/" needs to probably be "-/$Grouparray[$x]-/" instead to fix this.

Joined: Apr 2001
Posts: 3,266
Member
Member
Offline
Joined: Apr 2001
Posts: 3,266
Good point makes alot of sense. Since I do not use double digit groups and most people dont normally they would not see the error.

Joined: Sep 2003
Posts: 488
Code Monkey
Code Monkey
Joined: Sep 2003
Posts: 488
Sweet

Joined: Apr 2001
Posts: 3,266
Member
Member
Offline
Joined: Apr 2001
Posts: 3,266
Would you not just try to modify this line first though

if (!preg_match("/[0-9]/",$Grouparray[$x])) { continue; };

to this

if (!preg_match("/[0-99]/",$Grouparray[$x])) { continue; };

Joined: Mar 2001
Posts: 644
Member
Member
Offline
Joined: Mar 2001
Posts: 644
Ahh ok, will look into this Randy.

Joined: Apr 2001
Posts: 3,266
Member
Member
Offline
Joined: Apr 2001
Posts: 3,266
What also would be nice to to display maybe 150-200/
lines of the B_Body field underneath the post link.

Joined: Mar 2001
Posts: 644
Member
Member
Offline
Joined: Mar 2001
Posts: 644
Updated to 1.3b

Hopefully fixed the issue that Randy noticed with two digit group numbers.

Original post updated to reflect this fix. Please test this and let me know Randy.

Joined: Mar 2001
Posts: 644
Member
Member
Offline
Joined: Mar 2001
Posts: 644
[]Omegatron said:
What also would be nice to to display maybe 150-200/
lines of the B_Body field underneath the post link. [/]

This was in an early version, and will probably be added back in. Thanks Omegatron.

Joined: Sep 2000
Posts: 49
Power User
Power User
Offline
Joined: Sep 2000
Posts: 49
Zachary thanks a lot for this. I love it.

Correct me if I'm wrong, but.....
Line 121 should be changed

from this:
from w3t_Posts as t1, w3t_Boards as t2


to this:
from {$tbl_prefix}Posts as t1, {$tbl_prefix}Boards as t2


I'd second Omegatron's note about including some of the body. Also, I'd like to fetch the most recent 5 posts in the news forum, not necessarily just "today's" -- I don't have news every day and I want to ensure something shows up in other people's feeds. Know what I mean?

If I can help please let me know.

Thanks a lot.

Joined: Apr 2001
Posts: 3,266
Member
Member
Offline
Joined: Apr 2001
Posts: 3,266
Delta you can adjust the queries abit based on your needs if you know what you want.

Joined: Sep 2000
Posts: 49
Power User
Power User
Offline
Joined: Sep 2000
Posts: 49
Yup... I managed to get the last 5 posts by eliminating:

AND ( FROM_UNIXTIME(t1.B_Posted,'%Y-%m-%d')='$currentDate' )

from the end of line 122, and changing the limit from 15 to 5.

Still not sure how to get some of the body of each post -- not the whole body obviously.

Joined: Mar 2001
Posts: 644
Member
Member
Offline
Joined: Mar 2001
Posts: 644
[]deltajo said:
Zachary thanks a lot for this. I love it.

Correct me if I'm wrong, but.....
Line 121 should be changed

from this:
from w3t_Posts as t1, w3t_Boards as t2


to this:
from {$tbl_prefix}Posts as t1, {$tbl_prefix}Boards as t2


I'd second Omegatron's note about including some of the body. Also, I'd like to fetch the most recent 5 posts in the news forum, not necessarily just "today's" -- I don't have news every day and I want to ensure something shows up in other people's feeds. Know what I mean?

If I can help please let me know.

Thanks a lot. [/]

Good eye, thanks. Fixed and updated.

Joined: Mar 2001
Posts: 644
Member
Member
Offline
Joined: Mar 2001
Posts: 644
[]deltajo said:
Still not sure how to get some of the body of each post -- not the whole body obviously. [/]

Hoping to add this back in, in the next revision. **Coming Soon**

Joined: Sep 2000
Posts: 49
Power User
Power User
Offline
Joined: Sep 2000
Posts: 49
Thanks.

Also, if it could deliver pizza, that'd be good.

With pepperoni.

NO ANCHOVIES though

Joined: Apr 2001
Posts: 3,266
Member
Member
Offline
Joined: Apr 2001
Posts: 3,266
Okay attached is one that shows a preview of the post body.

right now it is set to 200 characters but can be easily changed.
Attachments
101058-rss.txt (0 Bytes, 58 downloads)

Joined: Sep 2000
Posts: 49
Power User
Power User
Offline
Joined: Sep 2000
Posts: 49
Hey thanks Chuck -- that worked great.

Joined: Apr 2001
Posts: 3,266
Member
Member
Offline
Joined: Apr 2001
Posts: 3,266
No Problem

Joined: Jan 2002
Posts: 674
Junior Member
Junior Member
Offline
Joined: Jan 2002
Posts: 674
6.4? I haven't tried the rss feed and hope to play with it.

Page 1 of 2 1 2

Link Copied to Clipboard
Donate Today!
Donate via PayPal

Donate to UBBDev today to help aid in Operational, Server and Script Maintenance, and Development costs.

Please also see our parent organization VNC Web Services if you're in the need of a new UBB.threads Install or Upgrade, Site/Server Migrations, or Security and Coding Services.
Recommended Hosts
We have personally worked with and recommend the following Web Hosts:
Stable Host
bluehost
InterServer
Visit us on Facebook
Member Spotlight
isaac
isaac
California
Posts: 1,157
Joined: July 2001
Forum Statistics
Forums63
Topics37,573
Posts293,925
Members13,849
Most Online5,166
Sep 15th, 2019
Today's Statistics
Currently Online
Topics Created
Posts Made
Users Online
Birthdays
Top Posters
AllenAyres 21,079
JoshPet 10,369
LK 7,394
Lord Dexter 6,708
Gizmo 5,833
Greg Hard 4,625
Top Posters(30 Days)
Top Likes Received
isaac 82
Gizmo 20
Brett 7
WebGuy 2
Morgan 2
Top Likes Received (30 Days)
None yet
The UBB.Developers Network (UBB.Dev/Threads.Dev) is ©2000-2024 VNC Web Services

 
Powered by UBB.threads™ PHP Forum Software 8.0.0
(Preview build 20221218)