vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.0 Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=33)
-   -   VB3 MicroStats (https://vborg.vbsupport.ru/showthread.php?t=62173)

djohn 03-05-2004 03:11 PM

Quote:

Originally Posted by PitchouneN64ngc
Have you edited your functions.php file with Dreamweaver?

No, I've used internal FlashFXP editor. However, now everything is fine, that problem accured only once.

Boofo 03-05-2004 03:26 PM

Quote:

Originally Posted by TECK
The IF should not change anything, except avoid proccesing any not needed functions, while increasing performance.
Do you run a UNIX box? Also, something is wrong there with your server. You cannot have 0 for all average loads, or make it work on Windows, from what I know (if anyone knows a way, please let me know, since I'm not good at server configuration ;)).

Leave the code as it is (that's why you get zero's)... and check with your host.
Let us all know the results.

Cheers.

They are running Linux and the server load has always worked correctly before. It has always flucuated in the past.

TECK 03-05-2004 03:39 PM

Quote:

Originally Posted by Boofo
They are running Linux and the server load has always worked correctly before. It has always flucuated in the past.

Thanks for clearing this up. It beats me why the IF would not work, because it should.
Please post the full IF change so others could see it and paste it properly. :)
If it's working better your way, the hell with the code performance, we will use what's better, right? :D

Cheers.

Boofo 03-05-2004 03:45 PM

Here's what I did. I changed:

PHP Code:

  if ($stats = @exec('uptime 2>&1') AND trim($stats) != '')
  {
   if (
preg_match("/averages?: ([0-9\.]+), [\s]+([0-9\.]+), [\s]+([0-9\.]+)/"$stats$regs)) 

to:

PHP Code:

  if ( $stats = @exec'uptime' ) )
  {
    
preg_match'/averages?: ([0-9\.]+),[\s]+([0-9\.]+),[\s]+([0-9\.]+)/' $stats $regs ); 

and it works right now. Here is a fresh screenshot of my server load (so you can see that it is working).

Sorry about this Floren. ;)

TECK 03-05-2004 03:52 PM

Quote:

Originally Posted by Boofo
Here's what I did. I changed:

PHP Code:

  if ($stats = @exec('uptime 2>&1') AND trim($stats) != '')
  {
   if (
preg_match("/averages?: ([0-9\.]+), [\s]+([0-9\.]+), [\s]+([0-9\.]+)/"$stats$regs)) 

to:

PHP Code:

  if ( $stats = @exec'uptime' ) )
  {
    
preg_match'/averages?: ([0-9\.]+),[\s]+([0-9\.]+),[\s]+([0-9\.]+)/' $stats $regs ); 

and it works right now. Here is a fresh screenshot of my server load (so you can see that it is working).

Sorry about this Floren. ;)

Try this for me please:
Code:

  if ($stats = @exec('uptime 2>&1') AND trim($stats) != '')
  {

Let me know if it's working. It should display the stats if the values are not 0 only. Thanks.

Boofo 03-05-2004 03:55 PM

Yes, that works, too. ;)

TECK 03-05-2004 04:00 PM

Ok, let's leave it then this way, what do you think?
Basically, we will remove only the IF in front of PREG_MATCH function... I'm still persistent with the IF... Leave the IF and try to refresh several times the page so you can create a server load. Let me know if it'S displaying the stats. Sorry to bother you but I don't have access to a UNIX server now.

I will update the file when I get back from work.

Boofo 03-05-2004 04:02 PM

Looks good to me. ;)

If I don't remove the IF, the server load doesn't show at all. ;)

TECK 03-05-2004 04:06 PM

Quote:

Originally Posted by Boofo
Looks good to me. ;)

If I don't remove the IF, the server load doesn't show at all. ;)

Try this line?
Code:

                        if (preg_match("/averages?: ([0-9\.]+),[\s]+([0-9\.]+),[\s]+([0-9\.]+)/", $stats, $regs))
                        {

Let me know please Bob.
PS. Damn I deleted by accident the image, instead of the file, no more screenshot till tonight... We have one from Bob anyway, heh.

Boofo 03-05-2004 04:11 PM

This is wierd. I re-downloaded your file and put the if code in like you have it in your file and for some reason, it is showing the server load now (with the IF statement). I swear to you that it wasn't working before. I don't know what happened. You have any ideas? ;)


All times are GMT. The time now is 12:05 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.01302 seconds
  • Memory Usage 1,753KB
  • 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
  • (2)bbcode_code_printable
  • (4)bbcode_php_printable
  • (5)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (1)pagenav_pagelinkrel
  • (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