PDA

View Full Version : Displaying info in postbit related to particular $post[userid]


cinq
03-09-2005, 08:38 AM
It's in relation to a hack I am trying to achieve for vBaGallery (http://www.vbadvanced.com/forum/showthread.php?t=6300) but I guess it still applies to any general mods.

Ok some quick background information :
I wanted to have a dropdown list in the forum postbits if a user has albums in the gallery. This dropdown list will show the albums he/she has created.

So basically I query the albums matching up the albumownerid ( of the gallery albums table ) and the $post[userid] (i.e the person who posted this post is the owner of those particular albums, since I want his albums to show on his postbits.)

Known issues :
It increases the number of queries on showthread.php by quite a significant bit, and this is the part that I need help optimizing.
I am not too sure how the postbit construct is done, but I placed my code within the includes/functions_showthread.php's construct_postbit function. That's where I am guessing adds the amount of queries (looping perhaps)

How can I optimize this ?