vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 2.x Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=4)
-   -   User Thread Banning (Includes Time Banning Feature) (https://vborg.vbsupport.ru/showthread.php?t=50585)

dr1 03-21-2003 08:31 PM

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.

Davey 03-22-2003 12:02 AM

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.

Intex 03-22-2003 07:02 AM

V. nice hack. Have marked for installation soon :).

Tim Wheatley 03-22-2003 11:46 AM

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...

John 03-22-2003 12:53 PM

What version of vB?

Zelda-King 03-22-2003 05:06 PM

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.

LeeCHeSSS 03-23-2003 11:21 AM

Getting a blank page on the admin cp list as well, vB 2.3.0 RC2 (or 3?)

LeeCHeSSS 03-24-2003 09:29 AM

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

LeeCHeSSS 03-24-2003 09:45 AM

Ah, figured it out. If anyone is interested, I will post the edits.

The Red Devil 03-24-2003 10:05 AM

LeeCHeSSS, I would be really interested in those edits.


All times are GMT. The time now is 06:14 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01828 seconds
  • Memory Usage 1,768KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (4)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (3)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.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/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.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
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete