try another color scheme:


Go Back   TECH6.0 > Web Design/Development and SEO > Internet Forum Softwares > vBulletin


Create an IF condition for a template properly?

This is a discussion on Create an IF condition for a template properly? within the vBulletin section, part of the Internet Forum Softwares category; Hi, i'm very new to php and html but am profficient at using VBA (Visual Basic for Applications, Microsoft's version ...

Reply
 
LinkBack Thread Tools Display Modes
  #1  
Old 01-10-2008, 07:44 PM
No Avatar

Learner
 
Join Date: Sep 2008
Location: United Kingdom
Posts: 15
Simon Lloyd is on a distinguished road
Default Create an IF condition for a template properly?

Hi, i'm very new to php and html but am profficient at using VBA (Visual Basic for Applications, Microsoft's version of VB), when working with templates for installing mods you often see that you need an IF condition to perform your action, in VB(A) you start with IF...your condition...Then....your action...End If in php you see it in this fashion <If condition.... can you help me understand how this works better? i have the code below which shows an agreement notice box with radio buttons, if the user selects accept all well and good however if they click decline i get the decline message in the agreement box along with the agreement and radio buttons when all i want to show is the decline (ll_decline).
HTML Code:
<form action="$ldm_accept_script.php" method="post">
<input type="hidden" name="securitytoken" value="$bbuserinfo[securitytoken]" />
$ldm_accept_hidden_vars
<table width="100%">
<tr>
    <td>&nbsp;</td>
</tr>
<tr>
    <td align="center">
    <table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" width="60%" align="center">
    <tr>
        <td class="alt1" align="center">
        <if condition="$ldm_accept<0">
        <span class="highlight">$vbphrase[ll_agreement_declined]</span>
        </if>
        <br /><br />
        $vbphrase[ll_agreement]
        <br /><br />
        <input type="radio" name="ldm_accept_form" value="1" /> $vbphrase[ll_accept]
        &nbsp;&nbsp;
        <input type="radio" name="ldm_accept_form" value="-1" checked="checked"/> $vbphrase[ll_decline]
        <br /><br />
        <input type="submit" class="button" name="submit" value="$vbphrase[ll_go]" />
        <br /><br />
        </td>
    </tr>
    </table>
    </td>
</tr>
<tr>
    <td>&nbsp;</td>
</tr>
</table>
</form> 
__________________
Regards,
Simon Lloyd
The Code Cage
Reply With Quote
  #2  
Old 01-10-2008, 08:45 PM
webwizzy's Avatar

Administrator
 
Name: Vinayak
Join Date: Feb 2008
Location: India
Phone: Samsung Wave
Posts: 1,116
webwizzy is just really nicewebwizzy is just really nicewebwizzy is just really nicewebwizzy is just really nicewebwizzy is just really nice
Send a message via Yahoo to webwizzy
Default

In vbulletin you can create your own <if> conditions easily.

First in your PHP file, create a boolean like this:-

PHP Code:
if ($ldm_accep '0')
{
     
$ldm_denied true;
}
else
{
     
$ldm_denied false;

Then in the associated template, do this:-

HTML Code:
<if condition = "$ldm_denied">
     <span class="highlight">$vbphrase[ll_agreement_declined]</span>
</if> 
Hope you get some idea from this !
__________________
Always TAG and SHARE your threads
Submit your site to TECH6 Directory
TECH6 on Facebook - Like Us

Would you like to Link To Us | Support TECH6 by going Premium
Know more about me at Vinayaks.com | Follow TECH6 at Twitter


Reply With Quote
Reply

Bookmarks

Tags
conditionals, template


Thread Tools
Display Modes




All times are GMT +5.5. The time now is 10:43 AM.

Contact Us - Tech6.com - Link to Us - Advertise - Submit Site - Privacy Statement - TOS - Top