[ABD]simple rss mod for phpbb3

Any abandoned MODs will be moved to this forum.

WARNING: MODs in this forum are not currently being supported or maintained by the original MOD author. Proceed at your own risk.
Forum rules
IMPORTANT: MOD Development Forum rules

WARNING: MODs in this forum are not currently being supported nor updated by the original MOD author. Proceed at your own risk.
needcaffeine
Registered User
Posts: 7
Joined: Thu Mar 06, 2008 11:59 pm

Re: [Beta]simple rss mod for phpbb3

Post by needcaffeine »

one more change. i had to change

Code: Select all

$post_link    = $board_url."/viewtopic.".$phpEx."?f=".$forumid."&t=".$topicid."#p".$row['topic_last_post_id'];
to

Code: Select all

$post_link    = $board_url."/viewtopic.".$phpEx."?p=".$row['topic_last_post_id']."#p".$row['topic_last_post_id'];
to enable clicking on the link to take me directly to the post instead of the first page of the thread.
needcaffeine
Registered User
Posts: 7
Joined: Thu Mar 06, 2008 11:59 pm

Re: [Beta]simple rss mod for phpbb3

Post by needcaffeine »

i also enabled forum-specific and topic-specific views.

after

Code: Select all

 21 // Start session
 22 $user->session_begin();
 23 $auth->acl($user->data);
 24 $user->setup();
add:

Code: Select all

// Initial var setup
$forum_id = request_var('f', 0);
$topic_id = request_var('t', 0);
$forum_sql = empty($forum_id) ? '' : (" AND f.forum_id = '$forum_id'");
$topic_sql = empty($topic_id) ? '' : (" AND p.topic_id = t.topic_id AND t.topic_id = '$topic_id'");
and change

Code: Select all

AND p.post_id = t.topic_last_post_id
AND u.user_id = p.poster_id
to

Code: Select all

AND u.user_id = p.poster_id' . $forum_sql . $topic_sql . (empty($topic_sql) ? ' AND p.post_id = t.topic_last_post_id ' : '') . '
I also got rid of topic_last_poster_name from the query since we query for u.username anyway so we're not saving any query time. this of course requires that you change

Code: Select all

$description  = $user->lang['POST_BY_AUTHOR']." ".$row['topic_last_poster_name']."
to

Code: Select all

$description  = $user->lang['POST_BY_AUTHOR']." ".$row['username']."
here is my final sql:

Code: Select all

//
// This SQL query selects the latest topics of all forum
//
$sql = 'SELECT f.forum_id,f.forum_name, f.forum_desc_options, t.topic_title, t.topic_id, t.topic_last_post_id, p.post_id, p.post_time, p.post_text,
        p.bbcode_uid, p.bbcode_bitfield, u.username, u.user_id
        FROM  '. FORUMS_TABLE .'  f,'.TOPICS_TABLE.' t, '.POSTS_TABLE.' p,'.USERS_TABLE.' u
        WHERE t.forum_id = f.forum_id
        AND t.topic_status != 1
        AND u.user_id = p.poster_id' . $forum_sql . $topic_sql . (empty($topic_sql) ? ' AND p.post_id = t.topic_last_post_id ' : '') . '
        ORDER BY ' . (empty($topic_sql) ? 't.topic_last_post_time DESC' : 'p.post_time DESC') . '
        LIMIT 30 ';
Last edited by needcaffeine on Sun Mar 16, 2008 11:03 pm, edited 2 times in total.
needcaffeine
Registered User
Posts: 7
Joined: Thu Mar 06, 2008 11:59 pm

Re: [Beta]simple rss mod for phpbb3

Post by needcaffeine »

changing the ORDER BY from using t.topic_last_post_id to t.topic_last_post_time will also improve performance since t.topic_last_post_time is indexed (alternatively, you could add an index to t.topic_last_post_id) and so sql will not need to do a filesort.
aadamson
Registered User
Posts: 3
Joined: Sun Mar 16, 2008 3:32 am

Re: [Beta]simple rss mod for phpbb3

Post by aadamson »

needcaffeine wrote:one more change. i had to change

Code: Select all

$post_link    = $board_url."/viewtopic.".$phpEx."?f=".$forumid."&t=".$topicid."#p".$row['topic_last_post_id'];
to

Code: Select all

$post_link    = $board_url."/viewtopic.".$phpEx."?p=".$row['topic_last_post_id']."#p".$row['topic_last_post_id'];
to enable clicking on the link to take me directly to the post instead of the first page of the thread.
That's odd, the original version in IE7 when you click on the link that is the topic name, it takes me right to the post...I didn't need to make the change you identified as the replacement. Worked correctly in greader as well...

Alan
needcaffeine
Registered User
Posts: 7
Joined: Thu Mar 06, 2008 11:59 pm

Re: [Beta]simple rss mod for phpbb3

Post by needcaffeine »

