Scheduled Maintenance:  10-11-2025 Electricity company maintenance between 09:00 and 15:00.
<span class="qte-attr qte_31_32-qte">3.1.x & 3.2.x</span>
			
		
		
			
				
								Sniper_E 							 
						VIP 			
		Posts:  1157Joined:  14 Oct 2014, 19:01 
		
						
			
		
													
							
						
				
											Post  
				by Sniper_E  03 Nov 2017, 22:09 
			
			
			
			
			
			sc4t  wrote: 03 Nov 2017, 11:12 
Hello!
How to add Windows Mobile Phones?
Exemple:  Mozilla/5.0 (Windows Phone 10.0; Android 4.2.1; Microsoft; Lumia 640 XL LTE Dual SIM) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2486.0 Mobile Safari/537.36 Edge/13.10586
There is a section in the event/listener.php file for the Windows phone. Down past line 500.
Code: Select all 
			case (preg_match('/(iris|3g_t|windows ce|windows Phone|opera mobi|windows ce; smartphone;|windows ce; iemobile)/i',$user_agent));
				$status = $this->user->lang['WSP'];
				$mobile_browser = $windows;
			break;
None of these pick up your windows phone?
(iris|3g_t|windows ce|windows Phone|opera mobi|windows ce; smartphone;|windows ce; iemobile) 
Change that section to this...
Code: Select all 
			case (preg_match('/(iris|3g_t|windows ce|windows Phone|opera mobi|windows ce; smartphone;|windows ce; iemobile)/i',$user_agent));
				if (preg_match('/Lumia 640 XL/i',$user_agent))
				{
					$status = $this->user->lang['L640XL'];
				}
				else
				{
					$status = $this->user->lang['WSP'];
				}
				$mobile_browser = $windows;
			break;
Open the language/en/common.php and FIND
After ADD on a new line
Then add this image to the images/ directory with the other images. 
I have you added at my place. 
No is NEVER an Option and NEVER is the only Option when it comes to Giving Up!™  
		 
				
								
		 
		 
	 
	
		
		
			
				
								sc4t 							 
						Users 			
		Posts:  7Joined:  20 Aug 2015, 10:01 
		
						
			
		
													
							
						
				
											Post  
				by sc4t  04 Nov 2017, 09:27 
			
			
			
			
			
			Thank you very much for your help Sniper 
the line was not found
Code: Select all 
<?php
/**
* @package Mobile Device Extension
* @copyright (c) 2015 Sniper_E - http://sniper-e.com
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
*/
/**
* DO NOT CHANGE
*/
if (!defined('IN_PHPBB'))
{
    exit;
}
if (empty($lang) || !is_array($lang))
{
    $lang = array();
}
// DEVELOPERS PLEASE NOTE
//
// All language files should use UTF-8 as their encoding and the files must not contain a BOM.
//
// Placeholders can now contain order information, e.g. instead of
// 'Page %s of %s' you can (and should) write 'Page %1$s of %2$s', this allows
// translators to re-order the output of data while ensuring it remains correct
//
// You do not need this where single placeholders are used, e.g. 'Message %d' is fine
// equally where a string contains only two placeholders which are used to wrap text
// in a url you again do not need to specify an order e.g., 'Click %sHERE%s' is fine
//
// Some characters you may want to copy&paste:
// ’ » “ ” …
//
$lang = array_merge($lang, array(
    'POST_MADE_VIA'         => 'Publier depuis un(e)',
    'MOBILE_DEVICE'         => 'Appareil mobile',
    'MOBILE_DEVICE_LOGIN'   => 'Connecté depuis un(e)',
    'MOBILE_POST'           => 'Bienvenue',
    'MOBILE_POST_AFT1'      => 'Nous avons détecté votre',
    'MOBILE_POST_AFT2'      => 'Détecté',
	
    //UCP
    'MOBILE_DEVICE_USER'           => 'Bienvenue aux utilisateurs mobiles',
    'MOBILE_DEVICE_USER_EXPLAIN'   => 'Affiche le message de bienvenue des utilisateur mobile avec une image.',
    'MOBILE_DEVICE_HEADER'         => 'Image de l\'appareil mobile en-tête',
    'MOBILE_DEVICE_HEADER_EXPLAIN' => 'Affiche l\'image mobile de l\'utilisateur dans le fil d\'Ariane.',
));
 
		 
				
								
		 
		 
	 
	
		
		
			
				
								Sniper_E 							 
						VIP 			
		Posts:  1157Joined:  14 Oct 2014, 19:01 
		
						
			
		
													
							
						
				
											Post  
				by Sniper_E  04 Nov 2017, 16:08 
			
			
			
			
			
			That language file looks like an old one. We are working on version 1.0.5 right now. The latest release was version 1.0.4
