PDA

View Full Version : one query per thread after enabling plugin


Taragon
06-22-2009, 09:59 PM
Hello,

I currently have this plugin hooked to threadbit_display, but it seems to be causing one extra query per thread.
Does someone know how to avoid this perhaps?

Also, because this plugin is a mixture of several readmes, could you tell if this plugin is optimized using the 3.8.x standards?
require_once('./includes/functions_user.php');
$userid = $thread['postuserid'];
$username = $thread['postusername'];
$avatarurl = fetch_avatar_url($userid);
if ($avatarurl == '') {
$avatar = "<a class='' href='member.php?u=$userid'><img src='$stylevar[imgdir_misc]/noavatar.gif' /></a>";
}
else {
$avatar = "<a class='' href='member.php?u=$userid'><img src='$avatarurl[0]' /></a>";
}

Dismounted
06-23-2009, 10:00 AM
This will take some SQL knowledge and PHP (and vBulletin) knowledge to "fix". You will need to find the big query where the information is fetched, and join the avatar information onto it. See what happens inside the functions you have used to determine what you need to fetch.

Taragon
06-23-2009, 12:05 PM
Have to say I lack this knowledge :( Any chance someone might be open for a (paid) request?

Lynne
06-23-2009, 01:54 PM
Have to say I lack this knowledge :( Any chance someone might be open for a (paid) request?
If you want to pay for it, you need to post in the Paid Requests section.

Taragon
06-23-2009, 02:02 PM
I will. Thank you both for your replies.

Also, enjoy your holidays Lynne.