Previous Thread
Next Thread
Print Thread
Rate Thread
Joined: Mar 2000
Posts: 21,079
Likes: 3
I type Like navaho
I type Like navaho
Joined: Mar 2000
Posts: 21,079
Likes: 3
Modification Name: Anti-Spam I (No Replies Unless Someone Else Has Replied)

Author(s): AllenAyres

Description: This mod keeps someone from replying to their own post unless someone else has replied first - works great for those ADHD users who repeat nonsense all day long. smile

Demo: none

Requirements: 6.7.2

Download Link: none

Credits: Original Version by Graeme

Open ubb_new_reply.cgi and find:

Code
	# 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 after:

Code
	# Stop Spam Replies
if ($username eq $last_post[2]) {
&StandardHTML("You cannot reply to this thread again until someone else does.");
}
Update, thanks to LK smile

If you still want admins and moderators to be able to reply to their own posts, change the above code to this:

Code
### Stop Spam Replies
@user_profile = &OpenProfile($user_number);
my $is_admin_mod = &boolean_is_admin_or_mod($in{f}, @user_profile);
if ($username eq $last_post[2] && !$is_admin_mod) {
&StandardHTML("You cannot reply to this thread again until someone else does.");
}
###


- Allen wavey
- What Drives You?
Sponsored Links
Joined: Mar 2000
Posts: 21,079
Likes: 3
I type Like navaho
I type Like navaho
Joined: Mar 2000
Posts: 21,079
Likes: 3
Code updated to include the ability for admins and moderators to still be able to reply to their own posts. Thanks LK thumbsup

Future updates will include a time limit before being able to reply. smile


- Allen wavey
- What Drives You?
Joined: May 2001
Posts: 43
User
User
Offline
Joined: May 2001
Posts: 43
Hi, it sounds really usefull, AllenAyres does it work in 6.6.0?

Joined: Mar 2001
Posts: 7,394
LK Offline
Admin / Code Breaker
Admin / Code Breaker
Offline
Joined: Mar 2001
Posts: 7,394
I think it should, try it and let us know smile

Joined: May 2001
Posts: 43
User
User
Offline
Joined: May 2001
Posts: 43
I've tested it on my 6.6.0 and it works, but the message "You cannot reply to this thread again until someone else does" appears right after the user hits "add reply" in the message text box, just imagine this: a user writes a very long message without knowing this and the message appears, it would be better if the message "You cannot reply to this thread again until someone else does" appears right after someone hits the post reply icon instead of being able to see the text box and enter text on it. It's really usefull, but it would be better that way, could it be done?

Sponsored Links
Joined: Mar 2001
Posts: 7,394
LK Offline
Admin / Code Breaker
Admin / Code Breaker
Offline
Joined: Mar 2001
Posts: 7,394
You're right..

Try the following (untested) in ubb_new_reply.cgi:
Find the first instance of:
Code
	# grab topic
@this_topic = &OpenTopic($in{t}, $in{f});
if(!@this_topic) { &StandardHTML($vars_wordlets_err{topic_doesnt_exist}) }
Add below:
Code
	# grab last post
@rev_this_topic = reverse(@this_topic);
@last_post = split (/||/, $rev_this_topic[0]);
# Stop Spam Replies
if ($username eq $last_post[2]) {
&StandardHTML("You cannot reply to this thread again until someone else does.");
}
Another thing you can do is add "$in{message}" into StandardHTML, then the users will be able to see their post when they get the error.


Link Copied to Clipboard
Donate Today!
Donate via PayPal

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.
Recommended Hosts
We have personally worked with and recommend the following Web Hosts:
Stable Host
bluehost
InterServer
Visit us on Facebook
Member Spotlight
Bill B
Bill B
Issaquah, WA
Posts: 87
Joined: December 2001
Forum Statistics
Forums63
Topics37,573
Posts293,925
Members13,849
Most Online5,166
Sep 15th, 2019
Today's Statistics
Currently Online
Topics Created
Posts Made
Users Online
Birthdays
Top Posters
AllenAyres 21,079
JoshPet 10,369
LK 7,394
Lord Dexter 6,708
Gizmo 5,833
Greg Hard 4,625
Top Posters(30 Days)
Top Likes Received
isaac 82
Gizmo 20
Brett 7
WebGuy 2
Morgan 2
Top Likes Received (30 Days)
None yet
The UBB.Developers Network (UBB.Dev/Threads.Dev) is ©2000-2024 VNC Web Services

 
Powered by UBB.threads™ PHP Forum Software 8.0.0
(Preview build 20221218)