GoFuckYourself.com - Adult Webmaster Forum

GoFuckYourself.com - Adult Webmaster Forum (https://gfy.com/index.php)
-   Fucking Around & Business Discussion (https://gfy.com/forumdisplay.php?f=26)
-   -   [Tip] How Mobile Detection is Done!!! (https://gfy.com/showthread.php?t=921153)

Bird 08-11-2009 02:00 PM

[Tip] How Mobile Detection is Done!!!
 
For all of you that are just getting in to mobile, This is the first thing that needs to be done before starting your site. Hope this helps all of you get started.

You can download Tera-wurfl at
http://tera-wurfl.com/

installation video tutorial:

http://mmi.mobiquio.com/resources/wu...all%281%29.htm

Code:

<?php

// include the configuration and the class file

require_once('/home/user_account/public_html/yoursite/tera_wurfl/tera_wurfl_config.php');

require_once(WURFL_CLASS_FILE);



// instantiate the class

$myDevice = new tera_wurfl();



// get the capabilites from the user agent and take a look at the

// HTTP-ACCEPT headers in case the user agent is not found

$myDevice->GetDeviceCapabilitiesFromAgent($_SERVER['HTTP_USER_AGENT'],true);

$cap = $wurflObj->capabilities;




    if ( $myDevice->GetDeviceCapability('is_wireless_device') ) {

      switch ( $myDevice->GetDeviceCapability('preferred_markup') ) {

        case 'wml_1_1':

        case 'wml_1_2':

        case 'wml_1_3':

          $msite='http://yoursite.com/mobile';

         

          break;

        case 'xhtml_basic':

        case 'html_wi_w3_xhtmlbasic':

          $msite='http://yoursite.com/home/';

         

          break;

        case 'xhtml_mobileprofile':

        case 'html_wi_oma_xhtmlmp_1_0':

        case 'xhtml_mp_1.0':

          $msite='http://yoursite.com/mobile/';

       

          break;

        case 'html_wi_imode_html_1':

        case 'html_wi_imode_html_2':

        case 'html_wi_imode_html_3':

        case 'html_wi_imode_html_4':

        case 'html_wi_imode_html_5':

        case 'html_wi_imode_compact_generic':

          $msite='http://yoursite.com/mobile/';

 

          break;

        case 'html_web_3_2':

          $msite='http://yoursite.com/mobile/';



          break;

        case 'html_web_4_0':

          $msite='http://yoursite.com/home/';

          break;



                 

      }

      header("Location: $msite");



  } else {

      // Redirecting web browsers to another URL

      header("Location: http://yoursite.com/home");

    }


?>


seeandsee 08-11-2009 02:04 PM

Quote:

Originally Posted by Bird (Post 16172094)
For all of you that are just getting in to mobile, This is the first thing that needs to be done before starting your site. Hope this helps all of you get started.

You can download Tera-wurfl at
http://tera-wurfl.com/

installation video tutorial:

http://mmi.mobiquio.com/resources/wu...all%281%29.htm

Code:

<?php

// include the configuration and the class file

require_once('/home/user_account/public_html/yoursite/tera_wurfl/tera_wurfl_config.php');

require_once(WURFL_CLASS_FILE);



// instantiate the class

$myDevice = new tera_wurfl();



// get the capabilites from the user agent and take a look at the

// HTTP-ACCEPT headers in case the user agent is not found

$myDevice->GetDeviceCapabilitiesFromAgent($_SERVER['HTTP_USER_AGENT'],true);

$cap = $wurflObj->capabilities;




    if ( $myDevice->GetDeviceCapability('is_wireless_device') ) {

      switch ( $myDevice->GetDeviceCapability('preferred_markup') ) {

        case 'wml_1_1':

        case 'wml_1_2':

        case 'wml_1_3':

          $msite='http://yoursite.com/mobile';

         

          break;

        case 'xhtml_basic':

        case 'html_wi_w3_xhtmlbasic':

          $msite='http://yoursite.com/home/';

         

          break;

        case 'xhtml_mobileprofile':

        case 'html_wi_oma_xhtmlmp_1_0':

        case 'xhtml_mp_1.0':

          $msite='http://yoursite.com/mobile/';

       

          break;

        case 'html_wi_imode_html_1':

        case 'html_wi_imode_html_2':

        case 'html_wi_imode_html_3':

        case 'html_wi_imode_html_4':

        case 'html_wi_imode_html_5':

        case 'html_wi_imode_compact_generic':

          $msite='http://yoursite.com/mobile/';

 

          break;

        case 'html_web_3_2':

          $msite='http://yoursite.com/mobile/';



          break;

        case 'html_web_4_0':

          $msite='http://yoursite.com/home/';

          break;



                 

      }

      header("Location: $msite");



  } else {

      // Redirecting web browsers to another URL

      header("Location: http://yoursite.com/home");

    }


?>


thanks for sharing

munki 08-11-2009 02:05 PM

nice....

BSleazy 08-11-2009 02:07 PM

ProTraffic still has a little mobile traffic left for sale. Not much though :)

harvey 08-11-2009 03:11 PM

Never tried it, will take a look. Below 3 pages I used for mobile coding

This one works like a charm and it's extremely easy to setup
http://detectmobilebrowsers.mobi/

another option (way more complete) that also uses WURFL datbase at http://www.brainhandles.com/techno-t...obile-browsers

there are some nice tricks and tips at http://mobiforge.com/developing/stor...-detection-php

Allison 08-11-2009 03:21 PM

One tip for whatever mobile detection script you use is to analyze your statistics (admob or google analytics or sever logs). Look at the traffic that you're sending off to a mobile page or ask your sponsor to provide their user agent stats to ensure it's working the way you want it to.

There is no 100% full proof method, scripts will either detect a little too little mobile, or could also detect way too much due to the parameters they look for. Not all devices call themselves out as "mobile" and if you look for a parameter too short it could cause too many false positives resulting in certain types of PC traffic being sent to a mobile device.

Our policy for topbucksmobile.com is to keep the detection script conservative versus risk anyone's PC traffic.

~Alli

Bird 08-11-2009 03:24 PM

Quote:

Originally Posted by harvey (Post 16172359)
Never tried it, will take a look. Below 3 pages I used for mobile coding

This one works like a charm and it's extremely easy to setup
http://detectmobilebrowsers.mobi/

another option (way more complete) that also uses WURFL datbase at http://www.brainhandles.com/techno-t...obile-browsers

there are some nice tricks and tips at http://mobiforge.com/developing/stor...-detection-php

Thanks for the links

Allison 08-11-2009 03:26 PM

Quote:

Originally Posted by Bird (Post 16172404)
Thanks for the links

Hey Bird... if you have a moment can you hit me up on icq. Question to ask you. 120353154

CaptainHowdy 08-11-2009 05:58 PM

Keepin' this one ON TOP!

Gausche 08-11-2009 06:06 PM

Nicely done Bird :)

Bird 08-12-2009 12:46 PM

Quote:

Originally Posted by CaptainHowdy (Post 16172832)
Keepin' this one ON TOP!

For those who missed is yesterday


All times are GMT -7. The time now is 07:15 PM.

Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123