• 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?

#1
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?

Example:

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

Chris D

XenForo developer
Staff member
#2
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:

PHP:
protected $_smilieSpriteTemplate = '<img src="styles/default/xenforo/clear.png" class="mceSmilieSprite mceSmilie%1$d" alt="%2$s" title="%3$s    %2$s" />';
 
#4
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:

https://xenforo.com/community/resources/space-after-smilie.1558/

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.
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?
 

Chris D

XenForo developer
Staff member
#5
Just using the original XF code as an example:

PHP:
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
Ahh cool. For some reason I was thinking way more complicated, like I had to make that available in there somehow first. Thanks again!