Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 Programming Discussions

Reply
 
Thread Tools Display Modes
  #1  
Old 04-05-2009, 11:29 PM
Dj Sagi Dj Sagi is offline
 
Join Date: Oct 2008
Posts: 50
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default big load do error

how i do that if in my forum
when i someone have big load something like 40 second it appear error?
thx for helps!
srry for bad eng.
Reply With Quote
  #2  
Old 04-06-2009, 02:44 AM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

There may be a modification where it will disallow certain usergroups if your server gets over a certain load. Try a search on "load" or "server" or "usergroup" in "all mods" "titles only"
Reply With Quote
  #3  
Old 04-06-2009, 01:12 PM
Dj Sagi Dj Sagi is offline
 
Join Date: Oct 2008
Posts: 50
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I DONT FOND Restrict search
but i want that no only in search i show, i want that it show error in all my forum that they can enter to nothing and it show error.
how i do it?
thx
Reply With Quote
  #4  
Old 04-06-2009, 01:35 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I'm sorry, I don't understand what you want. vB does not have anything built in to restrict users based on the server load. I did see modifications by searching on "load" in "all mods" "titles only" that deal with server loads. I'm not sure if one of those is what you want. Maybe you can modify it to do what you want.
Reply With Quote
  #5  
Old 04-06-2009, 02:13 PM
Dj Sagi Dj Sagi is offline
 
Join Date: Oct 2008
Posts: 50
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

can i get link?
thx.
Reply With Quote
  #6  
Old 04-06-2009, 02:20 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I'm not gonna link to all the threads that come up in the search. Try a search for "load*" in "all mods" "titles only" The search bar is in the upper right corner.
Reply With Quote
  #7  
Old 04-06-2009, 02:26 PM
Dj Sagi Dj Sagi is offline
 
Join Date: Oct 2008
Posts: 50
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

i found some
PHP Code:
                $search_load intval($vbulletin->options['RestrictSearchs_max_load']);

                if (
$search_load <= 0) {

                    
$search_load 5;

                }

    
            if (( 
$vbulletin->userinfo['usergroupid'] <> 6  ) )

            {
  
            
                if (
$load = @file_get_contents("/proc/loadavg")) 

                {

                    
$loadavg explode(' '$load); 
 
                    
                }elseif (
$load=@exec('uptime')) 

                {
                    
preg_match('/averages?: ([0-9\.]+),[\s]+([0-9\.]+),[\s]+([0-9\.]+)/',$load$loadavg);
    
        
                }
                    elseif (
$load = @`sysctl vm.loadavg|cut -d" " -f3-5`) 
                
                    {

                    
$loadavg explode(' '$load);
  
                }

            
                if (
trim($loadavg[0]) > $search_load)
  
                { 
 
                    eval(
standard_errorfetch_error('restrict_search')));

                } 
how i change it that when i have high load appear error in all web?
that can enter to nothing...

thx for help!
Reply With Quote
  #8  
Old 04-06-2009, 02:45 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

That looks like code out of a modification. Did you install it? It looks like you set the load in the vboptions and then it gives an error when trying to use search. The variables are all there, you can change it however you want. You should play with the code on your test site to get it right.
Reply With Quote
  #9  
Old 04-06-2009, 02:54 PM
Dj Sagi Dj Sagi is offline
 
Join Date: Oct 2008
Posts: 50
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Lynne View Post
That looks like code out of a modification. Did you install it? It looks like you set the load in the vboptions and then it gives an error when trying to use search. The variables are all there, you can change it however you want. You should play with the code on your test site to get it right.
you right it restirect search when high load for server....

how i can change it for that it show error in the web not in the search when the server have high load?
thx a lot!
u really really help me!
Reply With Quote
  #10  
Old 04-06-2009, 03:11 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I don't know exactly what you need to do. Find a page that gives the error message you want and then find that code in the page and put it in your new modification OR write your own error phrase and use it in the code. I don't know what hook that code is using, but you'll want to use a more global hook instead of a search hook (if that is the case there).

As I said before, play with it on a test site.
Reply With Quote
Reply

Thread Tools
Display Modes

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 08:01 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.04730 seconds
  • Memory Usage 2,256KB
  • Queries Executed 11 (?)
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
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (1)bbcode_php
  • (1)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (10)postbit
  • (10)postbit_onlinestatus
  • (10)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