PDA

View Full Version : Forum Home Enhancements - Use different status image extensions


flup
01-18-2009, 10:00 PM
Before today I was using vBulletin 3.5.4 with the custom status icon mod. This mod allowed you to choose the whole filename. In 3.5.4 I chose to have a PNG extension for these icons and not the vB .gif default.

As I did not want to redo all the images I did a little template modification which allowed me to have .png extension for custom icons and keep the GIF extension for the default images.

In both forumhome_forumbit_level1_post and forumhome_forumbit_level2_post search:
<img src="$stylevar[imgdir_statusicon]/$forum[imageprefix]forum_$forum[statusicon].gif" alt="" border="0" id="forum_statusicon_$forum[forumid]" />

There are different ways you can handle this, lets say custom_icon represents the value you entered in the custom icon field. By default, vBulletin makes the icon as follows:

custom_iconforum_new.gif, if you want to keep this format, change both parts in the templates to:

<img src="$stylevar[imgdir_statusicon]/<if condition="!empty($forum[imageprefix])">$forum[imageprefix]forum_$forum[statusicon].png<else />$forum[imageprefix]forum_$forum[statusicon].gif</if>" alt="" border="0" id="forum_statusicon_$forum[forumid]" />

If you, like me, want to use simple: custom_icon_status.gif, without the forum prefix (it's just a decision I made because all images where already made) use:

<img src="$stylevar[imgdir_statusicon]/<if condition="!empty($forum[imageprefix])">$forum[imageprefix]_$forum[statusicon].png<else />$forum[imageprefix]forum_$forum[statusicon].gif</if>" alt="" border="0" id="forum_statusicon_$forum[forumid]" />

Be sure to change png to whatever extension you are using while creating the images.

No screenshots needed, as it does exactly the same as was it default does, except you now get to choose the extension of the status icon images instead of having to use .GIF