[2.0.6] RSS Content Syndicator

The cleanup is complete. This forum is now read only.

Rating:

Excellent!
119
64%
Very Good
41
22%
Good
13
7%
Fair
5
3%
Poor
7
4%
 
Total votes: 185

nschindler
Registered User
Posts: 101
Joined: Tue Jun 17, 2003 12:24 am
Location: Los Angeles, CA, USA
Contact:

Re: For security, add this

Post by nschindler » Mon Dec 08, 2003 5:41 am

mc717990 wrote: Well, it's more change the where statement to this:

WHERE
t.forum_id = f.forum_id
AND f.auth_view = " . AUTH_ALL . " AND f.auth_read = 0
AND p.poster_id = u.user_id
AND pt.post_id = p.post_id
AND p.topic_id = t.topic_id
$sql_topics_only_where
$sql_forum_where

There's probably a more "correct" method, but f.auth_read is the one that limits access to reading a forum. I think auth_view is limiting access to whether they can see the forum exists.


good observation. that came from the original code, but I probably should've caught it. I'll add that to the list of things to change. :)

LoOoD
Registered User
Posts: 43
Joined: Tue Sep 24, 2002 6:47 am

Post by LoOoD » Tue Dec 09, 2003 6:26 am

I added the patch below. It helps. I get over 100 replies a day so I'm not to worried about it not finding anything in the last 24hrs..

Code: Select all

--- mods/RSS_Content_Syndicator_202/rss.php     Thu Sep  4 09:08:50 2003
+++ rss.php     Mon Dec  8 22:12:06 2003
@@ -51,6 +51,8 @@
 // Which forum do you want posts from (forum_id)?  specified in the url with "f=".  Defaults to all (public) forums.
 $forum_id = ( isset($HTTP_GET_VARS['f']) ) ? intval($HTTP_GET_VARS['f']) : '';
 $sql_forum_where = ( !empty($forum_id) ) ? ' AND f.forum_id = ' . $forum_id : ' ';
+$time_limit = ( isset($HTTP_GET_VARS['l']) ) ? intval($HTTP_GET_VARS['l']) : '';
+$sql_time_limit = ( !empty($time_limit) ) ? ' AND p.post_time > ' . time() . "- 86400" : ' ';
 // Return topics only, or all posts?  Specified in the URL with "t=".  Defaults to all posts (0).
 $topics_only = (isset($HTTP_GET_VARS['t']) ) ? intval($HTTP_GET_VARS['t']) : 0;
 $sql_topics_only_where = '';
@@ -151,6 +153,7 @@
                        AND p.topic_id = t.topic_id
                        $sql_topics_only_where
                        $sql_forum_where
+                       $sql_time_limit
        ORDER BY p.post_time DESC LIMIT $count";
 $posts_query = $db->sql_query($sql);
 //

gr00vy0ne
Registered User
Posts: 5
Joined: Tue Nov 11, 2003 8:33 am

Post by gr00vy0ne » Sat Dec 13, 2003 2:12 pm

nschindler wrote:
rabidgopher04 wrote:Hi, I just noticed something about this MOD. It only displays new topics and not if there is a new post nor moves the topic with a new post to the top of the list. Is there a way this feature could be added as an option?

Let me know if you need more clarification or if this was not within the scope of the project. Thanks :)


by default, it displays new posts. it only displays 'start of topic' posts when you call it as "rss.php?t=1". the newest item should be at the top of the list.
if this isn't your experience, please clarify... i'm confused.


I think I have a similar problem. Basically, it's returning way too many items. In some cases I get duplicates.

So, whenever one person replies to any given post instead of getting that latest reply in the RSS feed, I get the latest reply PLUS all the other entries before it. How can I get it to only show the latest reply only?

gr00vy0ne
Registered User
Posts: 5
Joined: Tue Nov 11, 2003 8:33 am

Post by gr00vy0ne » Sat Dec 13, 2003 2:15 pm

nschindler wrote:
rabidgopher04 wrote:Hi, I just noticed something about this MOD. It only displays new topics and not if there is a new post nor moves the topic with a new post to the top of the list. Is there a way this feature could be added as an option?

Let me know if you need more clarification or if this was not within the scope of the project. Thanks :)


by default, it displays new posts. it only displays 'start of topic' posts when you call it as "rss.php?t=1". the newest item should be at the top of the list.
if this isn't your experience, please clarify... i'm confused.


I think I have a similar problem. Basically, it's returning way too many items. In some cases I get duplicates.

So, whenever one person replies to any given post instead of getting that latest reply in the RSS feed, I get the latest reply PLUS all the other entries before it. How can I get it to only show the latest reply only?

gr00vy0ne
Registered User
Posts: 5
Joined: Tue Nov 11, 2003 8:33 am

