MyBB Hacks

Full Version: Sticky icon ( if else )
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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.
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>

(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
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)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.
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)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/
thank you!
It works great!
(07-10-2011 09:31 AM)Juventiner Wrote: [ -> ]thank you!
It works great!

You're welcome Tongue
Reference URL's