[ABD] [RC] Mobile Device

Any abandoned Extensions will be moved to this forum.

WARNING: Extensions in this forum are not currently being supported or maintained by the original Extension author. Proceed at your own risk.
Forum rules
IMPORTANT: Extension Development Forum rules

WARNING: Extensions in this forum are not currently being supported nor updated by the original Extension author. Proceed at your own risk.
User avatar
2600
I've Been Banned!
Posts: 2567
Joined: Fri Nov 14, 2014 5:14 pm
Location: Area-51

Re: [RC] Mobile Device

Post by 2600 »

I have followed your advice to a T. Here's a screen grab.



Image



Perhaps there's something else I should have done there?

I'll just keep it at Drone though. My UA was pretty long as it was. Just a dorkified joke about radio communications.

Edit-

I did change both though. Wasn't sure if I had to do that or not.
Morpheus: Unfortunately, no one can be told what The Matrix is. You'll have to see it for yourself.
Hack me.
Consider a canary token.
The nature of my chosen username
:ugeek:
User avatar
GanstaZ
Registered User
Posts: 1187
Joined: Wed Oct 11, 2017 10:29 pm
Location: GZOverse

Re: [RC] Mobile Device

Post by GanstaZ »

Look at your last error report and you will see something like Data too long for column 'post_device_title'

Code: Select all

$this-table_prefix . 'posts' => array(
    posts_device_title => array('VCHAR:30', null),
),
Usus est magister optimus! phpBB pre-Triton & latest php environment.
When answer lies in the question, question becomes redundant!
User avatar
2600
I've Been Banned!
Posts: 2567
Joined: Fri Nov 14, 2014 5:14 pm
Location: Area-51

Re: [RC] Mobile Device

Post by 2600 »

Ah, that could be it. I'll test now.

Edit-

That was it. Thanks.

Question: What is the following?

'log_ip'

'user_name'


And the instructions say common.css, but it's common.php in the language/en folder.
Morpheus: Unfortunately, no one can be told what The Matrix is. You'll have to see it for yourself.
Hack me.
Consider a canary token.
The nature of my chosen username
:ugeek:
User avatar
GanstaZ
Registered User
Posts: 1187
Joined: Wed Oct 11, 2017 10:29 pm
Location: GZOverse

Re: [RC] Mobile Device

Post by GanstaZ »

Seems to be ip address and username (poster/session). You should know better, open your phpmyadmin or what module you have and take a look. Don't know anything about instructions.
Usus est magister optimus! phpBB pre-Triton & latest php environment.
When answer lies in the question, question becomes redundant!
User avatar
thecaretaker1
Registered User
Posts: 127
Joined: Tue Dec 30, 2014 8:38 pm

Re: [RC] Mobile Device

Post by thecaretaker1 »

Fantastic work. My users love this extension.

I have a few users where their Android phone model isn't detected. I'd appreciate some help with adding new devices. I can't seem to 'find' a match in the listener.php from page 1 of this thread. I assume the code has changed since then.

One user seen in the logs shows as:

Code: Select all

Mozilla/5.0 (Linux; Android 7.0; Moto G (4) Build/NPJS25.93-14-18) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3497.100 Mobile Safari/537.36 
I think this is a Moto G Plus phone (version 4). I can create an image, but what do I need to do to add devices?

Another is:

Code: Select all

Mozilla/5.0 (Linux; Android 8.0.0; SM-G930F Build/R16NW) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3497.100 Mobile Safari/537.36
I see in common.php language file a list of phones, but cant seem to work out where the mobile device number can be found.

A dummies guide would be useful.
User avatar
Sniper_E
Registered User
Posts: 1142
Joined: Wed May 09, 2007 12:18 am
Location: Shreveport, Louisiana
Name: Ed Humphrey
Contact:

Re: [RC] Mobile Device

Post by Sniper_E »

The info right after the Android text is what you need.

"Moto G" for the fist one and "G930F" for the second one.

Have you looked at the second post for instructions?
I can look closer when I get home to my computer.
Image . -.. / .... ..- -- .--. .... .-. . -.--
No is NEVER an Option and NEVER is the only Option when it comes to Giving Up!

:!: Sniper_E Styles | phpbbmodders :!:
User avatar
Sniper_E
Registered User
Posts: 1142
Joined: Wed May 09, 2007 12:18 am
Location: Shreveport, Louisiana
Name: Ed Humphrey
Contact:

Re: [RC] Mobile Device

Post by Sniper_E »

Double post.
Image . -.. / .... ..- -- .--. .... .-. . -.--
No is NEVER an Option and NEVER is the only Option when it comes to Giving Up!

:!: Sniper_E Styles | phpbbmodders :!:
User avatar
thecaretaker1
Registered User
Posts: 127
Joined: Tue Dec 30, 2014 8:38 pm

Re: [RC] Mobile Device

Post by thecaretaker1 »

Thank you snipper, I'll take a look. Looks like I need to add the lines in the core/functions.php file (not listener.php) then add the phone code to the common language file. (and create an image for it). Is that correct?
User avatar
2600
I've Been Banned!
Posts: 2567
Joined: Fri Nov 14, 2014 5:14 pm
Location: Area-51

Re: [RC] Mobile Device

Post by 2600 »

I'd like to have your device code so I can add it to mine. Thanks.


I think you have that right. If you look at my posts a page or two back, Sniper does give instructions in detail on how to add a new UA.

Better yet, here's the link. viewtopic.php?p=15095496#p15095496