Post by gr00vy0ne » Sat Dec 13, 2003 2:25 pm

nschindler wrote:
rabidgopher04 wrote:Hi, I just noticed something about this MOD. It only displays new topics and not if there is a new post nor moves the topic with a new post to the top of the list. Is there a way this feature could be added as an option?

Let me know if you need more clarification or if this was not within the scope of the project. Thanks :)


by default, it displays new posts. it only displays 'start of topic' posts when you call it as "rss.php?t=1". the newest item should be at the top of the list.
if this isn't your experience, please clarify... i'm confused.


I think I have a similar problem. Basically, it's returning way too many items. In some cases I get duplicates.

So, whenever one person replies to any given post instead of getting that latest reply in the RSS feed, I get the latest reply PLUS all the other entries before it. How can I get it to only show the latest reply only?

Alive
Registered User
Posts: 7
Joined: Wed Oct 02, 2002 3:06 pm

Post by Alive » Sun Dec 14, 2003 4:07 pm

I see alot of people referring to CARP. I haven't tried it, but I assume it does a similar thing to the program I am using. Zfeeder, which is also GPL and free, and allows the user to choose several different feeds.

I found it great, has several options for displaying the feeds, and adding a feed is a very simple process.

recognizing RSS versions 0.9, 0.9x, 1.0, 2.0


http://zvonnews.sourceforge.net/

Let me know if this is like CARP...since I haven't given it a go.

nschindler
Registered User
Posts: 101
Joined: Tue Jun 17, 2003 12:24 am
Location: Los Angeles, CA, USA
Contact:

Post by nschindler » Sun Dec 14, 2003 9:20 pm

gr00vy0ne wrote: So, whenever one person replies to any given post instead of getting that latest reply in the RSS feed, I get the latest reply PLUS all the other entries before it. How can I get it to only show the latest reply only?


You're not getting duplicates because you actually have two of the exact same post, right? ;)

Maybe I was a little fuzzy on this:
It shows, by default, the last 15 posts to all public forums. If there were two posts in the same topic that were in the most recent 15 posts, they will display in the feed. I didn't write anything into this to only show the most recent post to any topic. You can either make it to start-of-topic posts only, with rss.php?t=1, or just let it do what it does by default, and pull the most recent 15 posts.
I wrote it this way, because I wanted every item syndicated from my board; I didn't want to miss anything. Within the next couple of days, I'll post a patch for you so that you can make it show only the latest post to any topic, if that's what you want it to do.

gr00vy0ne
Registered User
Posts: 5
Joined: Tue Nov 11, 2003 8:33 am

Post by gr00vy0ne » Sun Dec 14, 2003 9:34 pm

Thanks. I would appreciate that! Is it a lot of trouble to upgrade the version of the RSS? Is it just a matter of editing the RSS_BODY.tpl file?

nschindler
Registered User
Posts: 101
Joined: Tue Jun 17, 2003 12:24 am
Location: Los Angeles, CA, USA
Contact:

Post by nschindler » Mon Dec 15, 2003 6:10 pm

gr00vy0ne wrote: Thanks. I would appreciate that! Is it a lot of trouble to upgrade the version of the RSS? Is it just a matter of editing the RSS_BODY.tpl file?


you can change the template to call it rss 1.0 or rss 2.0 if you want to. As far as I know, 1.0 and 2.0 are completely backwards-compatible with features of 0.92, 0.91, and 0.9.

I said in a previous post that I chose 0.92 because it was the lowest-common denominator that offered support for what I needed. 0.92 was the first one to remove the 500 character limit in the description field, and it was also the first one to offer support for content-encoded html tags in the description field. 1.0 and 2.0 offer a lot more "item" sub-elements, and support for some new things within existing sub-elements, but i had little use for those in this MOD. So, I stuck with 0.92 to ensure that most aggregators would support the feed output. Although 0.92 is fairly old now, I did find a couple of aggregators that only supported 0.9, and 0.91. Did you have a specific reason for changing the rss version?

blacklily8
Registered User
Posts: 14
Joined: Sun Oct 05, 2003 7:06 pm

Selecting Forums

Post by blacklily8 » Wed Dec 17, 2003 4:01 pm

Is there any way to make this script only syndicate a few forums? I have several forums that I would like syndicated, but I don't want all public forums. I've tried to tweak the config, but it doesn't seem to want to accept more than one entry for f.