Hmm, really? I didn't look at it in IE. Didn't work in FF for me so I made the change.
I tried this version though and it works on both IE7 and FF so at least there's that.
Cream-T
Registered User
Posts: 3
Joined: Mon Apr 16, 2007 7:28 pm

Re: [Beta]simple rss mod for phpbb3

Post by Cream-T »

Edited: Gah. My mistake, ignore this post.
User avatar
manchumahara
Registered User
Posts: 65
Joined: Sun Jul 15, 2007 2:07 pm
Location: Bangladesh
Contact:

Re: [Beta]simple rss mod for phpbb3

Post by manchumahara »

needcaffeine wrote:Hmm, really? I didn't look at it in IE. Didn't work in FF for me so I made the change.
I tried this version though and it works on both IE7 and FF so at least there's that.
which version if FF are you using. Default mod is working fine in IE7, opera 9.2 and 9.5beta5 and FF 2.X in my pc.


Thanks needcaffeine for the suggestion. I will try to look this while further modificaion.
derek barnstorm
Registered User
Posts: 11
Joined: Wed Jul 05, 2006 12:52 am

Re: [Beta]simple rss mod for phpbb3

Post by derek barnstorm »

Great! Nice little MOD.

I just thought I'd post up a better way to add the RSS image link to the forum.

Find this in your style sheet:

Code: Select all

.sitehome, .icon-faq, .icon-members, .icon-home, .icon-ucp, .icon-register, .icon-logout,
And add '.icon-rss,' to it, like this:

Code: Select all

.sitehome, .icon-rss, .icon-faq, .icon-members, .icon-home, .icon-ucp, .icon-register, .icon-logout,
Then find this in your style sheet:

Code: Select all

.icon-faq      { background-image: url("{T_THEME_PATH}/images/icon_faq.gif"); }
And add this before it:

Code: Select all

.icon-rss	     { background-image: url("{T_THEME_PATH}/images/icon_rss.gif"); }
Then in your overall_header.html:

Add this:

Code: Select all

<li class="icon-rss"><a href="rss.php" title="RSS Feed">RSS</a></li>
Before this:

Code: Select all

<li class="icon-faq"><a href="{U_FAQ}" title="{L_FAQ_EXPLAIN}">{L_FAQ}</a></li>
Thanks again for the MOD!
Last edited by derek barnstorm on Wed Mar 19, 2008 6:58 pm, edited 1 time in total.
amochohan
Registered User
Posts: 92
Joined: Tue Dec 11, 2007 2:59 pm

Re: [Beta]simple rss mod for phpbb3

Post by amochohan »

Excellent mod! Thanks!! :)

One small request, is it possible to have smilies automagically removed or their path made absolute as when these are broken when shown in the rss feed

Amo
Inky
Registered User
Posts: 45
Joined: Mon Feb 11, 2008 1:33 am

Re: [Beta]simple rss mod for phpbb3

Post by Inky »

Sounds like a great mod. How far away are we from the next update, and is it worth waiting for?
derek barnstorm
Registered User
Posts: 11
Joined: Wed Jul 05, 2006 12:52 am

Re: [Beta]simple rss mod for phpbb3

Post by derek barnstorm »

needcaffeine wrote:one more change. i had to change

Code: Select all

$post_link    = $board_url."/viewtopic.".$phpEx."?f=".$forumid."&t=".$topicid."#p".$row['topic_last_post_id'];
to

Code: Select all

$post_link    = $board_url."/viewtopic.".$phpEx."?p=".$row['topic_last_post_id']."#p".$row['topic_last_post_id'];
to enable clicking on the link to take me directly to the post instead of the first page of the thread.
That was happening to me too, but this has fixed it.
derek barnstorm
Registered User
Posts: 11
Joined: Wed Jul 05, 2006 12:52 am

Re: [Beta]simple rss mod for phpbb3

Post by derek barnstorm »

I've just noticed that the feed only shows one (the last) post from each topic. Is it possible to show all last posts and if they are a reply?

Similar to this:

http://www.devon-technologies.com/scrip ... um/rss.php

Thanks.
User avatar
gavpedz
Registered User
Posts: 338
Joined: Thu Nov 16, 2006 12:00 pm
Contact:

Re: [Beta]simple rss mod for phpbb3

Post by gavpedz »

Hi guys thanks for this mod one problem i am having though

In IE7 you click rss and comes up fine bringing up the page to subscribe with posts listed but in FF 2.0.0.12 when you click rss it just pops up with add live bookmark window and thats it. How do i get it to show the page in FF?
needcaffeine
Registered User
Posts: 7
Joined: Thu Mar 06, 2008 11:59 pm

Re: [Beta]simple rss mod for phpbb3

Post by needcaffeine »

Tools > Options > Feeds

Select 'Show me a preview and ask me which Feed Reader to use'.
User avatar
gavpedz
Registered User
Posts: 338
Joined: Thu Nov 16, 2006 12:00 pm
Contact:

Re: [Beta]simple rss mod for phpbb3

Post by gavpedz »

Thanks for that
Locked

Return to “[3.0.x] Abandoned MODs”