Sorry the instructions I gave you were for version 1.0.5 which is not out yet.
In the listener.php file FIND
Code: Select all 
			case (preg_match('/(iris|3g_t|windows ce|windows Phone|opera mobi|windows ce; smartphone;|windows ce; iemobile)/i',$user_agent));
				$status = 'Windows Smartphone';
				$mobile_browser = $windows;
			break;
REPLACE with:
Code: Select all 
			case (preg_match('/(iris|3g_t|windows ce|windows Phone|opera mobi|windows ce; smartphone;|windows ce; iemobile)/i',$user_agent));
				if (preg_match('/Lumia 640 XL/i',$user_agent))
				{
					$status = 'Lumia 640 XL';
				}
				else
				{
					$status = 'Windows Smartphone';
				}
				$mobile_browser = $windows;
			break;
This is the only edit you need in version 1.0.4, we moved the device names from the listener to the lang files in version 1.0.5
We might be able to get a 1.0.5 version out here for dm's members only. I'll get back to you on that, it's a mess right now.
 
		 
				
								
		 
		 
	 
	
		
		
			
				
								Sniper_E 							 
						VIP 			
		Posts:  1157Joined:  14 Oct 2014, 19:01 
		
						
			
		
													
							
						
				
											Post  
				by Sniper_E  18 Nov 2017, 23:46 
			
			
			
			
			
			Update:  Mobile Device 
Version:  1.0.5 
See first post for download: 
 Mobile Device  
		 
				
								
		 
		 
	 
	
		
		
			
				
								kaspir 							 
						Users 			
		Posts:  112Joined:  25 Aug 2016, 12:50 
		
						
			
		
													
							
						
				
											Post  
				by kaspir  01 Dec 2017, 11:55 
			
			
			
			
			
			
In lang/common.php, line#102 this must be changed as it's a phpbb var: 
Nice work mate.
 
		 
				
								
		 
		 
	 
	
		
		
			
				
								Sniper_E 							 
						VIP 			
		Posts:  1157Joined:  14 Oct 2014, 19:01 
		
						
			
		
													
							
						
				
											Post  
				by Sniper_E  01 Dec 2017, 16:08 
			
			
			
			
			
			kaspir  wrote: 01 Dec 2017, 11:55 
In lang/common.php, line#102 this must be changed as it's a phpbb var:
 thanks!
lang/common.php line#102
event/listener.php line#446
Code: Select all 
$status = $this->user->lang['ORN']; 
		 
				
								
		 
		 
	 
	
		
		
			
				
								Sniper_E 							 
						VIP 			
		Posts:  1157Joined:  14 Oct 2014, 19:01 
		
						
			
		
													
							
						
				
											Post  
				by Sniper_E  11 Dec 2017, 06:20 
			
			
			
			
			
			First post updated to Mobile Device version 1.0.6 Please give it a test run and report any issues. Thank you!  
			
			
									
						
										
						 
		 
				
								
		 
		 
	 
	
		
		
			
				
								Mommike 							 
						Users 			
		Posts:  12Joined:  24 Mar 2017, 16:05 
		
						
			
		
													
							
						
				
											Post  
				by Mommike  11 Dec 2017, 10:03 
			
			
			
			
			
			Hey! From version 1.0.5 this plugin is not working on my site anymore. Any idea, what to do to fix it?
Code: Select all 
SQL ERROR [ mysqli ]
Data too long for column 'log_ip' at row 1 [1406]
SQL
INSERT INTO phpbb_mobile_logs (user_agent, log_ip, user_name, device_name, log_time) VALUES ('Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.84 Safari/537.36', '2001:7d0:87cb:7680:8c28:8537:ede3:61c9', 'Marmes', 'Desktop', '1512982860')
BACKTRACE
FILE: (not given by php)
LINE: (not given by php)
CALL: msg_handler()
FILE: [ROOT]/phpbb/db/driver/driver.php
LINE: 999
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]/ext/sniper/mobiledevice/event/listener.php
LINE: 285
CALL: phpbb\db\driver\factory->sql_query()
FILE: (not given by php)
LINE: (not given by php)
CALL: sniper\mobiledevice\event\listener->page_header()
FILE: [ROOT]/vendor/symfony/event-dispatcher/EventDispatcher.php
LINE: 184
CALL: call_user_func()
FILE: [ROOT]/vendor/symfony/event-dispatcher/EventDispatcher.php
LINE: 46
CALL: Symfony\Component\EventDispatcher\EventDispatcher->doDispatch()
FILE: [ROOT]/phpbb/event/dispatcher.php
LINE: 60
CALL: Symfony\Component\EventDispatcher\EventDispatcher->dispatch()
FILE: [ROOT]/phpbb/event/dispatcher.php
LINE: 46
CALL: phpbb\event\dispatcher->dispatch()
FILE: [ROOT]/includes/functions.php
LINE: 4163
CALL: phpbb\event\dispatcher->trigger_event()
FILE: [ROOT]/index.php
LINE: 238
CALL: page_header() 
		 
				
								
		 
		 
	 
	
		
		
			
				
								martin 							 
						Admin 			
		Posts:  5106Joined:  06 Apr 2014, 16:12 
		
						
			
		
													
							
						
				
											Post  
				by martin  11 Dec 2017, 10:33 
			
			
			
			
			
			Install 1.0.5 files and unistall and delete data as you must have updated  wrong.
			
			
									
						
										
						 
		 
				
								
		 
		 
	 
	
		
		
			
				
								Mommike 							 
						Users 			
		Posts:  12Joined:  24 Mar 2017, 16:05 
		
						
			
		
													
							
						
				
											Post  
				by Mommike  11 Dec 2017, 10:57 
			
			
			
			
			
			martin  wrote: 11 Dec 2017, 10:33 
