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

 
 
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
  #12  
Old 03-21-2003, 08:31 PM
dr1 dr1 is offline
 
Join Date: Nov 2001
Posts: 27
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #13  
Old 03-22-2003, 12:02 AM
Davey Davey is offline
 
Join Date: Nov 2002
Location: England
Posts: 383
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #14  
Old 03-22-2003, 07:02 AM
Intex Intex is offline
 
Join Date: Apr 2002
Posts: 576
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

V. nice hack. Have marked for installation soon .
Reply With Quote
  #15  
Old 03-22-2003, 11:46 AM
Tim Wheatley's Avatar
Tim Wheatley Tim Wheatley is offline
 
Join Date: Nov 2001
Location: England
Posts: 489
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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...
Reply With Quote
  #16  
Old 03-22-2003, 12:53 PM
John's Avatar
John John is offline
 
Join Date: Mar 2002
Location: Norwich, UK
Posts: 1,543
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

What version of vB?
Reply With Quote
  #17  
Old 03-22-2003, 05:06 PM
Zelda-King's Avatar
Zelda-King Zelda-King is offline
 
Join Date: Nov 2002
Location: London, England
Posts: 674
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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:
$lastpost $DB_site->query_first("SELECT * FROM post WHERE threadid = '$threadid' ORDER BY postid DESC");
      if(
$lastpost[userid]!=$bbuserinfo[userid] || (time()-$lastpost[dateline])>3600 || ($attachmentid and !$foruminfo[moderateattach])) {
            
$lastpost $DB_site->query_first("SELECT * FROM post WHERE threadid = '$threadid' ORDER BY postid DESC");
      if(
$lastpost[userid]!=$bbuserinfo[userid] || (time()-$lastpost[dateline])>3600 || ($attachmentid and !$foruminfo[moderateattach])) { 
and underneath, add
PHP Code:
//##########Thread ban##########
$bans=$DB_site->query("SELECT * FROM bans WHERE threadid='$threadid' AND active=1");
while (
$ban=$DB_site->fetch_array($bans)) {

if (
$bbuserinfo[userid] == $ban[userid]) {

$modds=$DB_site->query_first("SELECT username FROM user WHERE userid='$ban[mod]'");
$ban[reason] = stripslashes($ban[reason]);

if (
$ban[reason] == "") {
$ban[reason] = "No reason given.";
}

if (
$ban[banlength] != 0) {
$tempban "temporarily";
$currenttime mktime();
if (
$currenttime > ($ban[banlength] + $ban[banstart])) {
    
$updexe=$DB_site->query("UPDATE bans SET active=0 WHERE userid=$bbuserinfo[userid] AND threadid='$threadid'");
    
$headercont "location:./newreply.php?s=$session[sessionhash]&threadid=$threadid&action=newreply";
    @
header($headercont);
}
}

$reasonpre "<br><smallfont><b>Reason for ban:</b> $ban[reason]</smallfont>";

    eval(
"standarderror("".gettemplate("threadban_noreply")."");");
    exit;
}

. I merely pasted the code here from the hack.

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:
 }
      }
    }
  }
}

$foruminfo=getforuminfo($threadinfo[forumid]); 
insert
PHP Code:
$bans=$DB_site->query("SELECT * FROM bans WHERE threadid='$threadid' AND active=1");
while (
$ban=$DB_site->fetch_array($bans)) {

if (
$bbuserinfo[userid] == $ban[userid]) {

$modds=$DB_site->query_first("SELECT username FROM user WHERE userid='$ban[mod]'");
$ban[reason] = stripslashes($ban[reason]);

if (
$ban[reason] == "") {
$ban[reason] = "No reason given.";
}

if (
$ban[banlength] != 0) {
$tempban "temporarily";
$currenttime mktime();
if (
$currenttime > ($ban[banlength] + $ban[banstart])) {
    
$updexe=$DB_site->query("UPDATE bans SET active=0 WHERE userid=$bbuserinfo[userid] AND threadid='$threadid'");
    
$headercont "location:./newreply.php?s=$session[sessionhash]&threadid=$threadid&action=newreply";
    @
header($headercont);
}
}

$reasonpre "<br><smallfont><b>Reason for ban:</b> $ban[reason]</smallfont>";

    eval(
"standarderror("".gettemplate("threadban_noreply")."");");
    exit;
}

. Even with all that though, it's possible for users to post if they just posted before and their double post is merged (when you have that 'anti-double post' hack).

For the record I have this running on vB 2.2.9 just fine.
Reply With Quote
  #18  
Old 03-23-2003, 11:21 AM
LeeCHeSSS's Avatar
LeeCHeSSS LeeCHeSSS is offline
 
Join Date: Dec 2001
Posts: 163
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Getting a blank page on the admin cp list as well, vB 2.3.0 RC2 (or 3?)
Reply With Quote
  #19  
Old 03-24-2003, 09:29 AM
LeeCHeSSS's Avatar
LeeCHeSSS LeeCHeSSS is offline
 
Join Date: Dec 2001
Posts: 163
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Reply With Quote
  #20  
Old 03-24-2003, 09:45 AM
LeeCHeSSS's Avatar
LeeCHeSSS LeeCHeSSS is offline
 
Join Date: Dec 2001
Posts: 163
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Ah, figured it out. If anyone is interested, I will post the edits.
Reply With Quote
  #21  
Old 03-24-2003, 10:05 AM
The Red Devil The Red Devil is offline
 
Join Date: Mar 2003
Posts: 12
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

LeeCHeSSS, I would be really interested in those edits.
Reply With Quote
 


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:05 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.04570 seconds
  • Memory Usage 2,334KB
  • 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_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
  • (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