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 ] 
You do not have the required permissions to view the files attached to this post! Maybe your post count is too low.