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

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

Re: Mobile Device

Post by Unantastbar »

It's not the best solution but it works.

Code: Select all

{% if MOBILE_ENABLE && S_MOBILE_WELCOME && S_MOBILE_NAME && SCRIPT_NAME == "app/portal" %}

User avatar

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

Re: Mobile Device

Post by martin »

{% if MOBILE_ENABLE && S_MOBILE_WELCOME && S_MOBILE_NAME && SCRIPT_NAME == "app/portal" %}

Remove the app/ its not needed.
Image

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 »

Using that if statement may show on portal only.
Image
No is NEVER an Option and NEVER is the only Option when it comes to Giving Up!™

User avatar

ivailo95
Users
Users
Posts: 918
Joined: 02 Feb 2018, 12:04
    Windows 7 Opera

Re: Mobile Device

Post by ivailo95 »

My user told me that there is problem with user_agent
he e is with browser safari
this is his user agent: Mozilla/5.0 (iPhone; CPU iPhone OS 11_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/11.0 Mobile/15E148 Safari/604.1
this user used safari (facebook browser) browser
You do not have the required permissions to view the files attached to this post! Maybe your post count is too low.
Feed like a disease
And bring them to their knees
They'll pay for their deceit

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 »

ivailo95 wrote: 11 Jul 2018, 11:04Mozilla/5.0 (iPhone; CPU iPhone OS 11_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/11.0 Mobile/15E148 Safari/604.1
That is 135 characters. User agent is setup for 255 characters. 'user_agent' => array('VCHAR:255', ''),
He should have been picked up using iPhone with that user agent info. You may have a different problem.

Not sure about safari (facebook browser) browser Maybe it is adding to the user agent string making it more than 255 characters.
Have him connect to here or at my test site with that browser and see if he has that problem.

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 »

The correct syntax for that if statement for portal would be written like this...

{% if MOBILE_ENABLE && S_MOBILE_WELCOME && S_MOBILE_NAME && (SCRIPT_NAME == "index" || SCRIPT_NAME == "app/portal") %}

Given that SCRIPT_NAME == "app/portal" works in the portal as Unantastbar stated.

User avatar

ivailo95
Users
Users
Posts: 918
Joined: 02 Feb 2018, 12:04
    Windows 7 Opera

Re: Mobile Device

Post by ivailo95 »

So...what i need to edit to be correct?

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 »

This post was directed to you ivailo95
Sniper_E wrote: 12 Jul 2018, 21:28
ivailo95 wrote: 11 Jul 2018, 11:04Mozilla/5.0 (iPhone; CPU iPhone OS 11_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/11.0 Mobile/15E148 Safari/604.1
That is 135 characters. User agent is setup for 255 characters. 'user_agent' => array('VCHAR:255', ''),
He should have been picked up using iPhone with that user agent info. You may have a different problem.

Not sure about safari (facebook browser) browser Maybe it is adding to the user agent string making it more than 255 characters.
Have him connect to here or at my test site with that browser and see if he has that problem.
The last post of mine was directed to earlier posts about the correct if statement syntax used for portals. Not for you ivailo95
Sniper_E wrote: 12 Jul 2018, 21:35 The correct syntax for that if statement for portal would be written like this...

{% if MOBILE_ENABLE && S_MOBILE_WELCOME && S_MOBILE_NAME && (SCRIPT_NAME == "index" || SCRIPT_NAME == "app/portal") %}

Given that SCRIPT_NAME == "app/portal" works in the portal as Unantastbar stated.
ivailo95 have your guy try his safari (facebook browser) browser here at this site, martin's site or at my test site and see if he has that problem.
I would like to see what the issue is. Your explanation to the problem he is having does not add up.

User avatar

ivailo95
Users
Users
Posts: 918
Joined: 02 Feb 2018, 12:04
    Windows 7 Opera

Re: Mobile Device

Post by ivailo95 »

The guy who told me about the problem tell me that here he can visit this site

User avatar

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

Re: Mobile Device

Post by martin »

This site is using an older version get him to visit mine https://www.martins-phpbb.com/forum/index.php mine is latest with a few added device's

User avatar

ivailo95
Users
Users
Posts: 918
Joined: 02 Feb 2018, 12:04
    Windows 7 Opera

Re: Mobile Device

Post by ivailo95 »

martin wrote: 29 Jul 2018, 17:20 This site is using an older version get him to visit mine https://www.martins-phpbb.com/forum/index.php mine is latest with a few added device's
He said: Same error as yours board
You do not have the required permissions to view the files attached to this post! Maybe your post count is too low.

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 »

ivailo95 wrote: 11 Jul 2018, 11:04 This is his user agent: Mozilla/5.0 (iPhone; CPU iPhone OS 11_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/11.0 Mobile/15E148 Safari/604.1
this user used safari (facebook browser) browser
Do you understand this below that I already posted?
Sniper_E wrote: 12 Jul 2018, 21:28 That is 135 characters. User agent is setup for 255 characters. 'user_agent' => array('VCHAR:255', ''),
If he is getting the error that the data is too long for the user_agent field then that is not his user agent that is being detected.
You are providing the wrong information for his user agent. It has to be more than 255 characters to get that error.

You have three options...
1. Increase the 'user_agent' => array('VCHAR:255', ''), in the migration file and reinstall the extension.
2. Have him use a different browser other than that safari (facebook browser) browser. Whatever that is.
3. Disable the mobile device ext and delete the files off your server.

User avatar

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

Re: Mobile Device

Post by martin »

I have to admit i'v not had a problem with the ext i guess he needs to use a modern browser i'v not heard of the one he is using.

User avatar

ivailo95
Users
Users
Posts: 918
Joined: 02 Feb 2018, 12:04
    Windows 7 Opera

Re: Mobile Device

Post by ivailo95 »

How long i need to set it up?

Code: Select all

<?php
/**
* @package phpBB Extension - Mobile Device
* @copyright (c) 2015 Sniper_E - http://www.sniper-e.com
* @copyright (c) 2015 dmzx - http://www.dmzx-web.net
* @copyright (c) 2015 martin - http://www.martins-phpbb.com
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
*/

namespace sniper\mobiledevice\migrations;

class mobiledevice_schema extends \phpbb\db\migration\migration
{
	public function update_schema()
	{
		return 	array(
			'add_columns' => array(
				$this->table_prefix . 'users' => array(
					'mobile_browser'      => array('UINT:1', 0),
					'device_name'         => array('VCHAR:30', null),
					'user_mobile_welcome' => array('BOOL', 1),
					'user_mobile_header'  => array('BOOL', 1),
					'user_mobile_self'    => array('BOOL', 1),
				),
				$this->table_prefix . 'posts' => array(
					'post_device_title' => array('VCHAR:30', null),
				),
			),
			'add_tables'	=> array(
				$this->table_prefix . 'mobile_logs'	=> array(
					'COLUMNS' => array(
					'log_id'      => array('UINT', null, 'auto_increment'),
					'log_ip'      => array('VCHAR:15', ''),
					'log_time'    => array('INT:11', 0),
					'device_name' => array('VCHAR:30', ''),
					'user_name'   => array('VCHAR:30', ''),
					'user_agent'  => array('VCHAR:255', ''),
					),
					'PRIMARY_KEY' => 'log_id',
				),
			),
		);
	}

	public function revert_schema()
	{
		return 	array(
			'drop_columns' => array(
				$this->table_prefix . 'users' => array(
					'mobile_browser',
					'device_name',
					'user_mobile_welcome',
					'user_mobile_header',
					'user_mobile_self',
				),
				$this->table_prefix . 'posts' => array(
					'post_device_title',
				),
			),
			'drop_tables' => array(
				$this->table_prefix . 'mobile_logs',
			),
		);
	}
}
When i reinstal the extension he saw he can visit my board

User avatar

wads24
Donator
Donator
Posts: 125
Joined: 19 Mar 2017, 19:30
    Windows 10 Chrome

Re: Mobile Device

Post by wads24 »

:wall: :wall: :wall: :wall:

I had this extension installed and working great. Not sure what I did, but when I went to install and enable again it said 405 not allowed, also will not let me delete data.

Post Reply Previous topicNext topic