![]() |
User Thread Banning (Includes Time Banning Feature)
User Thread Banning (Includes Time Banning Feature)
By Shaolyen email: John@eovie.com msn: John@eovie.com Brief intro: ------------------------ This hack enables mods, supermods and administrators to ban users from viewing OR just replying to specific threads. It also allows users to be banned from threads for specified amount of time. After this time has expired, they will gain access/be able to post again. It adds a small link underneath the "Posts: #" in the postbit template. Providing the user who posted did not start the thread, a "[Thread Ban This User]" link will appear. (Only to mods, super mods and admins.) For users who are already banned from a thread, an "[Unban This User]" link will appear. Forum leaders cannot be banned from threads. (The link will not appear in their posts.) When a forum leader clicks on the "[Thread Ban This User]" link, they are taken to another page where they can: a) choose whether the user can read the thread, or just not reply to it. b) choose the length of the user's ban (in days). c) type in a reason for the user's thread ban. This is displayed when the user tried to access or reply to the thread. When a user tries to access a thread or reply to one when banned, the error message will provide a link to send a PM to the moderator who banned them. This is something that some people might not like - but if they're too scared to own up and explain why they banned the user from the thread in the first place, maybe they shouldn't be moderating! (If it really bothers some people, I can provide them with the lines of code they need to find and delete.) A new page in the AdminCP will allow the admin to check all of the current bans, as well as view archived ones. The reason for the ban will be displayed in the Admin CP when the cursor passes over the "Reason" link. Enjoy. :) |
Screenshots:
|
Awesome hack John! Such a brilliant idea :)
- miSt |
Thanks Mist -
Just a quick note, this has been tested on vB 2.3.0 only as of yet. |
Very cool hack...thanks John!! :)
|
<a href="https://vborg.vbsupport.ru/showthread.php?s=&threadid=48773" target="_blank">https://vborg.vbsupport.ru/showt...threadid=48773</a>
I requested it there a long time ago, MUG posted a version of it, but it didn't have the features which Dan_UPC was going to add into it, however he's just gone somewhere now... So i'm glad someone has released it finally, well done John. |
Wow, this was requested a while ago (By N9ne :)). I saw it but never really thought it would be necessary. It does look cool though, and since seeing his request, there have been a few times that I came back here to see if anyone had released it because I needed it at the time. Right now I have all my "problems" straightened out though, but rest assured next time someone needs to be banned from a specific thread, I'll install this. Just have some others that I have to get to first.
Do you know how many queries (if any) this adds to non-thread banned users? Any? Does it add any to anyone? Just wondering. |
lol, people always ask about extra queries, and I wonder how many people have actually had a problem with too many queries actually slowing down their board. (Now I've said that, I'm sure people will start giving me examples!)
As far as I can remember (I wrote this hack a week or two ago), it adds 1 query to showthread.php and one to forumdisplay.php - if any at all. |
Show me a board with the itemshop hack and I'll show you a depressed server. :)
Hmm... I know it can be done fairly easily without any queries... Well, that is without the time ban added to it, at least. Nice job. :) |
The actual ban is query free.
The query is used to check whether the user's time ban is over or not. |
Great hack! I have been using it for almost a week now :) Easy to install and puts those more "vocal" people on your board in check.
|
What about mods/admins holding a grudge?
You said the link doesnt appear in the admin/mod/supermod postbit, but what if the mod/admin/supermod copies another link and changes certain aspects of it to suit the banning of a mod? Is this exploitable? I haven't downloaded it yet, but the way you explained that part makes me belive that feature can be exploited. Dave. |
V. nice hack. Have marked for installation soon :).
|
I'm getting a blank page on the list in the admin cp and the link isn't changing to unban when I've banned someone in postbit. I've installed a fair few hacks, I don't think I did much wrong...
|
What version of vB?
|
Nice hack. Just a few observations;
1) In the threadban_noreply template you are missing the word 'to' in the TB1.0-Inst file. It reads You have been banned $tempban from replying this thread... 2) Reply bans don't work with Quick Reply (and many people have that hack installed). To fix this, in newreply.php, find PHP Code:
PHP Code:
3) It would be nice if you could prune archived bans and perhaps also back them up (put them under backup database options). 4) Users can still edit posts. If you want to have them not be able to edit posts insert the hack in editpost.php like so; below PHP Code:
PHP Code:
For the record I have this running on vB 2.2.9 just fine. |
Getting a blank page on the admin cp list as well, vB 2.3.0 RC2 (or 3?)
|
I'm trying to hide the quick reply box when a user is reply-banned, but as usual, the mysql query is causing me troubles :)
EDIT: removed the not working code to avoid confusion |
Ah, figured it out. If anyone is interested, I will post the edits.
|
LeeCHeSSS, I would be really interested in those edits.
|
Me too, this hack is great.
|
Ah-hah this will do me nicely :-)
Im installing now :) |
i?m getting a blank page in admincp too... vb 2.2.9
the rest works fine, thank you :) |
Ok, how to hide the quick reply box when a user is reply-banned:
In showthread.php find: Code:
if (($bbuserinfo['userid']!=$thread['postuserid']) and (!$getperms['canviewothers'] or !$getperms['canreplyothers'])) { Code:
$threadban=$DB_site->query_first("SELECT COUNT(DISTINCT banid) AS activeban Code:
} else { Code:
} elseif ($threadban[activeban]!=0) { |
So, use this code instead of what is in post #16 above? What about the editpost? ;)
|
This merely hides the quick reply box, smart users could still reply if you do not use the code in post 16.
|
any idea about the blank admin page meanwhile?
|
Installed the hack but now getting serious problem. The following code added in showthread.php:
PHP Code:
PHP Code:
This is the error: PHP Code:
Any suggestions would be helpful. I did have a problem running the SQL Query. It was generating an error so I ran the query without line breaks and it ran successfully. :disappointed: |
No experts out there that might be able to explain why
PHP Code:
PHP Code:
I've checked the structure of the tables and they are all ok. Help! Please, anyone! |
Problem fixed. I don't have avatars enabled on my forums and the sql code you wrote assumes that everyone has avatars enabled. No one else has reported this problem because I assume they all have avatars enabled.
If anyone needs the solution make a request on here. |
Quote:
|
I WOULD LIKE THAT SOLUTION!!!!! lol....please?
i'm getting PHP Code:
|
Sorry everyone, I've been away for a while and I didn't have access to vb.org - now I'm back, what are the main issues with this hack? Is it installing well for most people? :\
|
shaolyen.
EXCELLENT HACK, works great on my local board.. 1 thing i would like to request though. i am after this kind of hack is it possible to incorporate a users ban as a forum wide ban not just a specific Thread ban?? say have a second ban feature to ban a user for a timed amount to every thread on the forum.. alow them to read just not reply.. |
Quote:
|
Shaolyen, could this be coded to work for forums the same way, too?
|
I still have this error in the query
[sql]Database error in vBulletin 2.2.6: Invalid SQL: SELECT thread.postuserid AS puserid,bans.active AS active,post.*,post.username AS postusername,post.ipaddress AS ip,user.*,userfield.*,icon.title as icontitle,icon.iconpath, ETC ETC mysql error: You have an error in your SQL syntax near 'LEFT JOIN thread ON thread.threadid=post.threadid LEFT JOIN bans ON bans.userid ' at line 8 mysql error number: 1064 Date: Sunday 04th of May 2003 11:50:14 PM Script: <a href="http://forums.squareultima.com/showthread.php?s=&postid=62609#post62609" target="_blank">http://forums.squareultima.com/show...62609#post62609</a> Referer: <a href="http://forums.squareultima.com/index.php?" target="_blank">http://forums.squareultima.com/index.php?</a> [/sql] and i tried installign this in a fresh 2.2.6 (jus shoot meh :p) and now the admin cp link is blank.... help? Everything else worked fine, I can ban users etc.....link is jus blank in admin cp...(note: this is on a fresh 2.2.6).... help? ditto that boofo....fix would be nice....*cries*....i really like this hack and would lovve it to work :( |
Sorry for the delay in getting back to you but been away. Anyway, in the original hack under "2. FILE EDITS" the "Replace With" should be changed from:
PHP Code:
PHP Code:
|
there is 2 cpheader functions being called in threadbanadmin.php and it doesn't show the page. so just remove one of them.
D |
Quote:
i fixed this in the above post. |
All times are GMT. The time now is 04:44 PM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|