Scheduled Maintenance: 10-11-2025 Electricity company maintenance between 09:00 and 15:00.

3.2 & 3.3 Extensions Database 3.1 / 3.2Mobile Device

<span class="qte-attr qte_31_32-qte">3.1.x &amp; 3.2.x</span>
User avatar

Topic Author
Sniper_E
VIP
VIP
Posts: 1157
Joined: 14 Oct 2014, 19:01
    Windows 10 Firefox

Re: Mobile Device

Post by Sniper_E »

Webmaster Chuck wrote: 01 Jan 2018, 22:46 What is the best place you folks have found to get the images of the phones?
I get all the images from Google. For example, Dm's logs has a visitor in his logs now. One of his recent donors.

Code: Select all

Mozilla/5.0 (Linux; Android 7.0; SM-G955F Build/NRD90M) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.111 Mobile Safari/537.36
Connected via Android by Charlie_M » less than a minute ago
I Google SM-G955F and find it's a Samsung Galaxy S8. I look around and find the smallest image I can find and save it.
Normally it's a .jpg image. Then I trim off any excess and reduce the size to 32px height, normally it comes out 16px width.
Then I add 8px transparent on each side and the image becomes 32px x 32px in size. Save it as a .png image with the device name.

I have a list showing as Android I've been making that I need to add. If you need help with it Chuck just let me know.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

But yet in this case above we already have the Samsung Galaxy S8 listed in the core/functions.php file.

Code: Select all

				else if (preg_match('/SM-G950F/i',$user_agent))
				{
					$status = $this->user->lang['SGS8'];
				}
We would just add that SM-G955F to that top line and be dm done. hint' hint'

Code: Select all

				else if (preg_match('/SM-G950F|SM-G955F/i',$user_agent))
The defined device name is already in the language file and the image is already there also.
Image
No is NEVER an Option and NEVER is the only Option when it comes to Giving Up!™

User avatar

Unantastbar
Users
Users
Posts: 20
Joined: 18 Jul 2016, 16:58
    Windows 10 Firefox

Re: Mobile Device

Post by Unantastbar »

Hey Sniper,

thx for the Awesome Ext. :tumbsyes:

Here is another Model Number for Samsung Galaxy Tab 4. SM-T535

User avatar

martin
Admin
Admin
Posts: 5106
Joined: 06 Apr 2014, 16:12
    Ubuntu Chrome

Re: Mobile Device

Post by martin »

Samsung tab 4 should be in the latest files i use one and added it or atleast i'm sure i did.
Image

User avatar

Unantastbar
Users
Users
Posts: 20
Joined: 18 Jul 2016, 16:58
    Android Chrome

Re: Mobile Device

Post by Unantastbar »

Not included on this Site. :wink:
Detected as Android.

User avatar

martin
Admin
Admin
Posts: 5106
Joined: 06 Apr 2014, 16:12
    Ubuntu Chrome

Re: Mobile Device

Post by martin »

This site is behind :whistl:

visit mine http://www.martins-phpbb.com/forum/index.php on tab

User avatar

Unantastbar
Users
Users
Posts: 20
Joined: 18 Jul 2016, 16:58
    Windows 10 Firefox

Re: Mobile Device

Post by Unantastbar »

martin wrote: 05 Feb 2018, 19:39 This site is behind :whistl:

visit mine http://www.martins-phpbb.com/forum/index.php on tab
Detected as Android on your Site.

User avatar

Unantastbar
Users
Users
Posts: 20
Joined: 18 Jul 2016, 16:58
    Windows 10 Firefox

Re: Mobile Device

Post by Unantastbar »

Question:

The detected message is shown on the Board index.
What has to be changed, that it is displayed on the board3 Portal?

User avatar

Topic Author
Sniper_E
VIP
VIP
Posts: 1157
Joined: 14 Oct 2014, 19:01
    Windows 10 Firefox

Re: Mobile Device

Post by Sniper_E »

Samsung Galaxy Tab 4 is already added to the list. You just need to add yours.

To add your Samsung Galaxy Tab 4 open core/functions.php

Code: Select all

				else if (preg_match('/SM-T335|SM-T530/i',$user_agent))
Replace with

Code: Select all

				else if (preg_match('/SM-T335|SM-T530|SM-T535/i',$user_agent))
That's it. I added you in at my site.

User avatar

Unantastbar
Users
Users
Posts: 20
Joined: 18 Jul 2016, 16:58
    Windows 10 Firefox

Re: Mobile Device

Post by Unantastbar »

I have already added on my Site
Sniper_E wrote: 09 Feb 2018, 18:28 That's it. I added you in at my site.
1+ works fine

Edit:

On Chrome, Opera, Edge etc. works fine.
Firefox detected as Android . . . :sad:

User avatar

Micha
Users
Users
Posts: 6
Joined: 17 Jan 2018, 16:40
    Windows 7 Firefox

Re: Mobile Device

Post by Micha »

Unantastbar wrote: 09 Feb 2018, 16:59 Question:

The detected message is shown on the Board index.
What has to be changed, that it is displayed on the board3 Portal?
I would have liked that as well :wtf:

User avatar

martin
Admin
Admin
Posts: 5106
Joined: 06 Apr 2014, 16:12
    Ubuntu Chrome

Re: Mobile Device

Post by martin »

Dont have the portal but try this and purge cache.
Open ext/sniper/mobiledevice/styles/prosilver/template/event/overall_header_content_before.html
Find This may be a partial find and not the whole line

Code: Select all

{% if MOBILE_ENABLE && S_MOBILE_WELCOME && S_MOBILE_NAME && SCRIPT_NAME == "index"  %}
Replace with Replace the preceding lines with the following

Code: Select all

{% if MOBILE_ENABLE && S_MOBILE_WELCOME && S_MOBILE_NAME && SCRIPT_NAME == "index" or SCRIPT_NAME == "portal" %}

User avatar

Micha
Users
Users
Posts: 6
Joined: 17 Jan 2018, 16:40
    Windows 7 Firefox

Re: Mobile Device

Post by Micha »

Unfortunately not, no display in the portal

User avatar

Micha
Users
Users
Posts: 6
Joined: 17 Jan 2018, 16:40
    Windows 7 Firefox

Re: Mobile Device

Post by Micha »

But that's the way it works

Code: Select all

{% if MOBILE_ENABLE && S_MOBILE_WELCOME && S_MOBILE_NAME && SCRIPT_NAME == "index" or "portal" %}
:wink:

User avatar

martin
Admin
Admin
Posts: 5106
Joined: 06 Apr 2014, 16:12
    Ubuntu Chrome

Re: Mobile Device

Post by martin »

SCRIPT_NAME == "index" or SCRIPT_NAME == "portal" is how it should be but as i said i dont have the portal to test it.

User avatar

Micha
Users
Users
Posts: 6
Joined: 17 Jan 2018, 16:40
    Windows 7 Firefox

Re: Mobile Device

Post by Micha »

Okay.....

Post Reply Previous topicNext topic