Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
 Template cond for forum ids
1master1 Offline
Member
***
Posts: 232
Joined: Oct 2010
Post: #1
Template cond for forum ids
Can we use template conditionals as like

<if forumid=4> then ???

i would like to display something if the forum id = the required forum id or else display something else.
11-30-2010 07:51 AM
Find all posts by this user Quote this message in a reply
ZiNgA BuRgA Offline
Fag
*******
Posts: 3,357
Joined: Jan 2008
Post: #2
RE: Template cond for forum ids
It's possible, but not the way you posted it.
And no, I can't give example code because it's different depending on where it's used.  But it usually be a check of $fid and use == for equivalence.

My Blog
11-30-2010 08:29 AM
Find all posts by this user Quote this message in a reply
TriTop Offline
Member
***
Posts: 53
Joined: Apr 2008
Post: #3
RE: Template cond for forum ids
If you used for example in postbit, try $forum['fid'] == 4.
12-01-2010 03:12 AM
Find all posts by this user Quote this message in a reply
1master1 Offline
Member
***
Posts: 232
Joined: Oct 2010
Post: #4
RE: Template cond for forum ids
I used this code in "forumdisplay_thread"

Code:
1
2
3
4
5
6
7
<td align="center" class="{$bgcolor}{$thread_type_class}" width="2%">
        <if in_array($forum['fid'], array(142,157,158)) then>
        {$GLOBALS['threadfields']['timg']['value']}
        <else>
        <a href="{$forumurl_q}filterxt_icon={$thread['icon']}">{$icon}</a><a href="{$forumurl_q}filterxt_prefix={$thread['prefix']}">{$thread['threadprefix']}</a>
        </if>
        </td>


not working tritop.

I'm trying to display topic images instead of prefixes in particular forum ids and prefixes in other forums

(This post was last modified: 12-01-2010 02:13 PM by 1master1.)
12-01-2010 02:11 PM
Find all posts by this user Quote this message in a reply
ZiNgA BuRgA Offline
Fag
*******
Posts: 3,357
Joined: Jan 2008
Post: #5
RE: Template cond for forum ids
Take a look at the forumdisplay_threadlist to see what the correct variables are.

My Blog
12-01-2010 03:37 PM
Find all posts by this user Quote this message in a reply
1master1 Offline
Member
***
Posts: 232
Joined: Oct 2010
Post: #6
RE: Template cond for forum ids
i changed the if line to

<if in_array(fid={$fid}, array() then>
and also
<if in_array({$fid}, array() then>

displaying the codes at the top of thread name and ignoring the if statements
12-02-2010 08:16 AM
Find all posts by this user Quote this message in a reply
RateU Offline
Administrator
*******
Posts: 2,350
Joined: Mar 2010
Post: #7
RE: Template cond for forum ids
(12-02-2010 08:16 AM)1master1 Wrote:  i changed the if line to

<if in_array(fid={$fid}, array() then>
and also
<if in_array({$fid}, array() then>

displaying the codes at the top of thread name and ignoring the if statements

Maybe something like this?

Code:
<if in_array($fid, array(x,y,z)) then>


12-02-2010 08:28 AM
Find all posts by this user Quote this message in a reply
1master1 Offline
Member
***
Posts: 232
Joined: Oct 2010
Post: #8
RE: Template cond for forum ids
no use. may be something like (Global{$fid}) is needed?
12-02-2010 09:00 AM
Find all posts by this user Quote this message in a reply
RateU Offline
Administrator
*******
Posts: 2,350
Joined: Mar 2010
Post: #9
RE: Template cond for forum ids
This?

Code:
<if in_array($thread['fid'], array(x,y,z)) then>


12-02-2010 09:07 AM
Find all posts by this user Quote this message in a reply
1master1 Offline
Member
***
Posts: 232
Joined: Oct 2010
Post: #10
RE: Template cond for forum ids
Parse error: parse error, expecting `T_STRING' or `T_VARIABLE' or `T_NUM_STRING' in D:\Program Files\wamp\www\com\forumdisplay.php(1123) : eval()'d code on line 3
12-02-2010 09:14 AM
Find all posts by this user Quote this message in a reply

« Next Oldest | Next Newest »

 Standard Tools
Forum Jump: