[RC] Mobile Device

A place for Extension Authors to post and receive feedback on Extensions still in development. No Extensions within this forum should be used within a live environment!
Suggested Hosts
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

IMPORTANT: Extensions Development rules

IMPORTANT FOR NEEDED EVENTS!!!
If you need an event for your extension please read this for the steps to follow to request the event(s)
User avatar
John connor
Registered User
Posts: 1800
Joined: Fri Nov 14, 2014 5:14 pm
Location: U S Of A
Contact:

Re: [RC] Mobile Device

Post by John connor » Thu Oct 04, 2018 4:36 am

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.

User avatar
GanstaZ
Registered User
Posts: 568
Joined: Wed Oct 11, 2017 10:29 pm
Location: Zverse

Re: [RC] Mobile Device

Post by GanstaZ » Thu Oct 04, 2018 5:06 am

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),
),
"When answer lies in the question,.. question becomes redundant!"

User avatar
John connor
Registered User
Posts: 1800
Joined: Fri Nov 14, 2014 5:14 pm
Location: U S Of A
Contact:

Re: [RC] Mobile Device

Post by John connor » Thu Oct 04, 2018 1:08 pm

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.

User avatar
GanstaZ
Registered User
Posts: 568
Joined: Wed Oct 11, 2017 10:29 pm
Location: Zverse

Re: [RC] Mobile Device

Post by GanstaZ » Fri Oct 05, 2018 8:14 am

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.
"When answer lies in the question,.. question becomes redundant!"

User avatar
thecaretaker1
Registered User
Posts: 46
Joined: Tue Dec 30, 2014 8:38 pm

Re: [RC] Mobile Device

Post by thecaretaker1 » Sun Oct 07, 2018 5:28 pm

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: 730
Joined: Wed May 09, 2007 12:18 am
Location: Shreveport, Louisiana
Name: Ed Humphrey
Contact:

Re: [RC] Mobile Device

Post by Sniper_E » Sun Oct 07, 2018 9:10 pm

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: 730
Joined: Wed May 09, 2007 12:18 am
Location: Shreveport, Louisiana
Name: Ed Humphrey
Contact:

Re: [RC] Mobile Device

Post by Sniper_E » Sun Oct 07, 2018 9:10 pm

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: 46
Joined: Tue Dec 30, 2014 8:38 pm

Re: [RC] Mobile Device

Post by thecaretaker1 » Sun Oct 07, 2018 9:15 pm

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
John connor
Registered User
Posts: 1800
Joined: Fri Nov 14, 2014 5:14 pm
Location: U S Of A
Contact:

Re: [RC] Mobile Device

Post by John connor » Sun Oct 07, 2018 10:03 pm

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:

User avatar
thecaretaker1
Registered User
Posts: 46
Joined: Tue Dec 30, 2014 8:38 pm

Re: [RC] Mobile Device

Post by thecaretaker1 » Sun Oct 07, 2018 10:45 pm

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
John connor
Registered User
Posts: 1800
Joined: Fri Nov 14, 2014 5:14 pm
Location: U S Of A
Contact:

Re: [RC] Mobile Device

Post by John connor » Mon Oct 08, 2018 4:12 am

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

User avatar
John connor
Registered User
Posts: 1800
Joined: Fri Nov 14, 2014 5:14 pm
Location: U S Of A
Contact:

Re: [RC] Mobile Device

Post by John connor » Mon Oct 08, 2018 4:41 am

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.

User avatar
thecaretaker1
Registered User
Posts: 46
Joined: Tue Dec 30, 2014 8:38 pm

Re: [RC] Mobile Device

Post by thecaretaker1 » Tue Oct 09, 2018 4:39 am

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: 730
Joined: Wed May 09, 2007 12:18 am
Location: Shreveport, Louisiana
Name: Ed Humphrey
Contact:

Re: [RC] Mobile Device

Post by Sniper_E » Tue Oct 09, 2018 9:25 pm

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: 568
Joined: Wed Oct 11, 2017 10:29 pm
Location: Zverse

Re: [RC] Mobile Device

Post by GanstaZ » Tue Oct 09, 2018 9:41 pm

Maybe something like this can help you a little => Mobile-Detect.
"When answer lies in the question,.. question becomes redundant!"

Post Reply

Return to “Extensions in Development”

Who is online

Users browsing this forum: No registered users and 257 guests