[BETA] Bump Topic 0.0.3

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.
User avatar
cardude
Registered User
Posts: 67
Joined: Sat May 07, 2005 2:06 am

Post by cardude »

vrflyer wrote: Right ON "3Di" !!! 8)

While on topic, is there going to be a change on the MOD to allow only certain FORUMS from being able to be BUMPED ? :wink:

...and I belive to only allow MODS/ADMINS (per someone's request posted prior)

Remove "$topic starter" portion from "bump.php" code:

Code: Select all

if ( $userdata['session_logged_in'] && $topic_starter == $userdata['user_id'] || $userdata['user_level'] == ADMIN || $userdata['user_level'] == MOD )
Remove "$forum_topic_data" portion from "viewtopic.php" code:

Code: Select all

$bump_topic = ( $userdata['session_logged_in'] && $forum_topic_data['topic_poster'] == $userdata['user_id'] || $userdata['user_level'] == ADMIN || $userdata['user_level'] == MOD ) ? '<a href="' . $topic_bump_url . '" onclick="window.open(\'' . $topic_bump_url . '\', \'_bump\', \'height=120,resizable=no,scrollbars=no,width=290\');return false;"  target="_bump"><img src="' . $images['bump'] . '" alt="' . $lang['Bump'] . '" title="' . $lang['Bump'] . '" border="0" align="middle" /></a>' : '';
:wink:


does this make it so Admins and Mods are the only people that can bump?
User avatar
vrflyer
Registered User
Posts: 503
Joined: Mon Feb 17, 2003 8:27 pm

Post by vrflyer »

^^^ Yup (done & tested)... :wink:
Always Under Construction !
Seprez
Registered User
Posts: 8
Joined: Fri Sep 09, 2005 10:10 pm

Post by Seprez »

Very nice!!

do you happen to know How to add a bump timer also?
User avatar
cardude
Registered User
Posts: 67
Joined: Sat May 07, 2005 2:06 am

Post by cardude »

vrflyer wrote: Right ON "3Di" !!! 8)

While on topic, is there going to be a change on the MOD to allow only certain FORUMS from being able to be BUMPED ? :wink:

