MyBB Community Forums

Full Version: How do i add
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
a seperate set of smilies for my themes that have dark backgrounds? Is this possible?

Basically i wanna make it so the dark theme uses it's own set of smilies and not the smilies used for the light background themes?


Thanks.
Here's a modification I wrote up before:

Quote:Okay, firstly, open up /inc/class_parser.php,
Find:
		global $cache;
		$this->smilies_cache = array();

		$smilies = $cache->read("smilies");
		if(is_array($smilies))
		{
			foreach($smilies as $sid => $smilie)
			{
				$this->smilies_cache[$smilie['find']] = "<img src=\"{$this->base_url}{$smilie['image']}\" style=\"vertical-align: middle;\" border=\"0\" alt=\"{$smilie['name']}\" title=\"{$smilie['name']}\" />";
Replace with:
		global $cache, $theme;
		$this->smilies_cache = array();

		$smilies = $cache->read("smilies");
		if(is_array($smilies))
		{
			foreach($smilies as $sid => $smilie)
			{
				$smilie['image'] = str_replace('{theme}', $theme['imgdir'], $smilie['image']);
				$this->smilies_cache[$smilie['find']] = "<img src=\"{$this->base_url}{$smilie['image']}\" style=\"vertical-align: middle;\" border=\"0\" alt=\"{$smilie['name']}\" title=\"{$smilie['name']}\" />";

Also, open up misc.php,
Find: (2 occurances)
$smilie['find'] = htmlspecialchars_uni($smilie['find']);
Add below: (2 occurances)
$smilie['image'] = str_replace('{theme}', $theme['imgdir'], $smilie['image']);

Finally, open up inc/functions.php,
Find:
$smiliecache[$smilie['find']] = $smilie['image'];
Replace with:
$smiliecache[$smilie['find']] = str_replace('{theme}', $theme['imgdir'], $smilie['image']);

Now, upload smilies that you want to be different for each theme into your /images/<themedir>/smilies/ folder, for each theme.
Finally, go to your AdminCP -> Message Filters -> Smilie Manager and edit the Image Path of the smilies that you want to be different across all themes.
Just replace images with {theme} and update. For example, the default Smile is:
images/smilies/smile.gif
If you want it to be different across themes, just change it to:
{theme}/smilies/smile.gif
(and don't forget to upload all the smilies to the appropriate location)
ZiNgA BuRgA Wrote:Here's a modification I wrote up before:

Quote:Okay, firstly, open up /inc/class_parser.php,
Find:
		global $cache;
		$this->smilies_cache = array();

		$smilies = $cache->read("smilies");
		if(is_array($smilies))
		{
			foreach($smilies as $sid => $smilie)
			{
				$this->smilies_cache[$smilie['find']] = "<img src=\"{$this->base_url}{$smilie['image']}\" style=\"vertical-align: middle;\" border=\"0\" alt=\"{$smilie['name']}\" title=\"{$smilie['name']}\" />";
Replace with:
		global $cache, $theme;
		$this->smilies_cache = array();

		$smilies = $cache->read("smilies");
		if(is_array($smilies))
		{
			foreach($smilies as $sid => $smilie)
			{
				$smilie['image'] = str_replace('{theme}', $theme['imgdir'], $smilie['image']);
				$this->smilies_cache[$smilie['find']] = "<img src=\"{$this->base_url}{$smilie['image']}\" style=\"vertical-align: middle;\" border=\"0\" alt=\"{$smilie['name']}\" title=\"{$smilie['name']}\" />";

Also, open up misc.php,
Find: (2 occurances)
$smilie['find'] = htmlspecialchars_uni($smilie['find']);
Add below: (2 occurances)
$smilie['image'] = str_replace('{theme}', $theme['imgdir'], $smilie['image']);

Finally, open up inc/functions.php,
Find:
$smiliecache[$smilie['find']] = $smilie['image'];
Replace with:
$smiliecache[$smilie['find']] = str_replace('{theme}', $theme['imgdir'], $smilie['image']);

Now, upload smilies that you want to be different for each theme into your /images/<themedir>/smilies/ folder, for each theme.
Finally, go to your AdminCP -> Message Filters -> Smilie Manager and edit the Image Path of the smilies that you want to be different across all themes.
Just replace images with {theme} and update. For example, the default Smile is:
images/smilies/smile.gif
If you want it to be different across themes, just change it to:
{theme}/smilies/smile.gif
(and don't forget to upload all the smilies to the appropriate location)

Thank you so kind. I'll give this a shot in a little bit and let you know how it goes. Big Grin