:Solved: Need help disabling smileys

For support and discussion related to templates, themes, and imagesets in phpBB 3.0.
Get Involved
Locked
Philthy
Registered User
Posts: 210
Joined: Tue Dec 27, 2005 10:05 am
Location: Dawlish, Devon
Contact:

:Solved: Need help disabling smileys

Post by Philthy » Sun Oct 04, 2009 3:52 pm

One for the phpbb gurus :geek:
I'm running a mobile theme for my forum, and have a problem with the smilies appearing larger than they should.
I would like to simply disable them. I can of course disable smilies in the admin control panel, but that would get rid of them for every user. I have a small piece of code that apparently disables them, but have no idea which file, or where to place it.
Has anyone got any idea?
Here's the code:

Code: Select all

$config['allow_smilies'] = 0;
Thanks in advance
Last edited by prototech on Fri Oct 09, 2009 5:36 pm, edited 2 times in total.
Reason: Topic icon changed
Go on ! it's not as steep as it looks.....

User avatar
prototech
Former Team Member
Posts: 5406
Joined: Mon Mar 19, 2007 2:04 pm
Location: Southern California

Re: Need help disabling smileys

Post by prototech » Mon Oct 05, 2009 11:10 pm

In includes/functions_content.php, find:

Code: Select all

    if ($force_option || !$config['allow_smilies'] || !$user->optionget('viewsmilies')) 
Before, add:

Code: Select all

    $check_style = ($config['override_user_style']) ? $config['default_style'] : $user->data['user_style'];

    if ($check_style == 1)
    {
        $config['allow_smilies'] = 0;
    }
 
Adjust "1" to match the style's id.
Need help with MOD/style installations or other phpBB problems? Contact me for a quote.

Philthy
Registered User
Posts: 210
Joined: Tue Dec 27, 2005 10:05 am
Location: Dawlish, Devon
Contact:

Re: Need help disabling smileys

Post by Philthy » Fri Oct 09, 2009 12:05 pm

It didn't work.
I tried emptying the cache, and refreshing the template/theme, but the smilies were still showing?

Thanks for your post though.

Edit to add:

Strange, it works if I set it to style 1, The smilies are replaced by the code for them, but not for style 2, the mobile theme I'm trying to disable them from?

Hmmmmm
Go on ! it's not as steep as it looks.....

Philthy
Registered User
Posts: 210
Joined: Tue Dec 27, 2005 10:05 am
Location: Dawlish, Devon
Contact:

Re: Need help disabling smileys

Post by Philthy » Fri Oct 09, 2009 12:29 pm

Even odder, I set it to style 1, and checked on my iphone, which is set to switch to the mobile theme automatically, and they didn't display.

This code in session.php sets the mobile theme:

Code: Select all

          $user_browser = strtolower($this->browser);
          $this->data['is_mobile'] = false;
          $browsers_array = array('240x320', '320x240','blackberry', 'iemobile', 'minimobile', 'mobile', 'opera mini', 'pda', 'phone', 'pocket', 'psp', 'symbian', 't-shark', 'wireless');
          foreach ($browsers_array as $ua_match)
          {
             if (strpos($user_browser, $ua_match) !== false)
             {
                $style = 2;
                $this->data['is_mobile'] = true;
                break;
             }
          }
Somehow, it isn't communicating the style switchover?
Go on ! it's not as steep as it looks.....

User avatar
prototech
Former Team Member
Posts: 5406
Joined: Mon Mar 19, 2007 2:04 pm
Location: Southern California

Re: Need help disabling smileys

Post by prototech » Fri Oct 09, 2009 4:31 pm

Change:

Code: Select all

    $check_style = ($config['override_user_style']) ? $config['default_style'] : $user->data['user_style'];

    if ($check_style == 1)
    {
        $config['allow_smilies'] = 0;
    }
 
To:

Code: Select all

    if ($user->data['is_mobile'])
    {
        $config['allow_smilies'] = 0;
    }
 
Need help with MOD/style installations or other phpBB problems? Contact me for a quote.

Philthy
Registered User
Posts: 210
Joined: Tue Dec 27, 2005 10:05 am
Location: Dawlish, Devon
Contact:

Re: Need help disabling smileys

Post by Philthy » Fri Oct 09, 2009 5:12 pm

Thanks for that, I'll give it a try when I get home.
Go on ! it's not as steep as it looks.....

Philthy
Registered User
Posts: 210
Joined: Tue Dec 27, 2005 10:05 am
Location: Dawlish, Devon
Contact:

Re: Need help disabling smileys

Post by Philthy » Fri Oct 09, 2009 5:34 pm

That has worked :D
Thanks very much.
Go on ! it's not as steep as it looks.....

Captain Jim
Registered User
Posts: 32
Joined: Thu Aug 19, 2004 11:58 pm
Contact:

Re: :Solved: Need help disabling smileys

Post by Captain Jim » Mon Feb 01, 2010 4:56 pm

I'm running the same mobile forums and this worked perfectly.

THANKS!!! I was really struggling with this, and the solution was so simple. :mrgreen:

Locked

Return to “[3.0.x] Styles Support & Discussion”