Go Back   vb.org Archive > vBulletin Modifications > vBulletin 4.x Modifications > vBulletin 4.x Add-ons
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Be able to ban users for a certain number of hours Details »»
Be able to ban users for a certain number of hours
Version: 1.00, by Fatal Hazard Fatal Hazard is offline
Developer Last Online: Nov 2023 Show Printable Version Email this Page

Category: Moderators Functions - Version: 4.2.1 Rating:
Released: 06-20-2013 Last Update: Never Installs: 7
Template Edits
Re-useable Code  
No support by the author.

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

Show Your Support

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

Comments
  #2  
Old 06-21-2013, 01:07 PM
Amaury Amaury is offline
 
Join Date: Nov 2011
Location: Ellensburg, WA
Posts: 1,075
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Fatal Hazard View Post
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?
Reply With Quote
  #3  
Old 06-21-2013, 11:32 PM
K4GAP K4GAP is offline
 
Join Date: Mar 2008
Posts: 1,255
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Fatal Hazard View Post
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
Reply With Quote
  #4  
Old 06-22-2013, 08:44 AM
Fatal Hazard's Avatar
Fatal Hazard Fatal Hazard is offline
 
Join Date: Oct 2012
Location: Southampton, UK
Posts: 100
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by GaryT View Post
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
Reply With Quote
  #5  
Old 06-22-2013, 12:34 PM
djbaxter djbaxter is offline
 
Join Date: Aug 2006
Location: Ottawa, Canada
Posts: 2,601
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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).
Reply With Quote
  #6  
Old 06-22-2013, 02:13 PM
skol skol is offline
 
Join Date: Oct 2008
Posts: 250
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by djbaxter View Post
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..
Reply With Quote
  #7  
Old 06-22-2013, 04:18 PM
djbaxter djbaxter is offline
 
Join Date: Aug 2006
Location: Ottawa, Canada
Posts: 2,601
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by skol View Post
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.
Reply With Quote
  #8  
Old 06-23-2013, 10:36 PM
Fatal Hazard's Avatar
Fatal Hazard Fatal Hazard is offline
 
Join Date: Oct 2012
Location: Southampton, UK
Posts: 100
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #9  
Old 06-25-2013, 01:09 AM
K4GAP K4GAP is offline
 
Join Date: Mar 2008
Posts: 1,255
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Fatal Hazard View Post
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!!
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 02:23 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.04831 seconds
  • Memory Usage 2,318KB
  • 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
  • (6)bbcode_php
  • (6)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (4)navbar_link
  • (120)option
  • (9)post_thanks_box
  • (9)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (9)post_thanks_postbit_info
  • (8)postbit
  • (9)postbit_onlinestatus
  • (9)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_postinfo_query
  • fetch_postinfo
  • 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
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete