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)
-   -   Remove 1 Database Query Per Page (https://vborg.vbsupport.ru/showthread.php?t=80061)

Trigunflame 04-18-2005 10:57 AM

Quote:

Originally Posted by T3MEDIA
Hummm how are you guys checking your queries? via putty or something?

1. open index.php
2. go to bottom above eval('$navbar = "' . fetch_template('navbar') . '";');
3. put echo " ";
4. open includes/functions.php
5. find exec_shut_down()
6. at bottom, of function place echo "Queries: $query_count <br />";
7. there you go.

At the bottom the other queries hack is from erwin/teck, but like i said theirs doesn't count shutdown queries..

And without my small mod, the number to the right will show 9 everytime, instead of 8.

Trigunflame 04-18-2005 01:07 PM

Update;

Scripts whosonline and misc, are allowed to update page.

buro9 04-18-2005 01:24 PM

If you want to confirm when this query is being run, just add:
Code:

echo ".";
To the line above:
Code:

          $DB_site->shutdown_query("
                  UPDATE " . TABLE_PREFIX . "session

Before you install this hack you'd see a dot in the top left hand corner of every page... but after you install this hack you'll only see the dot when you browse to new pages... click refresh on a page and the dot disappears.

Which means the query on the line after it disappears too.

This hack is pretty neat and will help to shave this unneeded query. If you have a large board 200+ users online the it's a good hack to install.

And no, it doesn't add queries anywhere :)

Whilst TrigunFlame is on a roll we should point him towards the index page to see if he can miraculously find some way of improving that too... I'm down to 0.06 seconds generate time... but I know it can be lower ;)

nexialys 04-18-2005 01:55 PM

please edit this, a if else if is not really appropriate... just change the first one:
PHP Code:

    if (in_array(THIS_SCRIPT$badScripts) OR ($session['location'] != WOLPATH)) 


Trigunflame 04-18-2005 01:57 PM

Quote:

Originally Posted by nexialys
please edit this, a if else if is not really appropriate... just change the first one:
PHP Code:

    if (in_array(THIS_SCRIPT$badScripts) OR ($session['location'] != WOLPATH)) 


how about this instead:

PHP Code:

if ($session['location'] != WOLPATH || THIS_SCRIPT == 'misc' || THIS_SCRIPT == 'online'

note: been up 3 days straight almost giving support and workin on stuff, give me a break :tired:

sabret00the 04-18-2005 02:58 PM

nevermind ;)

just installed :)

Deaths 04-18-2005 03:05 PM

http://www.vbulletin.com/docs/html/codestandards_and_or

You're using || ;)

Nice hack by the way, very usefull for big boards. /me installs

buro9 04-18-2005 03:07 PM

Lord above, I never knew that file existed or that vBulletin had coding standards!

I now fear for my own hacks if standards police are going to come knocking ;)

Deaths 04-18-2005 03:09 PM

Hehe ;).

It's a very usefull file, nice to read through it when you are bored :p.

Many authors make this mistake, but I just happened to notice it while scrolling his code.

Trigunflame 04-18-2005 03:33 PM

Quote:

Originally Posted by Deaths
http://www.vbulletin.com/docs/html/codestandards_and_or

You're using || ;)

Nice hack by the way, very usefull for big boards. /me installs

Unfortunately you cannot depend on Vbulletin for coding standards, as its inards are a lot of crap coding.

I prefer using || instead of OR; They just suggest using it for readability, in PHP Documentation, it does not matter.


All times are GMT. The time now is 08:16 AM.

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.01272 seconds
  • Memory Usage 1,744KB
  • 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
  • (3)bbcode_php_printable
  • (3)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (3)pagenav_pagelink
  • (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