Post Icons

arr0w

New Member
Is it possible to use different post icon sets on different skins?

I use two skins on my forum, one dark and one light... I recently got a new set of icons, they only look good on light backgrounds... I want to apply them to my light skin and not my dark skin, is this possible?

Thanks in advanced.
 
Is it possible? Yes.

Is it simple? No.

vBulletin's style system is quite flexible and allows for near complete control over your style. However smilies and post icons are global and can't be set per-style. This does not work well if your images are matted to a specific background colour and the background colours on your various styles are different.

To resolve this issue, there's a slightly circuitous solution but works quite effectively. The basic principal is to change all the paths of the smilies/post icons to contain a string; then using replacement variables, vBulletin will replace that string at output time.

Note: before doing this, I suggest reading through the whole thread as the alternative method listed at the bottom of the thread could be more appealing to your forum setup.

First and foremost, settle on a string. This string will be replaced with the actual path to your smilies/post icons. Be sure to make it an obscure string. The method of replacement we'll be using will affect the entire output of the page. So if your member posts the string, it too will be replaced.

What I have used in the past is:

$monkeyssaythiswhentheyremad1234567890

... it doesn't have to start with a dollar sign, but I made mine. And this is not something that would likely to be used anywhere on the forums except for this specific purpose.

Now go to:

Admin CP --> Post Icons --> Post Icon Manager

or

Admin CP --> Smilies --> Smilie Manager

Go through each smilie/post icon and change the path of the image from:

images/smilie/X.gif

or

images/icons/X.gif

... where X is the name of the smilie/post icon.

Change that to:

YOUR UNIQUE STRING/smilie/X.gif

... replacing YOUR UNIQUE STRING with the unique string you decided on earlier.

For me it'd be:

$monkeyssaythiswhentheyremad1234567890/smilie/X.gif

Repeat this process for all the smilies/post icons that you want to be skin-specific.

Note: if you want to do this for both smilies and post icons, I recommend using two separate unique strings.

Now that you've changed the paths of all your smilies/post icons, it's time to setup the replacement process.

Go to:

Admin CP --> Styles & Templates --> Replacement Variable Manager

... for each skin, click [Add New Replacement Variable].

Under Search for Text, place your string (for me it'd be $monkeyssaythiswhentheyremad1234567890). And under Replace with Text, place the style-specific path to the smilies/post icons and press [Save].

So now whenever your string is encountered, it's replaced with the path that you specified, on a per-style basis.

There are two problems with this method, however:

1. In the post icon/smilie manager, the actual display of the images will be broken
2. If a user posts your unique string, it will be replaced


Slightly More Complicated Solution for Bypassing the First Issue

Of the two problems listed above, only the first can be fixed. Here's how you do so:

Instead of going through each post icon and changing the path of the image to some unique string, leave the paths alone. Instead, skip directly to the step where we setup the replacement variables.

Now instead of using your unique string in the Search for Text box, simply place:

images/smilies/

or

images/icons/

Enjoy. :)
 
Back
Top