[ABD] RSS Feed 2.2.4

A place for MOD Authors to post and receive feedback on MODs still in development. No MODs within this forum should be used within a live environment! No new topics are allowed in this forum.
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

IMPORTANT: MOD Development Forum rules

On February 1, 2009 this forum will be set to read only as part of retiring of phpBB2.
Locked
chyduskam
Registered User
Posts: 110
Joined: Thu Oct 28, 2004 9:33 am
Location: Saint Petersburg, Russia
Contact:

Post by chyduskam » Tue Mar 15, 2005 3:42 pm

corny749 wrote: Now I've got it working correctly, played a bit with the dates in rss.php.
line 321:

Code: Select all

   'BUILD_DATE'=>RSSTimeFormat(time()),

It work like unmodified code in rss.php:

Code: Select all

gmdate('D, d M Y H:i:s').' GMT',
So, there is no reason to do this changes
corny749 wrote: line 477:

Code: Select all

         'UTF_TIME'=>RSSTimeFormat($post['post_time']),

In first version of MOD I use gmdate('D, d M Y H:i:s',$post['post_time']).' GMT'
but some aggreg do not work correctly with it (Abilon, for examle)
RSS 2.0 Specification and RFC 822 allow use time zone offset in date, like
Tue, 15 Mar 2005 18:27:33 +0300
or 15 Mar 2005 15:27:33 GMT
and aggreg MUST understand it correctly

Try to use fix like this

Code: Select all

'UTF_TIME'=>RSSTimeFormat($post['post_time'],((strpos($useragent,'RssReader')!==false)?0:$userdata['user_timezone'])),

corny749
Registered User
Posts: 18
Joined: Tue Feb 17, 2004 8:40 am
Location: Utrecht, The Netherlands
Contact:

Post by corny749 » Tue Mar 15, 2005 4:07 pm

Thanks for the reply, but it only works correctly for FeedReader after a modification:

Code: Select all

strpos(strtolower($useragent),'reader')
Regards,
Cornelis

chyduskam
Registered User
Posts: 110
Joined: Thu Oct 28, 2004 9:33 am
Location: Saint Petersburg, Russia
Contact:

Post by chyduskam » Tue Mar 15, 2005 7:10 pm

I'am sorry. I have mixed RssReader And Feedreader.
But as I see now RssReader have same bug and your code have solved both case.

chyduskam
Registered User
Posts: 110
Joined: Thu Oct 28, 2004 9:33 am
Location: Saint Petersburg, Russia
Contact:

Post by chyduskam » Tue Mar 15, 2005 7:22 pm

Anover solution is fix Abilon and ActiveRefresh bug

Code: Select all

'UTF_TIME'=>RSSTimeFormat($post['post_time'],(((strpos($useragent,'Abilon')!==false)||(strpos($useragent,'ActiveRefresh')!==false))?$userdata['user_timezone']:0)),
For All other programs it will be format datetime as GMT, but for Abilon and ActiveRefresh with timezone.

chyduskam
Registered User
Posts: 110
Joined: Thu Oct 28, 2004 9:33 am
Location: Saint Petersburg, Russia
Contact:

Post by chyduskam » Tue Mar 15, 2005 8:29 pm

More complex solution.
1. Don't change rss.php. Use file from ver. 2.2.1
2. Open rss_functions.php

Code: Select all

#-----FIND
function RSSTimeFormat($utime,$uoffset=0)
{
    $uoffset=intval($uoffset);
	$result=gmdate("D, d M Y H:i:s", $utime + (3600 * $uoffset));
	$uoffset=intval($uoffset*100);
	$result.=" ".(($uoffset>0)?"+":"").(($uoffset==0)? "GMT": sprintf((($uoffset<0)?"%05d":"%04d"),$uoffset));
	return $result;
}
#---- REPLACE WITH
function RSSTimeFormat($utime,$uoffset=0)
{
    global $HTTP_GET_VARS,$user_id,$useragent;
    if(CACHE_TO_FILE && ($user_id==ANONYMOUS) && empty($HTTP_GET_VARS))$uoffset=0;
    if((isset($HTTP_GET_VARS['time']) && $HTTP_GET_VARS['time']=='local')|| (strpos($useragent,'Abilon')!==false)|| (strpos($useragent,'ActiveRefresh')!==false))
    {
    	$uoffset=intval($uoffset);
    }
    else $uoffset=0;
	$result=gmdate("D, d M Y H:i:s", $utime + (3600 * $uoffset));
	$uoffset=intval($uoffset*100);
	$result.=" ".(($uoffset>0)?"+":"").(($uoffset==0)? "GMT": sprintf((($uoffset<0)?"%05d":"%04d"),$uoffset));
	return $result;
}
It allow use date format GMT and timezone, using key time=local
I use this solution in next version.

