Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
 PHp conditions in an XThreads Template
ZiNgA BuRgA Offline
Fag
*******
Posts: 3,357
Joined: Jan 2008
Post: #6
RE: PHp conditions in an XThreads Template
It should be just $fid without any surrounding brackets, though ($fid) should work too.

Here's the code I've got working:

HTML Code
1
2
3
4
5
6
7
<table border="0" cellspacing="{$theme['borderwidth']}" cellpadding="{$theme['tablespace']}" class="tborder" style="clear: both;">
                        <tr><td class="thead"><strong>Game</strong></td></tr>
                                <tr><td class="fancy"></td></tr>
				<tr><td class="trow1"><a href="forumdisplay.php?fid={$fid}"><span><strong>Both</strong></span></a></td></tr>
								<if $fid == 7 then><tr><td class="trow2"><a href="{$forumurl_q}filtertf_prefix=Sims2"><span style="color: green;"><strong>Sims2</strong></span></a></td></tr>
				<else><tr><td class="trow2"><a href="forumdisplay.php?fid={$fid}&amp;filtertf_prefix=Sims3"><span style="color: blue;"><strong>Sims3</strong></span></a></td></tr></if>
</table>


BTW, for what you're doing, you may prefer a "!=" comparison rather than a "==", eg:

HTML Code
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
<table border="0" cellspacing="{$theme['borderwidth']}" cellpadding="{$theme['tablespace']}" class="tborder" style="clear: both;">
                        <tr><td class="thead"><strong>Game</strong></td></tr>
                                <tr><td class="fancy"></td></tr>
				<tr><td class="trow1"><a href="forumdisplay.php?fid={$fid}"><span><strong>Both</strong></span></a></td></tr>



<if $fid != 7 then>
<tr><td class="trow2"><a href="{$forumurl_q}filtertf_prefix=Sims2"><span style="color: green;"><strong>Sims2</strong></span></a></td></tr>
</if>

<if $fid != 8 then>
<tr><td class="trow2"><a href="{$forumurl_q}filtertf_prefix=Sims3"><span style="color: green;"><strong>Sims3</strong></span></a></td></tr>
</if>

<if $fid != 9 then>
<tr><td class="trow2"><a href="{$forumurl_q}filtertf_prefix=Sims4"><span style="color: rainbow;"><strong>Sims4</strong></span></a></td></tr>
</if>

</table>


My Blog
10-05-2010 10:41 PM
Find all posts by this user Quote this message in a reply

« Next Oldest | Next Newest »

Messages In This Thread
RE: PHp conditions in an XThreads Template - ZiNgA BuRgA - 10-05-2010 10:41 PM

 Standard Tools
Forum Jump: