[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
Sniper_E
Registered User
Posts: 1144
Joined: Wed May 09, 2007 12:18 am
Location: Shreveport, Louisiana
Name: Ed Humphrey
Contact:

Re: [RC] Mobile Device

Post by Sniper_E »

John connor wrote: Thu Mar 29, 2018 7:08 am Hi. I'm using this extension in 3.2.2 and it works well, I haven't upgraded to the latest yet since I have a custom UA there and I need to modify the code again which I can't remember off hand now to do the upgrade. But my question is I get an error with using PHP 7.2.3.
I run the latest version of mobile device on 3.2.2 and I have php 7.2.3 installed with no issues at all.
Maybe you need to update to the latest copy of mobile device.

What ever you did for your custom UA would probable be in the event/listener.php file.
In the updated copy you would add that code in the core/functions.php file.

And as far as your other question, that has nothing to do with the mobile device ext. I can't help you with that.
Image . -.. / .... ..- -- .--. .... .-. . -.--
No is NEVER an Option and NEVER is the only Option when it comes to Giving Up!

:!: Sniper_E Styles | phpbbmodders :!:
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 »

Hi, been getting this error in error_log.


[19-Sep-2018 09:07:03 America/Denver] PHP Warning: Cannot modify header information - headers already sent by (output started at /home/systechf/public_html/website/includes/functions.php:3291) in /home/systechf/public_html/website/ext/sniper/mobiledevice/event/listener.php on line 542
[19-Sep-2018 09:07:03 America/Denver] PHP Warning: Cannot modify header information - headers already sent by (output started at /home/systechf/public_html/website/includes/functions.php:3291) in /home/systechf/public_html/website/ext/sniper/mobiledevice/event/listener.php on line 543
[19-Sep-2018 09:07:03 America/Denver] PHP Warning: Cannot modify header information - headers already sent by (output started at /home/systechf/public_html/website/includes/functions.php:3291) in /home/systechf/public_html/website/ext/sniper/mobiledevice/event/listener.php on line 542
[19-Sep-2018 09:07:03 America/Denver] PHP Warning: Cannot modify header information - headers already sent by (output started at /home/systechf/public_html/website/includes/functions.php:3291) in /home/systechf/public_html/website/ext/sniper/mobiledevice/event/listener.php on line 543
[19-Sep-2018 09:07:03 America/Denver] PHP Warning: Cannot modify header information - headers already sent by (output started at /home/systechf/public_html/website/includes/functions.php:3291) in /home/systechf/public_html/website/includes/functions.php on line 4541
[19-Sep-2018 09:07:03 America/Denver] PHP Warning: Cannot modify header information - headers already sent by (output started at /home/systechf/public_html/website/includes/functions.php:3291) in /home/systechf/public_html/website/includes/functions.php on line 4541
[19-Sep-2018 09:07:03 America/Denver] PHP Warning: Cannot modify header information - headers already sent by (output started at /home/systechf/public_html/website/includes/functions.php:3291) in /home/systechf/public_html/website/includes/functions.php on line 4541
[19-Sep-2018 09:07:03 America/Denver] PHP Warning: Cannot modify header information - headers already sent by (output started at /home/systechf/public_html/website/includes/functions.php:3291) in /home/systechf/public_html/website/phpbb/json_response.php on line 29
Using phpBB 3.2.3 and PHP 7.1
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
Sniper_E
Registered User
Posts: 1144
Joined: Wed May 09, 2007 12:18 am
Location: Shreveport, Louisiana
Name: Ed Humphrey
Contact:

Re: [RC] Mobile Device

Post by Sniper_E »

I'm not sure what to tell you, I'm running phpBB 3.2.3 with php 7.2.9 and mobiledevice 1.0.6 and all is smooth.

You would have to add your special text back in but you could try a fresh mobile install.
Image . -.. / .... ..- -- .--. .... .-. . -.--
No is NEVER an Option and NEVER is the only Option when it comes to Giving Up!

:!: Sniper_E Styles | phpbbmodders :!:
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 »

Yeah, I'm not using that latest because adding my custom UA was a PITA. But I'll goo ahead and tackle this and see how it goes with an update.
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 »

So I tried adding my custom drone UA to the latest version without success. In fact, when I activated the extension in my test board I got a blank white page. I had to reupload a backup database to correct the problem.

My code looks like this in functions.php.



public function mobile_device_detect($iphone = true, $ipod = true, $ipad = true, $android = true, $opera = true, $blackberry = true, $palm = true, $windows = true, $lg = true $drone = true)

I see now what I did wrong there. Forgot the comma.

My other code at around line 353.

Code: Select all

break;
				case (preg_match('/777/i',$user_agent));
                $status = 'Drone using encrypted SSH, L2TP, P25, Astro, Provoice-ESK, Tetra, VSLEP, DECT 6.0, WPA2-PSK with a dash of SSL';
                $mobile_browser = true;
            break;

			default;
				$status = $this->user->lang['DESKTOP'];
				$mobile_browser = false;
			break;
			
I also went into migrations and changed this: 'device_name' => array('VCHAR:70', ''), to make sure my very long custom UA works.



Is there something I'm missing here? Did I do anything wrong other than that missing comma?


Edit-

Doing a online character count, it appears it's 110 characters for that UA. I shall change that.
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, I uploaded my changed code and this time there's no blank white page, but my custom UA doesn't show up. So obviously something is wrong with my code.
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
Sniper_E
Registered User
Posts: 1144
Joined: Wed May 09, 2007 12:18 am
Location: Shreveport, Louisiana
Name: Ed Humphrey
Contact:

Re: [RC] Mobile Device

Post by Sniper_E »

You can add the switch below without adding the , $drone = true in that top line.

All you need to do is add this case:

Code: Select all

		switch (true)
		{		
			case (preg_match('/777/i',$user_agent));
				$status = $this->user->lang['DRONE'];
				$mobile_browser = true;
			break;
Using $mobile_browser = true; tags it as being mobile.

Then in the common.php language file add your drone below the desktop line.

Code: Select all

	'DRONE'         => 'Drone using encrypted SSH, L2TP, P25, Astro, Provoice-ESK, Tetra, VSLEP, DECT 6.0, WPA2-PSK with a dash of SSL',
And of course edit for the 110 characters in that UA name before installing again.

Then your (Drone using encrypted SSH, L2TP, P25, Astro, Provoice-ESK, Tetra, VSLEP, DECT 6.0, WPA2-PSK with a dash of SSL.png) image.
Image . -.. / .... ..- -- .--. .... .-. . -.--
No is NEVER an Option and NEVER is the only Option when it comes to Giving Up!

:!: Sniper_E Styles | phpbbmodders :!:
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, I don't know PHP so bear with me here. I went to functions.php and at line 352 I added this:
break;

case (preg_match('/777/i',$user_agent));
$status = $this->user->lang['DRONE'];
$mobile_browser = true;
break;


Now in common.php under 'DESKTOP' => 'Desktop', I added:

'DRONE' => 'Drone using encrypted SSH, L2TP, P25, Astro, Provoice-ESK, Tetra, VSLEP, DECT 6.0, WPA2-PSK with a dash of SSL',


Despite that my drone does not show up so obviously I did something wrong. I did reinstall the ext with my new code and purged the cache. The image is there.
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 »

I changed $mobile_browser = false; and that still doesn't work.

I swear, by the time I get this working I might just be able to code my own damn extensions. 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
Sniper_E
Registered User
Posts: 1144
Joined: Wed May 09, 2007 12:18 am
Location: Shreveport, Louisiana
Name: Ed Humphrey
Contact:

Re: [RC] Mobile Device

Post by Sniper_E »

Steps to get your special drone to show up in device detection...

1. Download mobiledevice_1.0.6.zip and extract it to your hard drive.

2. Edit the extracted mobiledevice/migrations/mobiledevice_schema.php FIND

Code: Select all

					'device_name'	=> array('VCHAR:30', ''),
REPLACE with

Code: Select all

					'device_name'	=> array('VCHAR:150', ''),
3. Edit the extracted mobiledevice/core/functions.php FIND

Code: Select all

			case (preg_match('/x86_64|WOW64|Win64|Iceweasel/i',$user_agent) && $this->config['mobile_test_enable']);
ADD before

Code: Select all

			case (preg_match('/777/i',$user_agent));
				$status = $this->user->lang['DRONE'];
				$mobile_browser = true;
			break;
4. Edit the extracted mobiledevice/language/en/common.php FIND

Code: Select all

	'DESKTOP'       => 'Desktop',
ADD after

Code: Select all

	'DRONE'         => 'Drone using encrypted SSH, L2TP, P25, Astro, Provoice-ESK, Tetra, VSLEP, DECT 6.0, WPA2-PSK with a dash of SSL',
5. Copy your Drone using encrypted SSH, L2TP, P25, Astro, Provoice-ESK, Tetra, VSLEP, DECT 6.0, WPA2-PSK with a dash of SSL.png
image to the extracted mobiledevice/images/ directory.

OK that should give you what you need on your server.

6. Disable mobiledevice ext in acp, delete data and then delete mobiledevice directory from your server.

7. Copy new extracted... edited files to your server and enable mobiledevice ext.

Good luck and hope that works for you.
Last edited by Sniper_E on Tue Oct 09, 2018 9:28 pm, edited 2 times in total.
Image . -.. / .... ..- -- .--. .... .-. . -.--
No is NEVER an Option and NEVER is the only Option when it comes to Giving Up!

:!: Sniper_E Styles | phpbbmodders :!:
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 »

And it works! Thanks. Looks like my case was in the wrong spot.
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
Sniper_E
Registered User
Posts: 1144
Joined: Wed May 09, 2007 12:18 am
Location: Shreveport, Louisiana
Name: Ed Humphrey
Contact:

Re: [RC] Mobile Device

Post by Sniper_E »

Yes indeed, if it read the case (preg_match('/x86_64|WOW64|Win64|Iceweasel/i',$user_agent)
before it reads your case (preg_match('/777/i',$user_agent)) then it would not ever read your case.

Once a case is found and gives the results of $mobile_browser = ????; then the query is over.
It will go to the end of the script and will not read any other cases.

So if you have two different cases that will be recognized then you have to put the one you want to show first.
But I'm sure you have all of that figured out by now. Glad you got it working again. You're a master with that now... :)
Image . -.. / .... ..- -- .--. .... .-. . -.--
No is NEVER an Option and NEVER is the only Option when it comes to Giving Up!

:!: Sniper_E Styles | phpbbmodders :!:
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 »

Looks like I have an issue now with this new updated extension I never had before. Making a post with my custom UA, I see this:



SQL ERROR [ mysqli ]

Data too long for column 'post_device_title' at row 1 [1406]

SQL

INSERT INTO phpbb_posts (forum_id, poster_id, icon_id, poster_ip, post_time, post_visibility, enable_bbcode, enable_smilies, enable_magic_url, enable_sig, post_username, post_subject, post_text, post_checksum, post_attachment, bbcode_bitfield, bbcode_uid, post_postcount, post_edit_locked, post_device_title, topic_id) VALUES (2, 2, 0, '1.2.3.4', 1538478331, 1, 1, 1, 1, 1, '', 'Test', '<t>Test</t>', '0cbc6611f5540bd0809a388dc95a615b', 0, '', '3bgcqyq2', 1, 0, 'Drone using encrypted SSH, L2TP, P25, Astro, Provoice-ESK, Tetra, VSLEP, DECT 6.0, WPA2-PSK with a dash of SSL', 546)

BACKTRACE

FILE: (not given by php)
LINE: (not given by php)
CALL: msg_handler()

FILE: [ROOT]/phpbb/db/driver/driver.php
LINE: 997
CALL: trigger_error()

FILE: [ROOT]/phpbb/db/driver/mysqli.php
LINE: 193
CALL: phpbb\db\driver\driver->sql_error()

FILE: [ROOT]/phpbb/db/driver/factory.php
LINE: 329
CALL: phpbb\db\driver\mysqli->sql_query()

FILE: [ROOT]/includes/functions_posting.php
LINE: 1887
CALL: phpbb\db\driver\factory->sql_query()

FILE: [ROOT]/posting.php
LINE: 1445
CALL: submit_post()
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 »

Never mind. To make life simpler I just edited my long custom UA to simply "Drone" instead.
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
Sniper_E
Registered User
Posts: 1144
Joined: Wed May 09, 2007 12:18 am
Location: Shreveport, Louisiana
Name: Ed Humphrey
Contact:

Re: [RC] Mobile Device

Post by Sniper_E »

You say you have never seen that error before?
Data too long for column 'post_device_title' at row 1 [1406]
You have reported that error 9 times in this topic.

Connect to phpmyadmin and look in the db for your site, look in the config table, scroll way over to the right and look at the value of the post_device_title column. If it is not set to 150 then you did not follow my directions to the letter. If it is not set to 150 then edit the config table and change that post_device_title value in phpmyadmin.

You have to troubleshoot that problem. I can not see your database. You find the problem and fix it or just stay with 'Drone' I have helped you all I can with that special drone of yours.
Image . -.. / .... ..- -- .--. .... .-. . -.--
No is NEVER an Option and NEVER is the only Option when it comes to Giving Up!

:!: Sniper_E Styles | phpbbmodders :!:
Locked

Return to “Abandoned Extensions”