chyduskam
Registered User
Posts: 110
Joined: Thu Oct 28, 2004 9:33 am
Location: Saint Petersburg, Russia
Contact:

Post by chyduskam » Tue Mar 15, 2005 8:32 pm

Sorry. Duplicate Item.
Last edited by chyduskam on Wed Mar 16, 2005 5:25 am, edited 1 time in total.

corny749
Registered User
Posts: 18
Joined: Tue Feb 17, 2004 8:40 am
Location: Utrecht, The Netherlands
Contact:

Post by corny749 » Tue Mar 15, 2005 9:02 pm

Great, I'll give it a try.

edit: this is working, thanks a lot!
Regards,
Cornelis

User avatar
TimG
Registered User
Posts: 121
Joined: Sun Jun 23, 2002 8:52 pm
Location: Germany

Ensuring only authorized users see private/hidden forums

Post by TimG » Wed Mar 16, 2005 7:11 pm

Hi!

I've been testing the latest version of the feed generator and it looks great. Before installing it on my board there's something very important I need to check:

There is one closed, hidden forum for a closed users' group.

As far as I understand the documentation and the results of my tests, setting autologin to "true" will include hidden and private forums in the feed, but only for authorized users. If their login is stored in a current cookie the forums will be included automatically, if not they must enter their user name and password.

Is it absolutely certain that no hidden or private forums will be included in the feed if the user is not a member of the group that gives permissions to use these forums normally?

Also, I'm not 100% sure about the $unauthed list: I'm guessing that this the list of forums I want to explicitly exclude from the feed, is that correct?

TIA! :)
Last edited by TimG on Fri Mar 18, 2005 7:04 am, edited 3 times in total.
Regards,
Tim

chyduskam
Registered User
Posts: 110
Joined: Thu Oct 28, 2004 9:33 am
Location: Saint Petersburg, Russia
Contact:

Post by chyduskam » Wed Mar 16, 2005 8:23 pm

TimG,
First of all sorry for my English. I was hurted then our class was learned it.

This mod use same solution of authorisation as phpBB. Autologin "true" is default setting and use standart phpBB session procedures then "login" or "uid" key is not set.

Checking permission are next:

Code: Select all

if($userdata['user_level']<>ADMIN)
{
	$is_auth = array();
	$is_auth = auth(AUTH_READ, AUTH_LIST_ALL, $userdata);
	if($forum_id=='') {
		while ( list($forumId, $auth_mode) = each($is_auth) )
		{
			if ( !$auth_mode['auth_read'] )
			{
				$unauthed .= ',' . $forumId;
			}
		}
	$sql_forum_where="AND f.forum_id NOT IN (" . $unauthed . ")";
	}
	else
	{
		if((!$is_auth[$forum_id]['auth_read']) or (strpos(",$unauthed," , ",$forum_id,")))
         {
          if($needlogin) ExitWithHeader("404 Not Found","This forum does not exists");
          else
          {
			header('Location: ' .$index_url."rss.".$phpEx."?".$HTTP_SERVER_VARS['QUERY_STRING'].'&login');
          	ExitWithHeader("301 Moved Permanently");
          }
		 }
		else $sql_forum_where = 'AND f.forum_id = ' . $forum_id;
	}
unset($is_auth);
}
elseif($forum_id!='')
{
	$sql_forum_where = 'AND f.forum_id = ' . $forum_id;
}

Also, I'm not 100% sure about the $unauthed list: I'm guessing that this the list of forums I want to explicitly exclude from the feed, is that correct?

As you see, ADMIN can see ALL forums and $unauthed too, but other users cannot see $unauthed forums at all.
NB! It check READ permission, not VIEW. You must set correct VIEW permission to your forum.
In addition I can say that it's standart solution not mine.

To disable see $unauthed forum to ADMIN too, change code like this:

Code: Select all

elseif($forum_id!='')
{
	$sql_forum_where = 'AND f.forum_id = ' . $forum_id;
}
to

Code: Select all

