PDA

View Full Version : Hook Location??


Oreamnos
01-25-2006, 11:16 PM
I am trying to create a tiny plugin that gets evaluated for each post in a thread.

This code should be executed for each post:
if ($post['userid'] == 1) {
$admin_has_posted++;
}

I want to access the $admin_has_posted variable in the postbit template for the following conditional statement.

<if condition="$admin_has_posted == 1">
do this...
<else />
do that...
</if>

Where should I put this hook so that it is executed properly?

thanks
eric

Andreas
01-25-2006, 11:19 PM
postbit_display_complete
Though, it won't work this way.

Oreamnos
01-25-2006, 11:20 PM
postbit_display_complete
Though, it won't work this way.
thanks Andreas, but what am i doing wrong?

harmor19
01-26-2006, 12:41 AM
I want to do the same thing but I get an error when I use

$gethostforum = $db->query_read("SELECT * FROM " . TABLE_PREFIX . "hosting_options WHERE optionid='1'");
$hf = $db->fetch_array($gethostforum);

Here's the conditional I have in the postbit template.
<if condition="$thread[forumid] == $hf[new_request]">

"new_request" has the id of the forum I want to use the conditional on.
I doubt the conditional is causing the problem though


Here's the error
Fatal error: Call to a member function on a non-object in c:\apache\htdocs\forum\forums\includes\class_postb it.php(279) : eval()'d code on line 1