Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 2.x > vBulletin 2.x Full Releases
FAQ Community Calendar Today's Posts Search

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
  #22  
Old 03-24-2003, 05:45 PM
ForKmaN's Avatar
ForKmaN ForKmaN is offline
 
Join Date: Jan 2002
Location: Australia
Posts: 119
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Me too, this hack is great.
Reply With Quote
  #23  
Old 03-24-2003, 08:17 PM
VampireMan VampireMan is offline
 
Join Date: Jan 2003
Location: Leicestershire uk
Posts: 102
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Ah-hah this will do me nicely :-)

Im installing now
Reply With Quote
  #24  
Old 03-27-2003, 12:02 PM
Anarchnophobia Anarchnophobia is offline
 
Join Date: Dec 2002
Location: Germany
Posts: 5
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

i?m getting a blank page in admincp too... vb 2.2.9

the rest works fine, thank you
Reply With Quote
  #25  
Old 03-28-2003, 07:06 AM
LeeCHeSSS's Avatar
LeeCHeSSS LeeCHeSSS is offline
 
Join Date: Dec 2001
Posts: 163
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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'])) {
Right BEFORE that, INSERT:
Code:
$threadban=$DB_site->query_first("SELECT COUNT(DISTINCT banid) AS activeban
                                  FROM bans
                                  WHERE userid=$bbuserinfo[userid] AND threadid=$threadid AND active=1
                                 ");
Next, find:
Code:
} else {
        $textareacols = gettextareawidth();
        eval("\$replybox = \"".gettemplate('showthread_replybox')."\";");
}
and right BEFORE that, INSERT:
Code:
} elseif ($threadban[activeban]!=0) {
        $replybox='';
That's it. And for the query freaks: yes it DOES add a query.
Reply With Quote
  #26  
Old 03-28-2003, 07:21 AM
Boofo's Avatar
Boofo Boofo is offline
 
Join Date: Mar 2002
Location: Des Moines, IA (USA)
Posts: 15,776
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

So, use this code instead of what is in post #16 above? What about the editpost?
Reply With Quote
  #27  
Old 03-30-2003, 05:04 AM
LeeCHeSSS's Avatar
LeeCHeSSS LeeCHeSSS is offline
 
Join Date: Dec 2001
Posts: 163
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

This merely hides the quick reply box, smart users could still reply if you do not use the code in post 16.
Reply With Quote
  #28  
Old 04-04-2003, 07:44 AM
Anarchnophobia Anarchnophobia is offline
 
Join Date: Dec 2002
Location: Germany
Posts: 5
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

any idea about the blank admin page meanwhile?
Reply With Quote
  #29  
Old 04-19-2003, 07:07 PM
Capt PPRuNe's Avatar
Capt PPRuNe Capt PPRuNe is offline
 
Join Date: Mar 2002
Location: UK
Posts: 20
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Installed the hack but now getting serious problem. The following code added in showthread.php:
PHP Code:
thread.postuserid AS puserid,bans.active AS active
and
PHP Code:
LEFT JOIN thread ON thread.threadid=post.threadid
LEFT JOIN bans ON bans
.userid post.userid AND bans.threadid=post.threadid AND active=
is causing an SQL error whenever trying to read a thread.

This is the error:
PHP Code:
Database error in vBulletin 2.3.0:

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,
attachment.attachmentid,attachment.filename,attachment.visible AS attachmentvisible,attachment.counter

FROM post
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 attachment ON attachment
.attachmentid=post.attachmentid
WHERE post
.postid IN (0,810719,812243,812549,812889,837671)
ORDER BY dateline 

mysql error
Unknown table 'thread' in field list

mysql error number1109

Date
Saturday 19th of April 2003 07:56:44 PM
Script
: [url]http://www.pprune.org/forums/forums/showthread.php?s=&threadid=85068[/url] 
I have removed the code for the moment and users can read the forums. Now the 'Thread Ban this user' link is still there and it is possible to ban users using the link. What doesn't happen is the link changing to 'Unban' which means mods who don't have access to the CP can't unban a banned user.

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

No experts out there that might be able to explain why
PHP Code:
thread.postuserid AS puserid,bans.active AS active
should cause the sql error
PHP Code:
Unknown table 'thread' in field list 
?

I've checked the structure of the tables and they are all ok.

Help! Please, anyone!
Reply With Quote
  #31  
Old 05-03-2003, 12:27 AM
Capt PPRuNe's Avatar
Capt PPRuNe Capt PPRuNe is offline
 
Join Date: Mar 2002
Location: UK
Posts: 20
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
Reply


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 07:47 PM.


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.07547 seconds
  • Memory Usage 2,327KB
  • 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
  • (4)bbcode_code
  • (5)bbcode_php
  • (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
  • (4)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