vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   one query per thread after enabling plugin (https://vborg.vbsupport.ru/showthread.php?t=216850)

Taragon 06-22-2009 08:59 PM

one query per thread after enabling plugin
 
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?
PHP Code:

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 09: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 11:05 AM

Have to say I lack this knowledge :( Any chance someone might be open for a (paid) request?

Lynne 06-23-2009 12:54 PM

Quote:

Originally Posted by Taragon (Post 1835546)
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 01:02 PM

I will. Thank you both for your replies.

Also, enjoy your holidays Lynne.


All times are GMT. The time now is 12:54 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.02306 seconds
  • Memory Usage 1,722KB
  • 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
  • (1)bbcode_php_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (5)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
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete