Hello
I'm attempting to create a plugin that retrieves a user profile field to display on the forum home page. The code is as follows.
$lastpostuserid = $lastpostinfo['lastposterid'];
/*write custom query here to get display name*/
$lastposter = $db->query_first("SELECT field6 FROM " . TABLE_PREFIX . "userfield WHERE userid = '$lastpostuserid'");
$lastposterhome_var = $lastposter['field6'];*/
/* register variable in the 'memberaction_dropdown' template */
vB_Template:
reRegister('memberaction_dropdown',a rray('lastposterhome_var'=> $lastposterhome_var));
The hook I'm using is forumbit_display. The problem is that the value of last $lastpostinfo['lastposterid'] is not available and subsequently I'm not getting a result. The value is available though in the template containing memberaction_dropdown (forumhome_lastpostby). The plugin does work if I assign arbitrary text to my variable just to test.
I do have a very similar plugin working on the forum display page which is using the threadbit_display hook and $thread['lastposterid']
I'm quite new to this so any advice would be most welcome.
Thanks.
Mike