Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 General Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #11  
Old 07-12-2003, 08:02 AM
Tigga's Avatar
Tigga Tigga is offline
 
Join Date: Dec 2001
Location: Atlanta
Posts: 1,061
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Try searching for something like this in your index.php file:

SELECT COUNT(threadid) AS total FROM thread WHERE dateline>

That's the query that's being executed 50+ times. If you remove that then it should lower the number quite a bit.
Reply With Quote
  #12  
Old 07-12-2003, 09:08 AM
Skyline_GT Skyline_GT is offline
 
Join Date: May 2003
Location: Vancouver, BC
Posts: 482
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

wa i see this
Page generated in 0.3105130 seconds (-5,883.75% PHP - 5,983.75% MySQL) with 29 queries.
Reply With Quote
  #13  
Old 07-12-2003, 09:10 AM
Gutspiller's Avatar
Gutspiller Gutspiller is offline
 
Join Date: Dec 2001
Posts: 1,046
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Today at 03:02 AM Tigga said this in Post #11
Try searching for something like this in your index.php file:

SELECT COUNT(threadid) AS total FROM thread WHERE dateline>

That's the query that's being executed 50+ times. If you remove that then it should lower the number quite a bit.
Yeah I have this chunk of code in my index

Code:
f ((!$forumperms['canpostnew'] and $showlocks) or $forum['allowposting']==0) {
          $forum['onoff'].='lock';
        }

        // prepare template vars
        if (!$showforumdescription) {
          $forum['description']='';
        }
        if ($bbuserinfo[userid]!=0) {
        $newforumthreads = $DB_site->query_first("SELECT COUNT(threadid) AS total FROM thread WHERE dateline>$bbuserinfo[lastvisit] and forumid=$forum[forumid]  ");
        $newforumthreadvew = $newforumthreads[total];
       eval("\$forum[newforumthreadvew] = \"".gettemplate('forumhome_newforumthreads')."\";");
        
         }
How much of it do I remove?
Reply With Quote
  #14  
Old 07-12-2003, 09:13 AM
Gutspiller's Avatar
Gutspiller Gutspiller is offline
 
Join Date: Dec 2001
Posts: 1,046
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Today at 04:08 AM Skyline_GT said this in Post #12
wa i see this
Page generated in 0.3105130 seconds (-5,883.75% PHP - 5,983.75% MySQL) with 29 queries.

As we were talking above, guests don't see too many queries, but registered users see 98. We got a lot of stuff going on for registered users.
Reply With Quote
  #15  
Old 07-12-2003, 04:59 PM
Tigga's Avatar
Tigga Tigga is offline
 
Join Date: Dec 2001
Location: Atlanta
Posts: 1,061
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

PHP Code:
if ($bbuserinfo[userid]!=0) {
        
$newforumthreads $DB_site->query_first("SELECT COUNT(threadid) AS total FROM thread WHERE dateline>$bbuserinfo[lastvisit] and forumid=$forum[forumid]  ");
        
$newforumthreadvew $newforumthreads[total];
       eval(
"\$forum[newforumthreadvew] = \"".gettemplate('forumhome_newforumthreads')."\";");
        
         } 
You can remove that bit of code and it will take care of the offending query. It's apparently counting the number of new threads in each forum since a user's last visit, so you will lose that hack, but IMO a hack like that certainly isn't worth an additional 50 queries on your homepage.

By the way, it seems you may have installed the microstats hack wrong...
Page generated in 0.5169800 seconds (-506.86% PHP - 606.86% MySQL) with 92 queries.
The query count seems to be accurate, but obviously the percentages aren't.
Reply With Quote
  #16  
Old 07-12-2003, 09:04 PM
SmEdD's Avatar
SmEdD SmEdD is offline
 
Join Date: Mar 2003
Location: Ontario, Canada
Posts: 381
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Queries may be wrong if you think about it. Everything way oever what it's suppost to be.

Are you useing vB 2.3. If you are theres a fix for the microstats that you might not of used.
Reply With Quote
  #17  
Old 07-13-2003, 09:51 PM
Brad Brad is offline
 
Join Date: Nov 2001
Posts: 4,765
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
07-10-03 at 03:57 AM Gutspiller said this in Post #4
Where would I find that and what exact parts would I remove, do you know? certain code I should look for?

in index.php

Find:

PHP Code:
$forummoderators=$DB_site->query('SELECT user.userid,user.username,moderator.forumid
                                  FROM moderator
                                  LEFT JOIN user
                                    ON (moderator.userid=user.userid)
                                  ORDER BY user.username'
);
while (
$moderator=$DB_site->fetch_array($forummoderators)) {
  
$imodcache["$moderator[forumid]"][] = $moderator;
  
$mod["$moderator[userid]"] = 1;
}
$DB_site->free_result($forummoderators);
unset(
$moderator); 
Remove it.

Find:

PHP Code:
// Start makeforumbit
function makeforumbit($forumid,$depth=1,$permissions='') {
  global 
$DB_site,$bbuserinfo,$iforumcache,$ipermcache,$imodcache,$session,$accesscache,$usergroupdef,$noperms
Change to:

PHP Code:
// Start makeforumbit - modified
function makeforumbit($forumid,$depth=1,$permissions='') {
  global 
$DB_site,$bbuserinfo,$iforumcache,$ipermcache,$session,$accesscache,$usergroupdef,$noperms
Find:

PHP Code:
$listexploded=explode(","$forum['parentlist']);
        while ( list(
$mkey1,$mval1)=each($listexploded) ) {
          if ( !isset(
$imodcache["$mval1"]) ) {
            continue;
          }
          
reset($imodcache["$mval1"]);
          while ( list(
$mkey2,$moderator)=each($imodcache["$mval1"]) ) {
            if ( !isset(
$forum['moderators']) ) {
              eval(
"\$forum['moderators'] = \"".gettemplate('forumhome_moderator')."\";");
            } else {
              eval(
"\$forum['moderators'] .= \", ".gettemplate('forumhome_moderator')."\";");
            }
          }
        }

        if ( !isset(
$forum['moderators']) ) {
          
$forum['moderators'] = ' ';
        } 
Remove it.
Reply With Quote
  #18  
Old 07-14-2003, 02:27 PM
Gutspiller's Avatar
Gutspiller Gutspiller is offline
 
Join Date: Dec 2001
Posts: 1,046
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks.

Yeah, I've always had that problem with the microstats hack. I was never sure why it did it, but it was a small thing, I didn't care much about.
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 01:12 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.04486 seconds
  • Memory Usage 2,265KB
  • Queries Executed 13 (?)
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_code
  • (5)bbcode_php
  • (3)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
  • (8)post_thanks_box
  • (8)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (8)post_thanks_postbit_info
  • (8)postbit
  • (8)postbit_onlinestatus
  • (8)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
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete