PDA

View Full Version : MySQL query to postbit


lauri865@hotmai
04-25-2010, 07:57 PM
Hi,

I want to add a custom mysql field to postbit, but I am quite confused:

<plugins>
<plugin active="1" executionorder="5">
<title>Test query</title>
<hookname>postbit_display_complete</hookname>
<phpcode><![CDATA[if ((THIS_SCRIPT == 'showthread' OR THIS_SCRIPT == 'showpost') AND $this->post['userid'] > 0)
{
$nickname = $this->registry->db->query_read("
SELECT nickname
FROM " . TABLE_PREFIX . "user
WHERE id = " . $this->post['userid'] . "
LIMIT 1
");

//What do I have to do now?
}
]]></phpcode>
</plugin>
</plugins>


Am I on the right path or is there a better way to do this? What should I do now?


Thank you,
Lauri