micheal332001 |
11-24-2009 12:09 PM |
Quote:
Originally Posted by xman_79
(Post 1920073)
why not use in your php file
PHP Code:
$show['something'] = iif($gameinfo[uid] == $userid , true , flase);
and in your template
Code:
<vb:if condition="$show['something']">
html code ....
</vb:if>
Edit : excuse me ragtek I saw your answer later
|
I have tryed this and if i put a echo or print on the $show['something'] it will show if its true or flase,
but in the template its not seeing it and outputting the info its showing it as $show['something'].
here is my PHP code
PHP Code:
$show['something'] = iif($gameinfo[uid] == $userid , true , flase);
$templater = vB_Template::create('gamesswap_left_block_bit'); $templater->register('lm_catslist', $lm_catslist); $templater->register('lm_myaccount', $lm_myaccount); $left_block .= $templater->render();
$templater = vB_Template::create('gamesswap_featured_block_bit'); $templater->register('cb_newestgames', $cb_newestgames); $templater->register('cb_topseller', $cb_topseller); $featured_block .= $templater->render();
$templater = vB_Template::create('gamesswap_view_game_page_bit'); $templater->register('gname', $gameinfo[gname]); $templater->register('gimage', $gameinfo[image]); $templater->register('gdescription', $gdescription); $templater->register('gaurther', $gameinfo[aurther]); $templater->register('gpub', $gameinfo[pub]); $templater->register('gameregion', $gameregion); $templater->register('gcondition', $gameinfo[condition]); $templater->register('ggage', $gameinfo[gage]); $templater->register('ginstructions', $gameinfo[instructions]); $templater->register('pictures', $pictures); $templater->register('gswap1', $swaplist[swap1]); $templater->register('gswap2', $swaplist[swap2]); $templater->register('gswap3', $swaplist[swap3]); $templater->register('gswap4', $swaplist[swap4]); $templater->register('gswap5', $swaplist[swap5]); $templater->register('gswap6', $swaplist[swap6]); $templater->register('swap_status', $gameinfo[swap_status]); $templater->register('gid', $gameinfo[gid]); $current .= $templater->render();
$templater = vB_Template::create('gamesswap'); $templater->register_page_templates(); $navbits = construct_navbits(array("gamesswap.php?" . $vbulletin->session->vars['sessionurl'] => $page_title)); $navbar = render_navbar_template($navbits); $templater->register('navbar', $navbar); $templater->register('page_title', $page_title); $templater->register('current', $current); $templater->register('cm_catslist', $cm_catslist); $templater->register('left_block', $left_block); $templater->register('lm_search', $lm_search); $templater->register('featured_block', $featured_block); print_output($templater->render());
Here is my template code
HTML Code:
<vb:if condition="$show['something']">
<vb:else />
<table border="0" width="100%" align="center">
<tr>
<td colspan="2" class="blocksubhead" width="50%" align="center">{vb:raw vbphrase.options}</td>
</tr>
<tr>
<td class="alt1" width="50%" align="center"><vb:if condition="$swap_status1 > 1">
{vb:raw swap_status}
<vb:else />
<form action="gamesswap.php?do=swap" method="post" enctype="multipart/form-data" target="_self">
<input type="hidden" name="gid" value="{vb:raw gid}">
<input type="submit" value="{vb:raw vbphrase.gamesswap_view_game_swap}">
</form>
</vb:if>
</td>
<td class="alt1" width="50%" align="center">
<form action="gamesswap.php?do=question" method="post" enctype="multipart/form-data" target="_self">
<input type="hidden" name="gid" value="{vb:raw gid}">
<input type="submit" value="{vb:raw vbphrase.gamesswap_view_game_question}">
</form>
</td>
</tr>
</table>
</vb:if>
But the if statment is still not working.
|