vBulletin SEO Forums

SEO

vBulletin Search Engine Optimization

Buy vBSEO Now! HACKER SAFE certified sites prevent over 99.9% of hacker crime.
Go Back   vBulletin SEO Forums > Blogs > Danny Bembibre, Crawlability Inc.

Enhancing 80 million pages.

Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Pensamientos al azar acerca de vBSEO y www.bmwfaq.com
Rate this Entry

Plugin restrict search when server load is high

Posted 10-24-2007 at 09:43 AM by Danny Bembibre
This is a old plugin that i make in the earling times of vBulletin 3.5

This plugin allow to you disable searches when the load average reaches a defined level.
  • Can exclude user groups of the search restriction
  • Users with search restricted can use google integrated search (by the plugin)
The code
PHP Code:
 
     $Groupids 
explode(','$vbulletin->options['Allowed_Groups']);
 
     if(
is_member_of($vbulletin->userinfo$Groupids))
     {
      
$SearchAllowed true;
     }
    
//$SearchAllowed = is_member_of($vbulletin->userinfo, explode(',',$vbulletin->options['Allowed_Groups'])) ? true : false;
 
    
if (!$SearchAllowed)
    {
 
      if (
$load = @file_get_contents("/proc/loadavg"))  //standard linux style
       
$loadavg explode(' '$load);  
      elseif (
$load=@exec('uptime'))  //unix style
       
preg_match('/averages?: ([0-9.]+),[s]+([0-9.]+),[s]+([0-9.]+)/',$load$loadavg);
      elseif (
$load = @`sysctl vm.loadavg|cut -d" " -f3-5`) //BSD style
       
$loadavg explode(' '$load);  
 
      if (
trim($loadavg[0]) > $search_load)  
      {
        
$navbits construct_navbits($navbits);
               eval(
'$navbar = "' fetch_template('navbar') . '";');
               eval(
'print_output("' fetch_template('Danny_Restrict') . '");');
      }
     } 
The plugin work with linux, freeBSD and unix servers not in WINDOWS.
Be sure that you allow access to /proc/loadavg in open_basedir in php.ini

INSTALL

Simply install as product and go to ACP->Restrict Search Config and put a load value.

SCREENSHOTS

Attached Thumbnails
Click image for larger version

Name:	plugin1.jpg
Views:	40
Size:	43.7 KB
ID:	7  Click image for larger version

Name:	plugin2.jpg
Views:	50
Size:	52.4 KB
ID:	8  Click image for larger version

Name:	plugin3.jpg
Views:	49
Size:	120.8 KB
ID:	9  
Attached Files
File Type: xml product-RestrictSearchs.xml (8.2 KB, 104 views)
Posted in BMW FAQ Club, Php
Comments 2 Email Blog Entry
Total Comments 2

Comments

Old
Oleg Ignatiuk's Avatar
Thank you for contribution!
permalink
Posted 10-25-2007 at 10:09 PM by Oleg Ignatiuk Oleg Ignatiuk is online now
Old
Muchas Gracias!!
permalink
Posted 12-07-2007 at 11:19 AM by ToniLloret ToniLloret is offline
 
Total Trackbacks 0

Trackbacks

Recent Blog Entries by Danny Bembibre

All times are GMT -4. The time now is 01:09 PM.


Powered by vBulletin Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0 ©2008, Crawlability, Inc.