Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
 Sticky icon ( if else )
Jay99 Offline
Junior Member
**
Posts: 11
Joined: May 2011
Post: #1
Sticky icon ( if else )
Hello everyone,

My board - Survival Daddy

You see the sticky icons? There's only 1 column not 2.
I would like so that when a user post a message and uses one of the "post icons" it shows up ok, but if I select the post as a "Sticky Post" my Pin icon comes up instead.

Basically, I need some sort of "if else" statement...
No post icon, else
Post icon, else
Sticky icon

and then if not sticky no more, put back the original icon, if user selected one.

Any help would be greatly appreciated.
06-16-2011 09:49 AM
Visit this user's website 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: Sticky icon ( if else )
In your forumdisplay_thread template

HTML Code
<if $thread['sticky'] then>
<img src="my_awesome_sticky_icon.gif" alt="Too bad you can't see this awesome sticky icon!" />
<else>
{$icon}
</if>


My Blog
06-16-2011 12:14 PM
Find all posts by this user Quote this message in a reply
Jay99 Offline
Junior Member
**
Posts: 11
Joined: May 2011
Post: #3
RE: Sticky icon ( if else )
(06-16-2011 12:14 PM)ZiNgA BuRgA Wrote:  In your forumdisplay_thread template

HTML Code
<if $thread['sticky'] then>
<img src="my_awesome_sticky_icon.gif" alt="Too bad you can't see this awesome sticky icon!" />
<else>
{$icon}
</if>


This was exactly what I was looking for,

Thank you Yipi
(This post was last modified: 06-16-2011 12:55 PM by Jay99.)
06-16-2011 12:54 PM
Visit this user's website Find all posts by this user Quote this message in a reply
Juventiner Offline
Junior Member
**
Posts: 5
Joined: Jul 2011
Post: #4
RE: Sticky icon ( if else )
Hi
If i use this Code, my board show me the following error:

HTML Code
<if $thread['sticky'] then>
<img src="sticky.gif" alt="Too bad you can't see this awesome sticky icon!" />
<else>
{$icon}
</if>


Code:
Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /users/rose4you/www/beta/forumdisplay.php(1129) : eval()'d code on line 2

07-10-2011 08:29 AM
Find all posts by this user Quote this message in a reply
Jay99 Offline
Junior Member
**
Posts: 11
Joined: May 2011
Post: #5
RE: Sticky icon ( if else )
(07-10-2011 08:29 AM)Juventiner Wrote:  Hi
If i use this Code, my board show me the following error:

HTML Code
<if $thread['sticky'] then>
<img src="sticky.gif" alt="Too bad you can't see this awesome sticky icon!" />
<else>
{$icon}
</if>


Code:
Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /users/rose4you/www/beta/forumdisplay.php(1129) : eval()'d code on line 2


Make sure you install "phptpl-1.9.7z" before using the code,
you can find it Here , top right.
07-10-2011 08:47 AM
Visit this user's website Find all posts by this user Quote this message in a reply
Juventiner Offline
Junior Member
**
Posts: 5
Joined: Jul 2011
Post: #6
RE: Sticky icon ( if else )
Okay great it works but now i see only the text ''Too bad you can't see this awesome sticky icon!'' and noch the icon. Why? In what folder i must upload the image icon?
07-10-2011 09:04 AM
Find all posts by this user Quote this message in a reply
Jay99 Offline
Junior Member
**
Posts: 11
Joined: May 2011
Post: #7
RE: Sticky icon ( if else )
(07-10-2011 09:04 AM)Juventiner Wrote:  Okay great it works but now i see only the text ''Too bad you can't see this awesome sticky icon!'' and noch the icon. Why? In what folder i must upload the image icon?

/forum/images/
or

/images/
07-10-2011 09:06 AM
Visit this user's website Find all posts by this user Quote this message in a reply
Juventiner Offline
Junior Member
**
Posts: 5
Joined: Jul 2011
Post: #8
RE: Sticky icon ( if else )
thank you!
It works great!
07-10-2011 09:31 AM
Find all posts by this user Quote this message in a reply
Jay99 Offline
Junior Member
**
Posts: 11
Joined: May 2011
Post: #9
RE: Sticky icon ( if else )
(07-10-2011 09:31 AM)Juventiner Wrote:  thank you!
It works great!

You're welcome Tongue
07-10-2011 09:33 AM
Visit this user's website Find all posts by this user Quote this message in a reply

« Next Oldest | Next Newest »

 Standard Tools
Forum Jump: