The Arcive of vBulletin Modifications Site. |
|
|
#1
|
||||
|
||||
|
ok i know 25 queries is alot so can someone give me some suggestion on how to fix up this code or give me some suggestions on how to lessen the queries:
PHP Code:
|
|
#2
|
||||
|
||||
|
anyone?
|
|
#3
|
||||
|
||||
|
It's because you're getting the avatar inside of a loop. Hence increasing your queries dramatically. Do a LEFT JOIN in the query - or even still there may be a vB3 function to get a user's avatar without using any queries getting it from a cache but don't quote me on it
![]() EDIT- direct from showthread.php: Code:
" . iif($vboptions['avatarenabled'], "LEFT JOIN " . TABLE_PREFIX . "avatar AS avatar ON(avatar.avatarid = user.avatarid) LEFT JOIN " . TABLE_PREFIX . "customavatar AS customavatar ON(customavatar.userid = user.userid)") . " |
|
#4
|
||||
|
||||
|
can you explain where i should put the left join and how to use it? cause i never understood those>_<
|
|
#5
|
||||
|
||||
|
Use this:
PHP Code:
|
|
#6
|
||||
|
||||
|
thanks so much! 2 less queries for one comment! thanks alot dean
|
|
#7
|
||||
|
||||
|
Glad it works for you
!
|
![]() |
|
|
| X vBulletin 3.8.12 by vBS Debug Information | |
|---|---|
|
|
More Information |
|
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|