Back to vBulletin 3 Articles

[How-To] fetch_userinfo_query
by Dark_Wizard 23 Oct 2005

Just found that trying to use this plugin to extend the query for userinfo:

Code:
<plugin active="1" product="some product">
		<title>Test</title>
		<hookname>fetch_userinfo_query</hookname>
		<phpcode><![CDATA[$hook_query_fields = ", table.*";
		$hook_query_joins = "LEFT JOIN " . TABLE_PREFIX . "table AS table ON (user.userid = table.userid)";
]]></phpcode>
you get errors when activating the plugin, the reason is even though the syntax is correct the issue appears when the plugin is activated and gets stored in the datastore as the last quote in the second string causes the issue.

A quick fix since we don't need the data for a guest was to just simply wrap it in this:
Code:
<plugin active="1" product="vBWar">
		<title>Test</title>
		<hookname>fetch_userinfo_query</hookname>
		<phpcode><![CDATA[if ($vbulletin->userinfo['userid'])
		{
		$hook_query_fields = ", table.*";
		$hook_query_joins = "LEFT JOIN " . TABLE_PREFIX . "table AS table ON (user.userid = table.userid)";
		}
]]></phpcode>
Hope this helps anyone else as it drove me nuts.

Posted as a bug at vb.com if it indeed is a bug...

vblts.ru supports vBulletin®, 2022-2024