MyBB Community Forums

Full Version: Smilies Path in 1.6x
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I had this same complaint for 1.4x but now I'm going to make a bit of a stink about this.

The problem is that smilies use the following code from class_parser.php.

				$this->smilies_cache[$smilie['find']] = "<img src=\"{$this->base_url}{$smilie['image']}\" style=\"vertical-align: middle;\" border=\"0\" alt=\"{$smilie['name']}\" title=\"{$smilie['name']}\" />";

Above this there is code for the base_url.

		// Set base URL for parsing smilies
		$this->base_url = $mybb->settings['bburl'];

		if($this->base_url != "")
		{
			if(my_substr($this->base_url, my_strlen($this->base_url) -1) != "/")
			{
				$this->base_url = $this->base_url."/";
			}
		}

The problem arises if you want to use external server smilies. In admincp you can add/edit a smilie and use a full url.

Quote:Image Path Image Path *
This is the path to the smilie image.

However it won't work using a url since the code in class_parser will prevent that. This is really uncool imho. Also just like some other parts of admincp you should be able to use {theme} for the smilies image path.

Right now MyBB add support in 1.6x for external theme image dir and that's great. So please consider this other change as well. The whole base_url thing is pointless imho. A few minor changes and this will work very well.

Thank you.

EDIT:
Then there is code like this in the admin smilies module.

	while($smilie = $db->fetch_array($query))
	{
		$smilie['image'] = str_replace("{theme:imgdir}", $theme['imgdir'], $smilie['image']);
		if(my_strpos($smilie['image'], "p://") || substr($smilie['image'], 0, 1) == "/") 
		{
			$image = $smilie['image'];
		}
		else
		{
			$image = "../".$smilie['image'];
		}

So it appears a half-assed attempt was made to use imgdir but what's "{theme:imgdir}". Never saw that one. Old code? Bad admin stuff not completed wtf?
I just added my old forum's smilies and discovered that problem. Sad
Found the thread afterwards.

So now all I can do is to wait until its fixed to use the Smilies I just added externally in an additional folder inside the smilies folder ?

Damn...

Any ideas how to fix that ?
The intersting part is that though you only see the smilie text in the smilie box because of above mentioned bug, but in the posts they show up as they should.

But since you can't click them in the smilie menu, because it only shows the smilie code, its not really helpful.
Also, does the same happen to Post Icons ?

Before I add new ones and see the same issue. I would appreciate any info on that.
Thank you.

Wolfseye
Yes, also Happen with the Post icons...
And yes, you have all the reason.
Would be nice if Devs could come up with a quick fix, a code fix or something, so I don't have to wait for an update.

How can I open a forum where most of the smilies look like:

Quote::tongue: :peace: :smile:

and are not clickable because of that. Dodgy
What would I give if someone of the Devs would actually care to comment on that, even maybe offers a solution or an ETA on a fix for that.
I consider this as a bug considering there have been a few support threads about it and it doesn't say that url's dont work so you can follow it here: [Issue #1154]