Instructions on adding new mobile devices to the list
First you will need to find the browser a mobile device uses and the mobile device name.
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...

You want the numbers of that Samsung mobile device...
SM-G870A
the number before Build
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
line 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.
Adding a second mobile devices to that list
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...

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. Repeat that
elseif
for all other devices you add.
You can see the devices we added while testing this extension in the mobiledevice/event/listener.php file.
Adding Mobile Images
Then all you need to do is search online for an image for the mobile device you are adding and place
the image in the
images/
directory. All images are
max 32px in height
and as wide as you need the images to have
8px transparent space on the sides
. You will have to create the mobile image with
a transparent background and
save as device_name.png
image. If you need help with that just halla.
Adding multiple mobile devices with the same device name
There's a BlackBerry named Blackberry Curve it's model number in browser is
BlackBerry8530
Another BlackBerry named Blackberry Curve it's model number in browser is
BlackBerry8330
And another BlackBerry named Blackberry Curve it's model number in it's browser is
BlackBerry8300
When listing multiple mobile devices with the same name they should be added in the same line...
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;
Enjoy!
[ Post made via Samsung Galaxy S5 Active ] 