You don't have to mess with the vchar count entry. I had to use 150 since my custom UA I wanted was so long. :lol:
Morpheus: Unfortunately, no one can be told what The Matrix is. You'll have to see it for yourself.
Hack me.
Consider a canary token.
The nature of my chosen username
:ugeek:
User avatar
thecaretaker1
Registered User
Posts: 127
Joined: Tue Dec 30, 2014 8:38 pm

Re: [RC] Mobile Device

Post by thecaretaker1 »

Thank you John. I've only done one so far, but the user that was using the Moto G phone hasn't visited since, but need to check that what I am doing works first. There are many holes in the mobile list and the list is growing as new phones get added. Samsung 9 and 9 Edge, Samsung Galaxy S7, Samsung A5, J5 is missing, HTC One etc. This might become a full time job to keep updated.

Once I know what I am doing is correct and when I have a fair number of phones added and working, I'll let you have a copy to update.
User avatar
2600
I've Been Banned!
Posts: 2567
Joined: Fri Nov 14, 2014 5:14 pm
Location: Area-51

Re: [RC] Mobile Device

Post by 2600 »

I have a Galaxy S7 and if I can remember right, when I visited my forum with my phone it did say "we detected your Android" or something like that. The image that is used, and the UA detection is based mostly on OS I reckon. So I wouldn't think you would need new code for Galaxy S7, Galaxy S6, Galaxy S4, etc, etc.

Tablets might be another matter.

You can test your UA's and the ones you see come to your site. I use the browser Pale Moon with the XUL-based add-on called UAControl. With UAControl you can make your browser look like anything you want. That's how I engage my custom UA on my forum to make it look like I'm posting from a drone. This extension sees my custom UA, and then spits out, "Posted via Drone." with a picture of a small drone.

So with this knowledge you could use UAControl, add the UA you see for testing and see if in fact an image does pop up at the top of your board signifying this extension has detected it. If there isn't any detection, then of course that UA needs to be added to this extension.

Let me test the two UAs you posted and see if anything shows up. If so I'll post screen shots.

Here's the extension, but not compatible with the latest version of FF. The beauty of Pale Moon is that it still uses XUL and not asinine webextensions that FF chooses to use now to code add-ons. https://addons.mozilla.org/en-US/firefo ... uacontrol/

Older versions of Firefox here: http://www.oldapps.com/betasearch.php?c ... &q=firefox
Morpheus: Unfortunately, no one can be told what The Matrix is. You'll have to see it for yourself.
Hack me.
Consider a canary token.
The nature of my chosen username
:ugeek:
User avatar
2600
I've Been Banned!
Posts: 2567
Joined: Fri Nov 14, 2014 5:14 pm
Location: Area-51

Re: [RC] Mobile Device

Post by 2600 »

Okay, tested your two useragents above, and in fact this extension detects them as Android. Doesn't matter if it's a Moto or not. Here's what both UAs show.

Image

So no new code needed unless of course you wanted to fine-grain the UA to actually say this person is using a Moto, etc.
Morpheus: Unfortunately, no one can be told what The Matrix is. You'll have to see it for yourself.
Hack me.
Consider a canary token.
The nature of my chosen username
:ugeek:
User avatar
thecaretaker1
Registered User
Posts: 127
Joined: Tue Dec 30, 2014 8:38 pm

Re: [RC] Mobile Device

Post by thecaretaker1 »

I've got the hang of it now. Here are the added phones I have done so far with their images as seen in my logs. I've spaced out the entries in the function.php file so you can see the additions.

Mobiles.zip

''Moto G',
'Samsung Galaxy S5 Neo',
'ZTE Majesty Pro Plus LTE',
'Samsung Galaxy J5',
'Samsung Galaxy S7',
'Samsung Galaxy S9',
'Samsung Galaxy S9 Edge',
'Samsung Galaxy J3',
'Huawei P10 Lite',
'Samsung Galaxy S8',
'Samsung Galaxy S8 Edge',
'Sony Xperia M4 Aqua',
'Sony Xperia X',
'Huawei Honor 9',
'HUAWEI MadiaPad',
'OnePlus',
'Acer Iconia',
'Samsung Galaxy J3',
User avatar
Sniper_E
Registered User
Posts: 1142
Joined: Wed May 09, 2007 12:18 am
Location: Shreveport, Louisiana
Name: Ed Humphrey
Contact:

Re: [RC] Mobile Device

Post by Sniper_E »

thecaretaker1 wrote: Sun Oct 07, 2018 10:45 pm There are many holes in the mobile list and the list is growing as new phones get added. Samsung 9 and 9 Edge, Samsung Galaxy S7, Samsung A5, J5 is missing, HTC One etc. This might become a full time job to keep updated.
Yea I know, been there... david63 brought it up at the start of the topic, if this could read a database and recognize the phone but I see no way.
I have some programmer friends that have said that anything is possible when programming. But that would be difficult for anyone.
I'll check your work out and add it in the files. Thank you for sharing!
Image . -.. / .... ..- -- .--. .... .-. . -.--
No is NEVER an Option and NEVER is the only Option when it comes to Giving Up!

:!: Sniper_E Styles | phpbbmodders :!:
User avatar
GanstaZ
Registered User
Posts: 1187
Joined: Wed Oct 11, 2017 10:29 pm
Location: GZOverse

Re: [RC] Mobile Device

Post by GanstaZ »

Maybe something like this can help you a little => Mobile-Detect.
Usus est magister optimus! phpBB pre-Triton & latest php environment.
When answer lies in the question, question becomes redundant!
Locked

Return to “Abandoned Extensions”