Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 2.x > vBulletin 2.x Full Releases

Reply
 
Thread Tools
User Thread Banning (Includes Time Banning Feature) Details »»
User Thread Banning (Includes Time Banning Feature)
Version: 1.00, by John John is offline
Developer Last Online: Nov 2023 Show Printable Version Email this Page

Version: 2.3.x Rating:
Released: 03-20-2003 Last Update: Never Installs: 19
 
No support by the author.

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.

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #32  
Old 05-03-2003, 03:05 AM
Boofo's Avatar
Boofo Boofo is offline
 
Join Date: Mar 2002
Location: Des Moines, IA (USA)
Posts: 15,776
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Today at 08:27 PM Capt PPRuNe said this in Post #30
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.
It would be nice to have just in case, though. I'd like to see it.
Reply With Quote
  #33  
Old 05-05-2003, 03:38 AM
Hobbes's Avatar
Hobbes Hobbes is offline
 
Join Date: Dec 2002
Location: Cali
Posts: 230
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I WOULD LIKE THAT SOLUTION!!!!! lol....please?

i'm getting

PHP Code:
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.iconpathETC 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
: [url]http://forums.squareultima.com/showthread.php?s=&postid=62609#post62609[/url]
Referer: [url]http://forums.squareultima.com/index.php?[/url] 
and i am also getting a blank page in the admin cp
Reply With Quote
  #34  
Old 05-12-2003, 10:51 AM
John's Avatar
John John is offline
 
Join Date: Mar 2002
Location: Norwich, UK
Posts: 1,543
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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? :\
Reply With Quote
  #35  
Old 05-13-2003, 08:01 AM
Jacko's Avatar
Jacko Jacko is offline
 
Join Date: Mar 2002
Location: UK
Posts: 173
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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..
Reply With Quote
  #36  
Old 05-13-2003, 01:54 PM
Boofo's Avatar
Boofo Boofo is offline
 
Join Date: Mar 2002
Location: Des Moines, IA (USA)
Posts: 15,776
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
05-02-03 at 08:27 PM Capt PPRuNe said this in Post #30
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.
Still waiting for your fix.
Reply With Quote
  #37  
Old 05-13-2003, 01:57 PM
Boofo's Avatar
Boofo Boofo is offline
 
Join Date: Mar 2002
Location: Des Moines, IA (USA)
Posts: 15,776
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Shaolyen, could this be coded to work for forums the same way, too?
Reply With Quote
  #38  
Old 06-03-2003, 04:47 AM
Hobbes's Avatar
Hobbes Hobbes is offline
 
Join Date: Dec 2002
Location: Cali
Posts: 230
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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 ) 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
Reply With Quote
  #39  
Old 06-25-2003, 07:18 AM
Capt PPRuNe's Avatar
Capt PPRuNe Capt PPRuNe is offline
 
Join Date: Mar 2002
Location: UK
Posts: 20
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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:
Replace with:
-----------------------------------------------------------------
$posts=$DB_site->query("
SELECT
thread.postuserid AS puserid,bans.active AS active,post.*,post.username AS postusername,post.ipaddress AS ip,user.*,userfield.*,"
.iif($forum[allowicons],'icon.title as icontitle,icon.iconpath,','')."
attachment.attachmentid,attachment.filename,attachment.visible AS attachmentvisible,attachment.counter
"
.iif($avatarenabled,",avatar.avatarpath,NOT ISNULL(customavatar.avatardata) AS hascustomavatar,customavatar.dateline AS avatardateline","")."
FROM post
"
.iif($forum[allowicons],'LEFT JOIN icon ON icon.iconid=post.iconid','')."
LEFT JOIN user ON user.userid=post.userid
LEFT JOIN userfield ON userfield.userid=user.userid
"
.iif ($avatarenabled,"LEFT JOIN avatar ON avatar.avatarid=user.avatarid
LEFT JOIN thread ON thread.threadid=post.threadid
LEFT JOIN bans ON bans.userid = post.userid AND bans.threadid=post.threadid AND active=1
                       LEFT JOIN customavatar ON customavatar.userid=user.userid"
,"")."
LEFT JOIN attachment ON attachment.attachmentid=post.attachmentid
WHERE 
$postids
ORDER BY dateline 
$postorder
"
);
----------------------------------------------------------------- 
to
PHP Code:
Replace with:
-----------------------------------------------------------------
$posts=$DB_site->query("
SELECT
thread.postuserid AS puserid,bans.active AS active,post.*,post.username AS postusername, post.ipaddress AS ip,user.*,userfield.*,"
.iif($forum[allowicons],'icon.title as icontitle,icon.iconpath,','')."
attachment.attachmentid,attachment.filename,attachment.visible AS attachmentvisible,attachment.counter
"
.iif($avatarenabled,",avatar.avatarpath,NOT ISNULL(customavatar.avatardata) AS hascustomavatar,customavatar.dateline AS avatardateline","")."
FROM post
"
.iif($forum[allowicons],'LEFT JOIN icon ON icon.iconid=post.iconid','')."
LEFT JOIN user ON user.userid=post.userid
LEFT JOIN userfield ON userfield.userid=user.userid
LEFT JOIN thread ON thread.threadid=post.threadid 
LEFT JOIN bans ON bans.userid = post.userid AND bans.threadid=post.threadid AND active=1 
"
.iif ($avatarenabled,"
LEFT JOIN avatar ON avatar.avatarid=user.avatarid
LEFT JOIN customavatar ON customavatar.userid=user.userid"
,"")."
LEFT JOIN attachment ON attachment.attachmentid=post.attachmentid
WHERE 
$postids
ORDER BY dateline 
$postorder
"
);
----------------------------------------------------------------- 
At least that's what fixed it for me. Been running this hack for a few months now and no problems at all with it. Only request would be an feature in the admin CP to prune some of the older bans from the log.
Reply With Quote
  #40  
Old 07-06-2003, 11:17 PM
ImportPassion ImportPassion is offline
 
Join Date: Mar 2002
Location: Gilbert, AZ
Posts: 605
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

there is 2 cpheader functions being called in threadbanadmin.php and it doesn't show the page. so just remove one of them.

D
Reply With Quote
  #41  
Old 07-07-2003, 03:48 PM
ImportPassion ImportPassion is offline
 
Join Date: Mar 2002
Location: Gilbert, AZ
Posts: 605
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
04-04-03 at 05:44 AM Anarchnophobia said this in Post #27
any idea about the blank admin page meanwhile?

i fixed this in the above post.
Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 05:54 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.05610 seconds
  • Memory Usage 2,325KB
  • Queries Executed 25 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (3)bbcode_php
  • (3)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (3)pagenav_pagelink
  • (11)post_thanks_box
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (11)postbit_onlinestatus
  • (11)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete