1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

XF 1.5 Change clear.png reference to absolute url?

Discussion in 'Troubleshooting and Problems' started by alex2k5, Sep 14, 2016.

  1. alex2k5

    alex2k5 Member

    Looks like the clear.png file that overlays smilies and the like are hardcoded relative.

    I am using a custom add on that shows forum content on pages outside the main forum directory. So, that image comes back not loaded and 404 not found on all those pages.

    Is there any way to change that location easily that I'm not seeing? If not, a file edit, which one, etc?


    <img src="styles/default/xenforo/clear.png" class="mceSmilieSprite mceSmilie10" alt=":oops:" title="Oops!    :oops:" />
    <img src="http://www.domain.com/forum/styles/default/xenforo/clear.png" class="mceSmilieSprite mceSmilie10" alt=":oops:" title="Oops!    :oops:" />
  2. Chris D

    Chris D XenForo Developer Staff Member

    To do this properly would require a proper add-on to be created, but there is a shortcut simply if you edit the file library/XenForo/BbCode/Formatter/Base.php:

    protected $_smilieSpriteTemplate '<img src="styles/default/xenforo/clear.png" class="mceSmilieSprite mceSmilie%1$d" alt="%2$s" title="%3$s    %2$s" />';
  3. Chris D

    Chris D XenForo Developer Staff Member

    Actually, I wrote an add-on a few years ago to add a space after each smilie - it just involved editing the two smilie templates in this file and adding a space, but it does so as a proper add-on:


    It's a very simple add-on so if you were interested in doing this "properly" then this would be a good place to start.
    alex2k5 likes this.
  4. alex2k5

    alex2k5 Member

    That did it. Left the space functionality in there too :)

    I hard coded, but, is there a way to utilize the options forum path in there so it can be ported to other installs easier in the future?
  5. Chris D

    Chris D XenForo Developer Staff Member

    Just using the original XF code as an example:

    protected $_smilieSpriteTemplate '<img src="' XenForo_Application::getOptions->boardUrl '/styles/default/xenforo/clear.png" class="mceSmilieSprite mceSmilie%1$d" alt="%2$s" title="%3$s    %2$s" />';
    That's probably the easiest way.
  6. alex2k5

    alex2k5 Member

    Ahh cool. For some reason I was thinking way more complicated, like I had to make that available in there somehow first. Thanks again!

Share This Page