I made a plugin for my board to add Album Pictures and Picture Comments to the Quick Moderation module for vBa. However, the output is whacked.
My plugin code is as follows; it hooks into vba_cmps_module_moderate:
PHP Code:
if (can_moderate(0, 'canmoderatepictures'))
{
$pictures = $db->query_first("SELECT COUNT(*) AS count FROM " . TABLE_PREFIX . "picture WHERE state = 'moderation'");
$pictures['count'] = vb_number_format($pictures['count']);
$show['pictures'] = true;
}
if (can_moderate(0, 'canmoderatepicturecomments'))
{
$piccoms = $db->query_first("SELECT COUNT(*) AS count FROM " . TABLE_PREFIX . "picturecomment WHERE state = 'moderation'");
$piccoms['count'] = vb_number_format($piccoms['count']);
$show['piccoms'] = true;
}
eval('$template_hook[adv_portal_moderation] .= "
<if condition=\"$show[pictures]\">
<div<if condition=\"$pictures[count]\"> style=\"font-weight: bold\"</if>><a href=\"$modcpdir/moderate.php?$session[sessionurl]do=viewpics\" target=\"_blank\">$vbphrase[album_pictures]</a> ($pictures[count])</div>
</if>
<if condition=\"$show[piccoms]\">
<div<if condition=\"$piccoms[count]\"> style=\"font-weight: bold\"</if>><a href=\"$modcpdir/moderate.php?$session[sessionurl]do=viewpcs&type=moderated\" target=\"_blank\">$vbphrase[comments]</a> ($piccoms[count])</div>
</if>";');
The output I get in the module is this:
Quote:
Threads (0)
Posts (0)
Visitor Messages (0)
Events (0)
Attachments (0)
Members (0)
style="font-weight: bold"> (1)
style="font-weight: bold"> (0)
|
And if I look at the page source, this is what it looks like:
HTML Code:
<div><a href="http://www.modacity.net/forums/moderation.php?do=viewthreads&type=moderated">Threads</a> (0)</div>
<div><a href="http://www.modacity.net/forums/moderation.php?do=viewposts&type=moderated">Posts</a> (0)</div>
<div><a href="http://www.modacity.net/forums/moderation.php?do=viewvms&type=moderated">Visitor Messages</a> (0)</div>
<div><a href="http://www.modacity.net/forums/modcp/moderate.php?do=events" target="_blank">Events</a> (0)</div>
<div><a href="http://www.modacity.net/forums/modcp/moderate.php?do=attachments" target="_blank">Attachments</a> (0)</div>
<div><a href="http://www.modacity.net/forums/admincp/user.php?do=moderate" target="_blank">Members</a> (0)</div>
<if condition="1">
<div><if condition="1"> style="font-weight: bold"</if>><a href="http://www.modacity.net/forums/modcp/moderate.php?do=viewpics" target="_blank"></a> (1)</div>
</if>
<if condition="1">
<div><if condition="0"> style="font-weight: bold"</if>><a href="http://www.modacity.net/forums/modcp/moderate.php?do=viewpcs&type=moderated" target="_blank"></a> (0)</div>
</if>
Why is my eval of the template hook causing the if tags to render?