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

Topic Author
Sniper_E
VIP
VIP
Posts: 1157
Joined: 14 Oct 2014, 19:01
    Windows 10 Chrome

Mobile Device

Post by Sniper_E »

Extension Name: Mobile Device

Version: 1.0.7

Authors: dmzx and Sniper_E and martin

Extension Features:
  • Adds [ Post made via Samsung Galaxy S6 ] in a post when user is posting from a mobile device.
  • Welcome mobile user message on index page showing user's mobile device.
  • Displays logged in user's mobile image in header navbar on all other pages.
  • Displays user is online on their mobile in topic mini-profile and view profile page.
  • Popup mobile logs page to view any user on mobile who has visited your site.
  • Selections in UCP / Board preferences / Display options for user options.
  • Selections in ACP / Extensions / Mobile device / Settings for enabling features.
  • Permissions / Misc in ACP will select who can view logs and who can clear logs.
Screenshot:
mobile-device-post.gif
Demo URL: Visit on Mobile - Dmzx-web

Requirements: Requires php>=5.3.3 and phpbb>=3.2.+

Mobile Device Extension Download:
sniper_mobiledevice_1_0_7.zip
Enjoy! :D

Update:
  1. Navigate to ACP -> Customise -> Enabled Extensions -> Mobile Device and click Disable
  2. Copy the updated mobiledevice/ folder into server root/ext/sniper/ directory, over write files.
  3. Navigate to ACP -> Customise -> Disabled Extensions -> Mobile Device and click Enable
Install:
  1. In the root/ext/ directory of your phpBB board, create a new directory named sniper/
  2. Copy the mobiledevice/ folder into server root/ext/sniper/ directory.
  3. Navigate to ACP -> Customise -> Disabled Extensions -> Mobile Device and click Enable
Uninstall:
  1. Navigate to ACP -> Customise -> Enabled Extensions / Mobile Device and click Disable
  2. To permanently uninstall, click Delete Data and then delete the folder /ext/sniper/mobiledevice
[ Post made via Samsung Galaxy2 Tablet ]
You do not have the required permissions to view the files attached to this post! Maybe your post count is too low.
Last edited by Sniper_E on 30 Nov 2024, 09:50, edited 32 times in total.
Image
No is NEVER an Option and NEVER is the only Option when it comes to Giving Up!™

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 »

Instructions on adding new mobile devices to the list

First you will need to find the browser a mobile user is using.
I signed into my site on my mobile device (Samsung Galaxy S5 Active) and looked in the Who is Online

This is what I saw as my mobile browser in the who is online page...
whoisonline.gif
You want the numbers of that Samsung mobile device... SM-G870A
You can do a Google Search using that number to find out the name of the device.
Open: ext/sniper/mobiledevice/event/listener.php
Find
Tip: This may be a partial find and not the whole line

Code: Select all

			case (preg_match('/android/i',$user_agent));
				$status = 'Android';
				$mobile_browser = $android;
				if(substr($android,0,4)=='http')
				{
					$mobileredirect = $android;
				}
			break;
Replace with
Tip: Replace the preceding lines with the following

Code: Select all

			case (preg_match('/android/i',$user_agent));
				if (preg_match('/SM-G870A/i',$user_agent))
				{
					$status = 'Samsung Galaxy S5 Active';
				}
				else
				{
					$status = 'Android';
				}
				$mobile_browser = $android;
				if(substr($android,0,4)=='http')
				{
					$mobileredirect = $android;
				}
			break;