Help! :(

nschindler
Registered User
Posts: 101
Joined: Tue Jun 17, 2003 12:24 am
Location: Los Angeles, CA, USA
Contact:

Re: Selecting Forums

Post by nschindler » Wed Dec 17, 2003 4:49 pm

blacklily8 wrote: Is there any way to make this script only syndicate a few forums? I have several forums that I would like syndicated, but I don't want all public forums. I've tried to tweak the config, but it doesn't seem to want to accept more than one entry for f.

Help! :(


as it stands, you can choose a specific forum, but not an array of forums. So, you'd have to have a separate feed for each.
You do this by using the "f" variable in the url: "rss.php?f=<forum number>", e.g. "rss.php?f=1".

netclectic
Former Team Member
Posts: 4439
Joined: Wed Mar 13, 2002 3:08 pm
Location: Omnipresent
Contact:

Post by netclectic » Wed Dec 17, 2003 5:00 pm

after a quick look at the code, you could change this:

Code: Select all

$forum_id = ( isset($HTTP_GET_VARS['f']) ) ? intval($HTTP_GET_VARS['f']) : '';
$sql_forum_where = ( !empty($forum_id) ) ? ' AND f.forum_id = ' . $forum_id : ' ';
to

Code: Select all

$forum_id = ( isset($HTTP_GET_VARS['f']) ) ? htmlspecialchars($HTTP_GET_VARS['f']) : '';
$sql_forum_where = ( !empty($forum_id) ) ? ' AND f.forum_id IN [ ' . $forum_id . ']': ' ';
which would let you use ?f=1,2,3,4
Defend the game:
Image

nschindler
Registered User
Posts: 101
Joined: Tue Jun 17, 2003 12:24 am
Location: Los Angeles, CA, USA
Contact:

Post by nschindler » Wed Dec 17, 2003 5:02 pm

netclectic wrote: after a quick look at the code, you could change this:

Code: Select all

$forum_id = ( isset($HTTP_GET_VARS['f']) ) ? intval($HTTP_GET_VARS['f']) : '';
$sql_forum_where = ( !empty($forum_id) ) ? ' AND f.forum_id = ' . $forum_id : ' ';
to

Code: Select all

$forum_id = ( isset($HTTP_GET_VARS['f']) ) ? htmlspecialchars($HTTP_GET_VARS['f']) : '';
$sql_forum_where = ( !empty($forum_id) ) ? ' AND f.forum_id IN [ ' . $forum_id . ']': ' ';
which would let you use ?f=1,2,3,4


dude... thanks! :D

gr00vy0ne
Registered User
Posts: 5
Joined: Tue Nov 11, 2003 8:33 am

Post by gr00vy0ne » Wed Dec 17, 2003 5:53 pm

nschindler wrote:
gr00vy0ne wrote:Thanks. I would appreciate that! Is it a lot of trouble to upgrade the version of the RSS? Is it just a matter of editing the RSS_BODY.tpl file?


you can change the template to call it rss 1.0 or rss 2.0 if you want to. As far as I know, 1.0 and 2.0 are completely backwards-compatible with features of 0.92, 0.91, and 0.9.

I said in a previous post that I chose 0.92 because it was the lowest-common denominator that offered support for what I needed. 0.92 was the first one to remove the 500 character limit in the description field, and it was also the first one to offer support for content-encoded html tags in the description field. 1.0 and 2.0 offer a lot more "item" sub-elements, and support for some new things within existing sub-elements, but i had little use for those in this MOD. So, I stuck with 0.92 to ensure that most aggregators would support the feed output. Although 0.92 is fairly old now, I did find a couple of aggregators that only supported 0.9, and 0.91. Did you have a specific reason for changing the rss version?


Ok, cool I understand your reason for 0.92 and agree with it but some of my users have requested 2.0 support so I thought I'd try it out. I edited my rss.tpl file to be rss 2.0 compliant. That was the easy part.

I found out a way to solve my problem with the multiple posts...

Code: Select all

$sql_topics_only_where = '';
if ( $topics_only == 1 )
{
	$sql_topics_only_where = 'AND p.post_id = t.topic_first_post_id';
}
I changed the t.topic_first_post_id to t.topic_last_post_id and now everything is working like it should be. Only new posts to any given topic are returned in the RSS feed. With the default code (first_post) it would return all posts for any given topic whenever that topic was updated.
Last edited by gr00vy0ne on Wed Dec 17, 2003 6:16 pm, edited 1 time in total.

nschindler
Registered User
Posts: 101
Joined: Tue Jun 17, 2003 12:24 am
Location: Los Angeles, CA, USA
Contact:

Post by nschindler » Wed Dec 17, 2003 6:13 pm

gr00vy0ne wrote: Ok, cool I understand your reason for 0.92 and agree with it but some of my users have requested 2.0 support so I thought I'd try it out. I edited my rss.tpl file to be rss 2.0 compliant. That was the easy part.


did they give you a specific reason, such as a feature of 2.0 that wasn't provided by this feed?

Post Reply

Return to “[2.0.x] MOD Database Cleanup”

cron