...and I belive to only allow MODS/ADMINS (per someone's request posted prior)

Remove "$topic starter" portion from "bump.php" code:

Code: Select all

if ( $userdata['session_logged_in'] && $topic_starter == $userdata['user_id'] || $userdata['user_level'] == ADMIN || $userdata['user_level'] == MOD )
Remove "$forum_topic_data" portion from "viewtopic.php" code:

Code: Select all

$bump_topic = ( $userdata['session_logged_in'] && $forum_topic_data['topic_poster'] == $userdata['user_id'] || $userdata['user_level'] == ADMIN || $userdata['user_level'] == MOD ) ? '<a href="' . $topic_bump_url . '" onclick="window.open(\'' . $topic_bump_url . '\', \'_bump\', \'height=120,resizable=no,scrollbars=no,width=290\');return false;"  target="_bump"><img src="' . $images['bump'] . '" alt="' . $lang['Bump'] . '" title="' . $lang['Bump'] . '" border="0" align="middle" /></a>' : '';
:wink:


Do you remove that whole line, or only the line in the quotes?
User avatar
cardude
Registered User
Posts: 67
Joined: Sat May 07, 2005 2:06 am

Post by cardude »

I tried to install this without removing those lines of code first, and when I try to view a topic, I get an error -

Code: Select all

Parse error: parse error, unexpected '[' in /usr/export/www/hosting/myforum/forum/viewtopic.php on line 629
EDIT: I got it, but I still have the question about the MOD/Admin code above.
User avatar
vrflyer
Registered User
Posts: 503
Joined: Mon Feb 17, 2003 8:27 pm

Post by vrflyer »

cardude wrote: EDIT: I got it, but I still have the question about the MOD/Admin code above.


You remove this:

Code: Select all

$topic_starter == $userdata['user_id'] || 
and...

Code: Select all

$forum_topic_data['topic_poster'] == $userdata['user_id'] || 
FYI: Watch your spacing,s after code removal... :wink:
Always Under Construction !
Joe Belmaati
Registered User
Posts: 2110
Joined: Sun Sep 28, 2003 7:35 pm
Location: Denmark

Post by Joe Belmaati »

Sorry for not responding. For some reason I was not getting email updates for this topic. Looks like you all have it covered, though.
Image
User avatar
vrflyer
Registered User
Posts: 503
Joined: Mon Feb 17, 2003 8:27 pm

Post by vrflyer »

Joe Belmaati wrote: Looks like you all have it covered, though.


Actually I found a BUG...

If you BUMP a topic that already has more than 5 or 10 pages, this will cause a pagination issue
which will lead to an error: "Topic does NOT exist".

To "FIX" this issue temporarly, you have to delete/remove the BUMPS made via ACP.

:wink:
Always Under Construction !
User avatar
vrflyer
Registered User
Posts: 503
Joined: Mon Feb 17, 2003 8:27 pm

Post by vrflyer »

^^^ Is this going to be looked at so it can be fixed ? :lol:
Always Under Construction !
fastbuck
Registered User
Posts: 20
Joined: Wed Sep 17, 2003 10:07 pm
Contact:

Post by fastbuck »

this looks like a great mod and would be really helpful on my forum. just two questions: i would like have it so nobody else other than the topic starter, the mod and the admin can bump a thread (don't know if this option is in the newest version because you only say that these are the only ones that can use auto bump but I want this restriction with the normal bump also). another thing I would need is the bump only for one of my subforums. so can I restrict the mod by forum_id?

thx for any support.
fastbuck
Registered User
Posts: 20
Joined: Wed Sep 17, 2003 10:07 pm
Contact:

Post by fastbuck »

sorry to bump this but does anyone know what I would need to change so this mod only works on one of my forums (doesn't need to be changable via the acp, a small forum_id hack into the code would do.
unfortunately the author didn't answer my pm.
Joe Belmaati
Registered User
Posts: 2110
Joined: Sun Sep 28, 2003 7:35 pm
Location: Denmark

Post by Joe Belmaati »

Hi, sorry I wasn't getting email updates for this topic.

OPEN viewtopic.php

FIND

Code: Select all

$bump_topic = ( $userdata['session_logged_in'] && $forum_topic_data['topic_poster'] == $userdata['user_id'] || $userdata['user_level'] == ADMIN || $userdata['user_level'] == MOD ) ? '<a href="' . $topic_bump_url . '" onclick="window.open(\'' . $topic_bump_url . '\', \'_bump\', \'height=120,resizable=no,scrollbars=no,width=290\');return false;"  target="_bump"><img src="' . $images['bump'] . '" alt="' . $lang['Bump'] . '" title="' . $lang['Bump'] . '" border="0" align="middle" /></a>' : '';
REPLACE WITH

Code: Select all

if ( $forum_id == 1 || $forum_id == 2 )
{
	$bump_topic = ( $userdata['session_logged_in'] && $forum_topic_data['topic_poster'] == $userdata['user_id'] || $userdata['user_level'] == ADMIN || $userdata['user_level'] == MOD ) ? '<a href="' . $topic_bump_url . '" onclick="window.open(\'' . $topic_bump_url . '\', \'_bump\', \'height=120,resizable=no,scrollbars=no,width=290\');return false;"  target="_bump"><img src="' . $images['bump'] . '" alt="' . $lang['Bump'] . '" title="' . $lang['Bump'] . '" border="0" align="middle" /></a>' : '';
}
Image
fastbuck
Registered User
Posts: 20
Joined: Wed Sep 17, 2003 10:07 pm
Contact:

Post by fastbuck »

thanks that works great.
But I can't get it to work so that topic starters can bump their topic. it's working for mods and admins but the topic starters can't get the bump button. maybe it's because of your security measures and the way session management did change with new versions of phpBB. I'm using 2.18 btw.
Joe Belmaati
Registered User
Posts: 2110
Joined: Sun Sep 28, 2003 7:35 pm
Location: Denmark

Post by Joe Belmaati »

Not sure why. The code is there to ensure it. All I can think is that you're allowing anonymous posting.
Image
User avatar
vrflyer
Registered User
Posts: 503
Joined: Mon Feb 17, 2003 8:27 pm

Post by vrflyer »

^^^ Read up above please, there's a small pagination issue. :wink:
Always Under Construction !
Post Reply

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