Announcement

Collapse
No announcement yet.

Style-Specific Post Icons and Smilies

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Style-Specific Post Icons and Smilies

    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/

    ... and put the Replace with Text value to be your style-specific image path. This makes the style manager not break.
    Bugdar: PHP bug tracking software that is beautiful, fast, and robust.

  • #2
    Very nice. I've copied this to the Quick Tips and Customizations forum:

    http://www.vbulletin.com/forum/showthread.php?t=148347

    Thanks!
    Steve Machol, former vBulletin Customer Support Manager (and NOT retired!)
    Change CKEditor Colors to Match Style (for 4.1.4 and above)

    Steve Machol Photography


    Mankind is the only creature smart enough to know its own history, and dumb enough to ignore it.


    Comment


    • #3
      Thanks Steve . Glad I could help.
      Bugdar: PHP bug tracking software that is beautiful, fast, and robust.

      Comment


      • #4
        I think I have this down now but it still shows my other icons. But they are just box's with red x's

        Comment

        widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
        Working...
        X