#57953
07/28/2002 2:41 PM
|
Joined: Mar 2001
Posts: 172
Member
|
Member
Joined: Mar 2001
Posts: 172 |
|
|
|
#57954
07/28/2002 4:08 PM
|
Joined: Jan 2000
Posts: 15
Junior Member
|
Junior Member
Joined: Jan 2000
Posts: 15 |
OK, I'll bite here.. (HOW LONG has it been since I posted at UBBDev??? ) Try: in ubb_new_reply.cgi (circa line 403 in 6.3.1) # grab last post @rev_this_topic = reverse(@this_topic); @last_post = split (/||/, $rev_this_topic[0]); $last_post_num = $last_post[1]; $last_post_num++; ADD right AFTER it: if ($username eq $lastpost[2]) { &StandardHTML("You cannot reply to this thread again until someone else does."); } Should be all you need. (NOTE: StandardHTML calls exit internally so you don't need it again) (I tried to make it obvious enough over at community without spelling it out.. ) Graeme
|
|
|
#57955
07/28/2002 5:10 PM
|
Joined: Mar 2001
Posts: 172
Member
|
Member
Joined: Mar 2001
Posts: 172 |
Doh! Thanks... Ok, how about expanding on this, if possible, while we're at it. (You didn't think you'd get off so easy, did you? ) Can you insert a timer somewhere that WOULD allow someone to reply to their own post, but only after a certain amount of time passed? Say, 24 hrs... Which would essentially allow one bump every 24 hours. If this would be possible, our users would be overjoyed. Not to mention me.
|
|
|
#57956
07/29/2002 3:09 PM
|
Joined: Mar 2001
Posts: 172
Member
|
Member
Joined: Mar 2001
Posts: 172 |
Anyone? Come on people, I haven't posted a request here yet that someone couldn't hack together... Don't disappoint me.
|
|
|
#57957
07/29/2002 3:56 PM
|
Joined: Mar 2000
Posts: 21,079 Likes: 3
I type Like navaho
|
I type Like navaho
Joined: Mar 2000
Posts: 21,079 Likes: 3 |
It might help if you posts requests in the requests forum, moving there.
|
|
|
#57958
01/29/2005 11:03 PM
|
Joined: Mar 2000
Posts: 21,079 Likes: 3
I type Like navaho
|
I type Like navaho
Joined: Mar 2000
Posts: 21,079 Likes: 3 |
Originally posted by Graeme: OK, I'll bite here.. (HOW LONG has it been since I posted at UBBDev??? ) Try: in ubb_new_reply.cgi (circa line 403 in 6.3.1) # grab last post @rev_this_topic = reverse(@this_topic); @last_post = split (/||/, $rev_this_topic[0]); $last_post_num = $last_post[1]; $last_post_num++; ADD right AFTER it: if ($username eq $lastpost[2]) { &StandardHTML("You cannot reply to this thread again until someone else does."); } Should be all you need. (NOTE: StandardHTML calls exit internally so you don't need it again) (I tried to make it obvious enough over at community without spelling it out.. ) Graeme Any idea why this wouldn't work in 6.7.x?
|
|
|
#57959
01/30/2005 7:02 PM
|
Joined: Jun 2001
Posts: 729
Coder
|
Coder
Joined: Jun 2001
Posts: 729 |
Would like to also see some sort of timer for this. But lets make it admin panel configurable.
Can someone copy this to the request forum?
|
|
|
#57960
01/30/2005 8:14 PM
|
Joined: Mar 2000
Posts: 21,079 Likes: 3
I type Like navaho
|
I type Like navaho
Joined: Mar 2000
Posts: 21,079 Likes: 3 |
done er, copied to request forum
|
|
|
#57961
02/01/2005 8:46 PM
|
Joined: Mar 2000
Posts: 21,079 Likes: 3
I type Like navaho
|
I type Like navaho
Joined: Mar 2000
Posts: 21,079 Likes: 3 |
The reason $lastpost[2] prolly doesn't work is because it should probably be: $last_post[2] I'll try it later and report back
|
|
|
#57962
06/28/2005 8:54 AM
|
Joined: Mar 2001
Posts: 172
Member
|
Member
Joined: Mar 2001
Posts: 172 |
Well, I see getting a timer hasn't progressed anywhere over the years, but I'd still very much like to see it in...
How about at least being able to specify forums where this restriction wouldn't apply; i.e. where people could reply to their own posts freely? Can someone add that?
|
|
|
#57963
06/30/2005 2:58 PM
|
Joined: Mar 2001
Posts: 172
Member
|
Member
Joined: Mar 2001
Posts: 172 |
|
|
|
#57964
06/30/2005 3:52 PM
|
Joined: Jan 2003
Posts: 3,456 Likes: 2
Master Hacker
|
Master Hacker
Joined: Jan 2003
Posts: 3,456 Likes: 2 |
I only had a little time to write this, and even less time to test, but give this a shot. In ubb_new_reply.cgi Find: @last_post = split (/||/, $rev_this_topic[0]); $last_post_num = $last_post[1]; Add after: # Minutes after first reply before we allow a second # Set to 0 to disable time constraints my $time_to_allow_spam = 60; my $allow_staff_bypass = true; if( ( $last_post[11] eq $user_number ) && !( (&is_admin_or_mod($in{f}, @user_profile) eq 'true') && ($allow_staff_bypass == true) ) ) { # Last post was made by same account as this user if( $time_to_allow_spam > 0 ) { $that_unix = &ConvertPostTimeToUnixEpoch( $last_post[3], $last_post[4] ); if( ($GotTime{CurrentEpoch} - ($time_to_allow_spam * 60)) < $that_unix ) { &StandardHTML("I'm sorry, but you cannot make another post without someone replying first, or until $time_to_allow_spam minutes have passed"); } } else { &StandardHTML("I'm sorry, but you cannot make another post without someone replying first."); } } # End no double post mod I added an option to allow staff members to bypass the bump thing, as well as added a timer. I hope this works
|
|
|
#57965
06/30/2005 7:53 PM
|
Joined: Mar 2001
Posts: 172
Member
|
Member
Joined: Mar 2001
Posts: 172 |
That's great... I'll try it tomorrow as I'm off to bed now.
Could you also add being able to specify forums where this restriction wouldn't apply; i.e. where people could reply to their own posts freely?
|
|
|
#57966
07/01/2005 6:55 PM
|
Joined: Jan 2003
Posts: 3,456 Likes: 2
Master Hacker
|
Master Hacker
Joined: Jan 2003
Posts: 3,456 Likes: 2 |
# Begin no double post mod
# Minutes after first reply before we allow a second # Set to 0 to disable time constraints my $time_to_allow_spam = 60; my $allow_staff_bypass = true;
if( ( $last_post[11] eq $user_number ) && !( (&is_admin_or_mod($in{f}, @user_profile) eq 'true') && ($allow_staff_bypass == true) ) && ($in{f} !~ /^(1|3|23)$/i ) ) { # Last post was made by same account as this user if( $time_to_allow_spam > 0 ) { $that_unix = &ConvertPostTimeToUnixEpoch( $last_post[3], $last_post[4] ); if( ($GotTime{CurrentEpoch} - ($time_to_allow_spam * 60)) < $that_unix ) { &StandardHTML("I'm sorry, but you cannot make another post without someone replying first, or until $time_to_allow_spam minutes have passed"); } } else { &StandardHTML("I'm sorry, but you cannot make another post without someone replying first."); } } # End no double post mod Replace "1|3|23" with the numbers of all the forums you want to bypass this filter. Make sure to seperate them with a | (pipe)
|
|
|
#57967
07/02/2005 8:44 AM
|
Joined: Mar 2001
Posts: 172
Member
|
Member
Joined: Mar 2001
Posts: 172 |
You're a legend Ian, I'll try it out ASAP.
|
|
|
#57968
07/02/2005 10:09 AM
|
Joined: Mar 2001
Posts: 172
Member
|
Member
Joined: Mar 2001
Posts: 172 |
Actually, heh... what was originally posted in this thread (in 2002) never worked. I was looking through my files and noticed that I installed this instead: ################################################## # Title: No Double Posting by Username or IP Hack # Author: Ben (Phoenix-Flame/PF) # Email: [email protected] # Date: 6th April 2002 # # # Files Modified: # ubb_new_reply.cgi # vars_wordlets_err.cgi # # Disclaimer: # Simple: You can't blame/sue me for anything whilst using (or trying to use) this hack. ###########################
############# # # In vars_wordlets_err.cgi # # Find: ##
invalid_number => "You have entered a value that is not a number for:",
## # Add these after it ##
double_post_user => "Sorry, we do not allow double posting, please use the edit button to add to your previous message.", double_post_ip => "Sorry, someone using the same IP address as you was the last person to post in this message",
## # Save and Upload ##############
############# # # In ubb_new_reply.cgi # # Find:
if ($vars_misc{FloodCheck} eq 'ON') { # floodcheck courtesy of Michael Farris chomp($user_profile[8]); &floodcheck unless (($user_profile[8] eq 'Administrator') || ($user_profile[8] eq 'MegaModerator') || ($user_profile[8] eq 'Moderator')); } ## # or (if MegaMod hack isn't installed) ##
if ($vars_misc{FloodCheck} eq 'ON') { # floodcheck courtesy of Michael Farris chomp($user_profile[8]); &floodcheck unless (($user_profile[8] eq 'Administrator') || ($user_profile[8] eq 'Moderator')); } ## # Add this afterwards (remove the MegaMod part if you dont have the MegaMod hack installed) ##
# grab topic (a bit earlier now) ;) @this_topic = &OpenTopic($in{t}, $in{f});
# grab last post (a bit earlier now) ;) @rev_this_topic = reverse(@this_topic); @last_post = split(/||/, $rev_this_topic[0]);
if ($username eq $last_post[2]) { &StandardHTML("$vars_wordlets_err{double_post_user}") unless (($user_profile[8] eq 'Administrator') || ($user_profile[8] eq 'MegaModerator') || ($user_profile[8] eq 'Moderator') || (length($last_post[6]) > 10000)); } else { if ($ip_number eq $last_post[7]) { &StandardHTML("$vars_wordlets_err{double_post_ip}") unless (($user_profile[8] eq 'Administrator') || ($user_profile[8] eq 'MegaModerator') || ($user_profile[8] eq 'Moderator')); } }
## # Find and Remove ##
# grab topic @this_topic = &OpenTopic($in{t}, $in{f});
## # Find and Remove ##
# grab last post @rev_this_topic = reverse(@this_topic); @last_post = split(/||/, $rev_this_topic[0]);
## # Save and Upload ##############
# And you're all done Which works for 6.3 all the way up to the latest (you just remove some more code now). I only modified it for my own use to remove the IP check (and MegaMod and post length stuff), because it did more harm than good. It actually let people reply to their own posts from time to time, so I took it out and no problems since. Does this change anything? I notice that this older mod removes 2 more chunks of code than yours Ian... but then it also goes in differently. I don't need the text in wordlets or anything, just wondering.
|
|
|
#57969
07/06/2005 1:58 PM
|
Joined: Mar 2001
Posts: 172
Member
|
Member
Joined: Mar 2001
Posts: 172 |
|
|
|
#57970
07/06/2005 2:33 PM
|
Joined: Jan 2003
Posts: 3,456 Likes: 2
Master Hacker
|
Master Hacker
Joined: Jan 2003
Posts: 3,456 Likes: 2 |
it almost definitely changes it, try undoing that and installing my code
|
|
|
#57971
07/06/2005 3:59 PM
|
Joined: Mar 2001
Posts: 172
Member
|
Member
Joined: Mar 2001
Posts: 172 |
Actually, I was just wondering about the 2 extra chunks of code in the file modified by the old hack, but not by your own. This is what I meant:
### Find and Remove### grab topic@this_topic = &OpenTopic($in{t}, $in{f});
### Find and Remove### grab last post@rev_this_topic = reverse(@this_topic);@last_post = split(/||/, $rev_this_topic[0]);
--
I'm installing your hack now, just wondering what that was for in the old one, since I noticed you don't touch that in your hack.
|
|
|
#57972
07/06/2005 8:09 PM
|
Joined: Jan 2003
Posts: 3,456 Likes: 2
Master Hacker
|
Master Hacker
Joined: Jan 2003
Posts: 3,456 Likes: 2 |
it just seems that the previous person was moving things around, as those lines were apparently added back in other steps.
|
|
|
#57973
07/07/2005 6:10 AM
|
Joined: Mar 2001
Posts: 172
Member
|
Member
Joined: Mar 2001
Posts: 172 |
Ah, thanks. I hope to finally get around to applying this hack today, this week has been unbelievable... every time I sat down to do something, I ended up having to do something completely other, until I had no time left.
|
|
|
#57974
07/08/2005 8:38 PM
|
Joined: Mar 2001
Posts: 172
Member
|
Member
Joined: Mar 2001
Posts: 172 |
Installed, and working perfectly, as far as I can see. Thanks a bunch!
|
|
|
#57975
07/08/2005 8:46 PM
|
Joined: Mar 2001
Posts: 172
Member
|
Member
Joined: Mar 2001
Posts: 172 |
Btw, would a time limit larger than one day present any problems or anything? I have it at 1440 minutes now (24 hours), but might extend it, so I'm wondering.
|
|
|
#57976
07/12/2005 7:56 PM
|
Joined: Mar 2001
Posts: 7,394
Admin / Code Breaker
|
Admin / Code Breaker
Joined: Mar 2001
Posts: 7,394 |
I'd say in 99.9% it shouldn't cause any problem.
|
|
|
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.
|
|
Posts: 449
Joined: February 2008
|
|
Forums63
Topics37,573
Posts293,925
Members13,849
|
Most Online5,166 Sep 15th, 2019
|
|
Currently Online
Topics Created
Posts Made
Users Online
Birthdays
|
|
|
|