View Full Version : Having an issue using postbit hook

23 Aug 2007, 02:42
Im having an issue, im trying to make last seen online use a hook instead of having to edit the postbit_legacy template everytime. However this always fails to work. Anyone know why?

<plugin active="1" executionorder="5">
<title>lastseenonline postbit</title>
$lastseenonlinepostbit = '
<if condition="$show['last_seen_online']"><div>$vbphrase[last_seen_online]: $post[lastseen_date] $post[lastseen_time]</div></if>
$template_hook['postbit_userinfo_right_after_posts'] .= $lastseenonlinepostbit;

Adrian Schneider
23 Aug 2007, 03:00
You would have to generate the compiled template code.

23 Aug 2007, 03:02
Argh that I have no clue, my editing is very basic.

Adrian Schneider
23 Aug 2007, 03:08
Actually my mistake. You can do it as is, but you can't use the <if> or variables since it is not evaluated.

Use the actual variables instead of single quoting the string, and for any ifs, use either the ternary operator or PHPs if().