Do you see where I replaced the $status = 'Android'; line with another preg_match('/SM-G870A/i',$user_agent for my phone?

Then below after listing the information on the numbers from my browser and my device name...
I added the else statement with the original $status = 'Android'; line.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

OK now lets add another device in there. I will use a different mobile device this time to demonstrate.
I signed into my site on my tablet (Samsung Galaxy2 Tablet) and looked in the Who is Online

This is what I saw as my mobile browser in the who is online page...
whoisonline2.gif
You want the numbers of that Samsung tablet... SGH-I497
Open: ext/sniper/mobiledevice/event/listener.php
Replace with
Tip: Replace the preceding lines with the following

Code: Select all

			case (preg_match('/android/i',$user_agent));
				if (preg_match('/SM-G870A/i',$user_agent))
				{
					$status = 'Samsung Galaxy S5 Active';
				}
				elseif (preg_match('/SGH-I497/i',$user_agent))
				{
					$status = 'Samsung Galaxy2 Tablet';
				}
				else
				{
					$status = 'Android';
				}
				$mobile_browser = $android;
				if(substr($android,0,4)=='http')
				{
					$mobileredirect = $android;
				}
			break;
You can see the elseif line for the next device added. Repeat that elseif for all other devices you add.
You can see the devices we already added while testing this extension in the ext/sniper/mobiledevice/event/listener.php file.

Mobile Images

Then all you need to do is search online for an image for the mobile device you are adding and place it in the images/ directory.
All images are max 32px in height and as wide as you need them to have 8px transparent space on the sides.
You will have to create the mobile image with the above guidelines with a tansparent background and save as a .png image.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

Adding multiple mobile devices with the same device name

There is a BlackBerry phone named Blackberry Curve and has it's model number in it's browser info listed as BlackBerry8530
Another BlackBerry phone named Blackberry Curve has it's model number in it's browser info listed as BlackBerry8330
And another BlackBerry phone named Blackberry Curve has it's model number in it's browser info listed as BlackBerry8330

You can add them to the list this way...
Open: ext/sniper/mobiledevice/event/listener.php
Find
Tip: This may be a partial find and not the whole line

Code: Select all

			case (preg_match('/blackberry/i',$user_agent));
				$status = 'BlackBerry';
				$mobile_browser = $blackBerry;
				if(substr($blackberry,0,4)=='http')
				{
					$mobileredirect = $blackberry;
				}
			break;
Replace with
Tip: Replace the preceding lines with the following

Code: Select all

			case (preg_match('/blackberry/i',$user_agent));
				if (preg_match('/BlackBerry8530/i',$user_agent))
				{
					$status = 'BlackBerry Curve';
				}
				elseif (preg_match('/BlackBerry8330/i',$user_agent))
				{
					$status = 'BlackBerry Curve';
				}
				elseif (preg_match('/BlackBerry8300/i',$user_agent))
				{
					$status = 'BlackBerry Curve';
				}
				else
				{
					$status = 'BlackBerry';
				}
				$mobile_browser = $blackberry;
				if(substr($blackberry,0,4)=='http')
				{
					$mobileredirect = $blackberry;
				}
			break;
But when you are listing multiple mobile devices with the same name they should be added in the same line like this...
Open: ext/sniper/mobiledevice/event/listener.php
Replace with
Tip: Replace the preceding lines with the following

Code: Select all

			case (preg_match('/blackberry/i',$user_agent));
				if (preg_match('/BlackBerry8530|BlackBerry8330|BlackBerry8300/i',$user_agent))
				{
					$status = 'BlackBerry Curve';
				}
				else
				{
					$status = 'BlackBerry';
				}
				$mobile_browser = $blackberry;
				if(substr($blackberry,0,4)=='http')
				{
					$mobileredirect = $blackberry;
				}
			break;
[ Post made via Samsung Galaxy S5 Active ] Image
You do not have the required permissions to view the files attached to this post! Maybe your post count is too low.
Last edited by Sniper_E on 13 Oct 2015, 04:53, edited 1 time in total.

User avatar

Hippie459MN
Donator
Donator
Posts: 69
Joined: 16 Aug 2015, 08:37
    Windows 7 Firefox

Re: Mobile Device

Post by Hippie459MN »

Nice! :buigen:
"I went outside once. The graphics sucked but the game play was ok."

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 »

Update for phpBB 3.1.6 coming...

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 »

New update for Mobile Device Extension on first post. Requirements: phpBB 3.1.6


Taka51
Users
Users
Posts: 30
Joined: 08 Jun 2015, 13:27
    Windows 7 Chrome

Re: Mobile Device

Post by Taka51 »

Hello martin
I have a Sony Ericsson Xperia is that the extension fonctionera well and I do not have a small change to make because it is true when I log on to my domain with my laptop display grrrr

cordially
WebDvdBdR - Page d’index

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 »

Updated mobile device list and images in first post (1.0.1 updated)
Last edited by Sniper_E on 20 Sep 2015, 20:06, edited 1 time in total.

User avatar

infspirit
Translators
Translators
Posts: 25
Joined: 13 Sep 2015, 20:50
    Windows 10 Chrome

Re: Mobile Device

Post by infspirit »

Spanish translation ;)
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 »

Thank you infspirit. Added to first post.

User avatar

uruguayito
Donator
Donator
Posts: 120
Joined: 02 Jul 2015, 19:40
    Windows 8.1 Chrome

Re: Mobile Device

Post by uruguayito »

infspirit wrote:spanish translation ;)
Something is wtong in this traslation.

Say: Post realizadp a través de

Better: Mensaje realizado a través de

:wink:
Sorry for my bad English. :oops:
I'm a latin american man.
Spanish is my language.

User avatar

infspirit
Translators
Translators
Posts: 25
Joined: 13 Sep 2015, 20:50
    Windows 10 Chrome

Re: Mobile Device

Post by infspirit »

uruguayito wrote:
infspirit wrote:spanish translation ;)
Something is wtong in this traslation.

Say: Post realizadp a través de

Better: Mensaje realizado a través de

:wink:
if it is true ... the look without writing xD
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 »

There is a word spelled wrong I notice. realizadp should be spelled realizado

Post realizado a través de = Post made via

Mensaje realizado a través de = Message made via
Or
Mensaje publicado por = Message posted via

I think Mensaje publicado por would be better? Sí, Visto bueno, Voto afirmativo

Gracias chicos! ¿Qué cree usted que sería mejor?

User avatar

uruguayito
Donator
Donator
Posts: 120
Joined: 02 Jul 2015, 19:40
    Windows 8.1 Chrome

Re: Mobile Device

Post by uruguayito »

For me, the correct is:

Mensaje enviado desde:

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 »

Mensaje enviado desde = Message sent from

Que voy a utilizar uruguayito. Gracias!

User avatar

Bullseye
Users
Users
Posts: 60
Joined: 22 Sep 2015, 01:44
    Windows 7 Firefox

Re: Mobile Device

Post by Bullseye »

I'm going to install this!



[ Post made via Potato ] Image
Image

Post Reply Previous topicNext topic