elseif($forum_id!='')
{
if(strpos(",$unauthed," , ",$forum_id,")) ExitWithHeader("404 Not Found","This forum does not exists");
	$sql_forum_where = 'AND f.forum_id = ' . $forum_id;
}
if(empty($sql_forum_where)) $sql_forum_where="AND f.forum_id NOT IN (" . $unauthed . ")";
Is it absolutely certain that no hidden or private forums will be included in the feed if the user is not a member of the group that gives permissions to use these forums normally?


I believe that it true. But as you see phpBB has 3 security fix not so long ago therefore anybody cannot guarantee absolute security.

User avatar
TimG
Registered User
Posts: 121
Joined: Sun Jun 23, 2002 8:52 pm
Location: Germany

Post by TimG » Thu Mar 17, 2005 6:26 am

Chy,

Thanks very much for the detailed reply, that's really helpful! And thank you for producing such a terrific update of the RSS Feed mod, I really appreciate all the work you've put into this! :) (By the way, don't worry about your English -- I doubt whether my Russian will ever be that good...)
I believe that it true. But as you see phpBB has 3 security fix not so long ago therefore anybody cannot guarantee absolute security.

Well, perfection isn't possible, but if it uses the same access mechanisms as phpBB I think that's OK for me. 8)
Regards,
Tim

User avatar
TimG
Registered User
Posts: 121
Joined: Sun Jun 23, 2002 8:52 pm
Location: Germany

Removing "RE:" from the subject string

Post by TimG » Thu Mar 17, 2005 8:34 am

Is there any way to remove the "RE:" prefix from the subject string of topic replies? I want to include all the replies, but without the "RE:" prefix.

Why:
In good aggregators like Feed Demon this would make perfect sorting possible because the aggregator will then sort on Subject and PubDate, so all the threads will be arranged correctly. 8)
Regards,
Tim

chyduskam
Registered User
Posts: 110
Joined: Thu Oct 28, 2004 9:33 am
Location: Saint Petersburg, Russia
Contact:

Post by chyduskam » Thu Mar 17, 2005 9:02 am

TimG
Is there any way to remove the "RE:" prefix from the subject...

It's not subject it's topic title.
Try to do next:

open rss.php
#--- FIND

Code: Select all

		// Variable reassignment for topic title, and show whether it is the start of topic, or a reply
		$topic_title = $post['topic_title'];
		if ( $post['post_id'] != $post['topic_first_post_id'] )
		{
			$topic_title = 'RE: ' . $topic_title;
		}
#--- REPLACE WITH

Code: Select all

		// Variable reassignment for topic title, and show whether it is the start of topic, or a reply
		$topic_title = $post['topic_title'];
//		if ( $post['post_id'] != $post['topic_first_post_id'] )
//		{
//			$topic_title = 'RE: ' . $topic_title;
//		}

User avatar
TimG
Registered User
Posts: 121
Joined: Sun Jun 23, 2002 8:52 pm
Location: Germany

Post by TimG » Thu Mar 17, 2005 9:28 am

Thanks! :D
Regards,
Tim

jimes007
Registered User
Posts: 5
Joined: Tue Mar 08, 2005 11:51 am
Location: Taiwan, ROC.

Post by jimes007 » Thu Mar 17, 2005 12:10 pm

Hi chyduskam,

Both Your great mod and recommend RSS reader work fine.

Thanks a miloin. :mrgreen:

User avatar
TimG
Registered User
Posts: 121
Joined: Sun Jun 23, 2002 8:52 pm
Location: Germany

Not setting the "read" attribute

Post by TimG » Fri Mar 18, 2005 6:53 am

Hi Chy,

If you use logon the "read" attribute is set in the forum for all new topics as soon as they have been loaded by your RSS aggregator. Is it possible to change this behavior so that users using logon can still see new posts as "unread" when they visit the forum with their browser after viewing the topics in the aggregator?

I think this currently only affects users with access to a closed forum, because they are the only ones using logon (I can't test it because I'm using logon myself...):

I have the system set up with autologon set to "false". There is only one forum section where logon is used, and users with access to this forum must set up a separate feed channel for it. This means they have one channel for all the sections in the main forum and another channel for the closed forum. However, using the logon in the closed channel affects the entire forum. As soon as their aggregator has read the two channels all postings in all forum sections are set to "read", and this is a problem... :?
Regards,
Tim

Locked

Return to “[2.0.x] MODs in Development”