install 1.0.5 files and unistall and delete data as you must have updated  wrong.
No help, still the same. Disabled ext, deleted all data, deleted extension files. Then installed once again. still the same error with both versions (1.0.5 and 1.0.6)
 
		 
				
								
		 
		 
	 
	
		
		
			
				
								Sniper_E 							 
						VIP 			
		Posts:  1157Joined:  14 Oct 2014, 19:01 
		
						
			
		
													
							
						
				
											Post  
				by Sniper_E  11 Dec 2017, 17:12 
			
			
			
			
			
			Thanks for the report Mommike .
Let's try this. Place this listener.php file in the mobiledevice/event/ directory and try to install again.
mobiledevice_listener.zip
martin and dm this is the edit I made to the codes
Code: Select all 
			$user_agent = $this->request->server('HTTP_USER_AGENT');
			$user_ip = $this->user->data['user_ip'];
			$user_name = $this->user->data['username'];
			$device_name = $this->request->variable('device_name', $status[1]);
			
			if ($mobilelogs_counter == 0 && $device_name != '')
			{
				$sql_ary = array(
					'user_agent'  => (string) $user_agent,
					'log_ip'      => (string) $user_ip,
					'user_name'   => (string) $user_name,
					'device_name' => (string) $device_name,
					'log_time'    => (string) time(),
I defined $user_ip and replaced the (string) for 'log_ip'
You do not have the required permissions to view the files attached to this post! Maybe your post count is too low.
			
						
										
						 
		 
				
								
		 
		 
	 
	
		
		
			
				
								Mommike 							 
						Users 			
		Posts:  12Joined:  24 Mar 2017, 16:05 
		
						
			
		
													
							
						
				
											Post  
				by Mommike  11 Dec 2017, 20:01 
			
			
			
			
			
			Sniper_E  wrote: 11 Dec 2017, 17:12 
Thanks for the report Mommike .
Let's try this. Place this listener.php file in the mobiledevice/event/ directory and try to install again.
mobiledevice_listener.zip
martin and dm this is the edit I made to the codes
Code: Select all 
			$user_agent = $this->request->server('HTTP_USER_AGENT');
			$user_ip = $this->user->data['user_ip'];
			$user_name = $this->user->data['username'];
			$device_name = $this->request->variable('device_name', $status[1]);
			
			if ($mobilelogs_counter == 0 && $device_name != '')
			{
				$sql_ary = array(
					'user_agent'  => (string) $user_agent,
					'log_ip'      => (string) $user_ip,
					'user_name'   => (string) $user_name,
					'device_name' => (string) $device_name,
					'log_time'    => (string) time(),
I defined $user_ip and replaced the (string) for 'log_ip'
Thanks! It's working again!
 
		 
				
								
		 
		 
	 
	
		
		
			
				
								german-german 							 
						Users 			
		Posts:  2Joined:  12 Dec 2017, 20:36 
		
						
			
		
													
							
						
				
											Post  
				by german-german  14 Dec 2017, 00:59 
			
			
			
			
			
			Download link broken (?
			
			
						You do not have the required permissions to view the files attached to this post! Maybe your post count is too low.
			
						
										
						 
		 
				
								
		 
		 
	 
	
		
		
			
				
								Webmaster Chuck 							 
						Users 			
		Posts:  5Joined:  09 May 2017, 07:23 
		
						
			
		
													
							
						
				
											Post  
				by Webmaster Chuck  01 Jan 2018, 22:46 
			
			
			
			
			
			Awesome Extension. Worked like a champ on 3.2.1 right out of the box!
What is the best place you folks have found to get the images of the phones?