How so? The templates should be cached, so no queries there.
I realize that this can be optimized by placing all the code in the TGREER_invite_search_terms plugin inside a conditional:
PHP Code:
if ( (THIS_SCRIPT == 'showthread' OR THIS_SCRIPT =='forumdisplay') AND !$vbulletin->userinfo['userid'])
{
## all the plugin code
}
So, what additional queries are being run?