 |
 |
 |
 |
#57953 - 07/28/02 02:41 PM
[6.3.x] [beta] Preventing Users to Reply to Their Own Posts
|
Member
Registered: 03/29/01
Posts: 148
|
|
|
Top
|
|
|
|
 |
 |
 |
 |
 |
 |
 |
 |
#57954 - 07/28/02 04:08 PM
Re: [6.3.x] [beta] Preventing Users to Reply to Their Own Posts
|
Junior Member
Registered: 01/05/00
Posts: 10
Loc: Canada
|
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
|
|
Top
|
|
|
|
 |
 |
 |
 |
 |
 |
 |
 |
#57958 - 01/29/05 10:03 PM
Re: [6.3.x] [beta] Preventing Users to Reply to Their Own Posts
|
I type Like navaho
Registered: 03/10/00
Posts: 25448
Loc: Texas
|
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?
|
|
Top
|
|
|
|
 |
 |
 |
 |
 |
 |
 |
 |
#57959 - 01/30/05 06:02 PM
Re: [6.3.x] [beta] Preventing Users to Reply to Their Own Posts
|
Coder
Registered: 06/10/01
Posts: 705
Loc: CT
|
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?
_________________________
...Steven Hostboard.com Running UBB v6.1.0.4 Doing what NO other UBB in the world is doing. The first & only production UBB powered by MySQL.
|
|
Top
|
|
|
|
 |
 |
 |
 |
 |
 |
 |
 |
#57963 - 06/30/05 02:58 PM
Re: [6.3.x] [beta] Preventing Users to Reply to Their Own Posts
|
Member
Registered: 03/29/01
Posts: 148
|
|
|
Top
|
|
|
|
 |
 |
 |
 |
 |
 |
 |
 |
#57964 - 06/30/05 03:52 PM
Re: [6.3.x] [beta] Preventing Users to Reply to Their Own Posts
|
Master Hacker
Registered: 01/25/03
Posts: 3765
Loc: Saint Johns, PA
|
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 modI added an option to allow staff members to bypass the bump thing, as well as added a timer. I hope this works
|
|
Top
|
|
|
|
 |
 |
 |
 |
 |
 |
 |
 |
#57968 - 07/02/05 10:09 AM
Re: [6.3.x] [beta] Preventing Users to Reply to Their Own Posts
|
Member
Registered: 03/29/01
Posts: 148
|
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: Phoenix-Flame@ffaddicts.com
# 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 doneWhich 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. 
|
|
Top
|
|
|
|
 |
 |
 |
 |
 |
 |
 |
 |
#57969 - 07/06/05 01:58 PM
Re: [6.3.x] [beta] Preventing Users to Reply to Their Own Posts
|
Member
Registered: 03/29/01
Posts: 148
|
|
|
Top
|
|
|
|
 |
 |
 |
 |
|
|