View Single Post
  #7  
Old 11-24-2009, 12:09 PM
micheal332001 micheal332001 is offline
 
Join Date: Apr 2004
Posts: 1,112
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by xman_79 View Post
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.
Reply With Quote
 
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01346 seconds
  • Memory Usage 1,837KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD_SHOWPOST
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_code
  • (1)bbcode_html
  • (2)bbcode_php
  • (1)bbcode_quote
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_box
  • (1)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit_info
  • (1)postbit
  • (1)postbit_onlinestatus
  • (1)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • reputationlevel
  • showthread
Included Files:
  • ./showpost.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
  • showpost_start
  • bbcode_fetch_tags
  • bbcode_create
  • postbit_factory
  • showpost_post
  • 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
  • showpost_complete