Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 General Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 06-09-2009, 11:44 PM
p0lar_bear p0lar_bear is offline
 
Join Date: Feb 2008
Location: Connecticut
Posts: 33
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default vBa: Template Hook Not Working Right

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&amp;type=moderated">Threads</a> (0)</div>
		
		
			<div><a href="http://www.modacity.net/forums/moderation.php?do=viewposts&amp;type=moderated">Posts</a> (0)</div>
		

		
			<div><a href="http://www.modacity.net/forums/moderation.php?do=viewvms&amp;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>&gt;<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>&gt;<a href="http://www.modacity.net/forums/modcp/moderate.php?do=viewpcs&amp;type=moderated" target="_blank"></a> (0)</div>
	</if>
Why is my eval of the template hook causing the if tags to render?
Reply With Quote
  #2  
Old 06-10-2009, 12:03 AM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

You should be asking for help with this on their forums, not here.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 10:36 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.03434 seconds
  • Memory Usage 2,191KB
  • Queries Executed 13 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (1)bbcode_html
  • (1)bbcode_php
  • (1)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (2)post_thanks_box
  • (2)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (2)post_thanks_postbit_info
  • (2)postbit
  • (2)postbit_onlinestatus
  • (2)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete