vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 4.x Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=245)
-   -   Moderators Functions - Be able to ban users for a certain number of hours (https://vborg.vbsupport.ru/showthread.php?t=299346)

Fatal Hazard 06-20-2013 10:00 PM

Be able to ban users for a certain number of hours
 
1 Attachment(s)
Be able to ban users for a certain number of hours
[LEFT]
Template Edit Description:

This is an edit of the /modcp/banning.php file.
It allows you to ban users for a certain number of hours (you choose).
Difficulty: Easy

Step 1:

Open modcp/banning.php in an editor of your choice, for this tutorial I will be using Notepad ++.

On line 261 find the code:
PHP Code:

// check that the number of days is valid    if ($vbulletin->GPC['period'] != 'PERMANENT' AND !preg_match('#^(D|M|Y)_[1-9][0-9]?$#', $vbulletin->GPC['period']))    {        print_stop_message('invalid_ban_period_specified');    } 

Look at the (D|M|Y) code and do this:

PHP Code:

// check that the number of days is valid    if ($vbulletin->GPC['period'] != 'PERMANENT' AND !preg_match('#^(h|D|M|Y)_[1-9][0-9]?$#', $vbulletin->GPC['period']))    {        print_stop_message('invalid_ban_period_specified');    } 

As you can see, I have added the h before it. DON't use a capital H as it will not work.

Step 2:

On line 395 find this code:
PHP Code:

// make a list of banning period options    $periodoptions = array(        $temporary_phrase => array(            'D_1'  => "1 $vbphrase[day]",            'D_2'  => "2 $vbphrase[days]",            'D_3'  => "3 $vbphrase[days]",            'D_4'  => "4 $vbphrase[days]",            'D_5'  => "5 $vbphrase[days]",            'D_6'  => "6 $vbphrase[days]",            'D_7'  => "7 $vbphrase[days]",            'D_10' => "10 $vbphrase[days]",            'D_14' => "2 $vbphrase[weeks]",            'D_21' => "3 $vbphrase[weeks]",            'M_1'  => "1 $vbphrase[month]",            'M_2' => "2 $vbphrase[months]",            'M_3' => "3 $vbphrase[months]",            'M_4' => "4 $vbphrase[months]",            'M_5' => "5 $vbphrase[months]",            'M_6' => "6 $vbphrase[months]",            'Y_1' => "1 $vbphrase[year]",            'Y_2' => "2 $vbphrase[years]",        ), 

Above the 'D_1' => "1 $vbphrase[day]", add:

PHP Code:

'h_1' => "1 $vbphrase[hour]"

</span>
PHP Code:

'h_6' => "6 $vbphrase[hours]"

</span>
PHP Code:

'h_12' => "12 $vbphrase[hours]"

</span>

You can change these to suit you best (or add more).

Amaury 06-21-2013 01:07 PM

Quote:

Originally Posted by Fatal Hazard (Post 2429532)
You have just contradicted yourself. This is so you can ban users for a certain number of hours not days.

Why would you want to ban them in hours, though?

K4GAP 06-21-2013 11:32 PM

Quote:

Originally Posted by Fatal Hazard (Post 2429680)
How is this like default settings when that is in days and this is in hours? Also stop posting here if all you are going to do is hate and be angry. Oh and you did contradict yourself, end of story!

Your site is broke

Fatal Hazard 06-22-2013 08:44 AM

Quote:

Originally Posted by GaryT (Post 2429685)
Your site is broke

Oh yeah, sorry about that, I used it as a test site but it got overun by spam. I am installing vB 4 on it soon and might try to start a new forum :)

djbaxter 06-22-2013 12:34 PM

If you need something like this, there's a better option with no core file edits at Daily Short Term Banning by BOP5 (Ban users during part of the day or night).

skol 06-22-2013 02:13 PM

Quote:

Originally Posted by djbaxter (Post 2429741)
If you need something like this, there's a better option with no core file edits at Daily Short Term Banning by BOP5 (Ban users during part of the day or night).

Both look different to me..The one you posted,you have to set the physical time for the ban and very useful for knocking them off on a recurring basis at specific times..Were as this mod seems to be fine for using as an immediate cooling off period but not with the harshness of a severe ban.
Just more friendlier banning options for yourself and your staff to use.If both work together you have the best of both worlds..

djbaxter 06-22-2013 04:18 PM

Quote:

Originally Posted by skol (Post 2429756)
Both look different to me..The one you posted,you have to set the physical time for the ban and very useful for knocking them off on a recurring basis at specific times..Were as this mod seems to be fine for using as an immediate cooling off period but not with the harshness of a severe ban.
Just more friendlier banning options for yourself and your staff to use.If both work together you have the best of both worlds..

The one I posted does not have to ban the member - for example, it can be used to move him temporarily to a post-moderation group during times when moderators and admins are less likely to be online.

Fatal Hazard 06-23-2013 10:36 PM

As skol pointed out, this is mainly to be used if a member is say trying to be annoying just to frustrate staff then you can just block them for say 1 hour or so.

K4GAP 06-25-2013 01:09 AM

Quote:

Originally Posted by Fatal Hazard (Post 2430084)
As skol pointed out, this is mainly to be used if a member is say trying to be annoying just to frustrate staff then you can just block them for say 1 hour or so.

If they are trying to be annoying why would you want them back a couple of hours later?

Ban'em, punch'em, hunt'em down and pee on their front porch!! :D


All times are GMT. The time now is 01:10 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
  • Page Generation 0.01155 seconds
  • Memory Usage 1,750KB
  • 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
  • (6)bbcode_php_printable
  • (6)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (9)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
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete