Oh no! Where's the JavaScript?
Your Web browser does not have JavaScript enabled or does not support JavaScript. Please enable JavaScript on your Web browser to properly view this Web site, or upgrade to a Web browser that does support JavaScript.
Sign In
Not a member yet? Click here to register.

If mobile

I wonder if its possible to add some code to make the users that visits with at mobile be transferred to a diffrent page.
User goes to my site and enters news.php, but if the users have a phone then the user will be transferred to mobile.php.
I have that wap2 thing. here www.skdyk.se/wap2
But i want it to be autodetecten and redirected to that site when u enter with a phone
I dont really understand how to configure it.

I added browser.php that i downloaded in the link you gave me

Then i put in the line on header_includes.php
add_to_head("<link rel='stylesheet' href='/browser.php' type='text/css' media='screen' />");

But where do i set where it should redirect to when ur on a phone?
man o man i dont even know where to begin. First your include is not proper. you want to open themes/templates/header.php

[syntaxhighlighter brush=php,first-line=1,highlight=0,collapse=false,html-script=false]require_once ('location/of/browser.php'wink;[/syntaxhighlighter]
after the other require onces. Then after that you want to write a php if statement calling the function in browser.php

[syntaxhighlighter brush=php,first-line=1,highlight=0,collapse=false,html-script=false]
$browser = new Browser();
if( $browser->getBrowser() == Browser::IE ) { //if browser is IE
header(‘Location: /ie’);
else if( $browser->getBrowser() == Browser::FIREFOX ) { //if browser if firefox
header(‘Location: /ff’);
else {//if browser is something else
header(‘Location: /other’);

in this case you probably want to is if browser is not equal to IE,firefox, chrome, or safari. His browser.php also includes a function to call the OS, which could also be helpful in detecting if it's mobile.

EDIT: ACTUALLY, its alot easier than that... it has a isMobile function. so you'd just want to do
[syntaxhighlighter brush=php,first-line=1,highlight=0,collapse=false,html-script=false]
$browser = new Browser();
if( $browser->isMobile()){//if is mobile
header(‘Location: /ie’);//redirect to WAP site.
Better to try and fail then not try and just ask.

I get a error when adding



Warning: require_once(/Browser.php) [function.require-once]: failed to open stream: No such file or directory in /themes/templates/header.php on line 23

Fatal error: require_once() [function.require]: Failed opening required '/Browser.php' (include_path='.:/usr/local/lsws/lsphp5/lib/php'wink in /themes/templates/header.php on line 23
that means you are not pointing to Browser.php 's proper location.
Does your WAP2 work with Fusion 7.02?

Mine is showing a whole slew of errors. Examples below:


Notice: Undefined index: login_method in /.../htdocs/wap2/wap-maincore.php on line 248

Notice: Undefined variable: userdata in /.../htdocs/wap2/wap-maincore.php on line 836

Notice: Use of undefined constant THEME - assumed 'THEME' in /.../htdocs/includes/system_images.php on line 44
I use xhtml_mobile_mod_5.9v7.02
and my error log is:
Undefined index: global_153 Line: 169
Undefined index: numofshouts Line: 178
Undefined index: global_156 Line: 201
mysql_num_rows(): supplied argument is not a valid MySQL result resource Line: 233
On wap-shouts page with error mesage, but shuts are sending:
Notice: Use of undefined constant TRUE_PHP_SELF - assumed 'TRUE_PHP_SELF' in /home/a7176646/public_html/includes/error_handling_include.php on line 47
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 3
Can somebody help me ? Thank's!
Dear Friends
If you are having mobile site you can redirect the users who are coming to your domain name automatically to your mobile site.
Just put the below code to at the end of header.php
header.php file is in themes >>>>> templates >>>>>header.php

Mobile version detection
compliments of http://www.buchfelder.biz/

$mobile = "mobile site url add here";
$var[0] = 'Mozilla/4.';
$var[1] = 'Mozilla/3.0';
$var[2] = 'AvantGo';
$var[3] = 'ProxiNet';
$var[4] = 'Danger hiptop 1.0';
$var[5] = 'DoCoMo/';
$var[6] = 'Google CHTML Proxy/';
$var[7] = 'UP.Browser/';
$var[8] = 'SEMC-Browser/';
$var[9] = 'J-PHONE/';
$var[10] = 'PDXGW/';
$var[11] = 'ASTEL/';
$var[12] = 'Mozilla/1.22';
$var[13] = 'Handspring';
$var[14] = 'Windows CE';
$var[15] = 'PPC';
$var[16] = 'Mozilla/2.0';
$var[17] = 'Blazer/';
$var[18] = 'Palm';
$var[19] = 'WebPro/';
$var[20] = 'EPOC32-WTL/';
$var[21] = 'Tungsten';
$var[22] = 'Netfront/';
$var[23] = 'Mobile Content Viewer/';
$var[24] = 'PDA';
$var[25] = 'MMP/2.0';
$var[26] = 'Embedix/';
$var[27] = 'Qtopia/';
$var[28] = 'Xiino/';
$var[29] = 'BlackBerry';
$var[30] = 'Gecko/20031007';
$var[31] = 'MOT-';
$var[32] = 'UP.Link/';
$var[33] = 'Smartphone';
$var[34] = 'portalmmm/';
$var[35] = 'Nokia';
$var[36] = 'Symbian';
$var[37] = 'AppleWebKit/413';
$var[38] = 'UPG1 UP/';
$var[39] = 'RegKing';
$var[40] = 'STNC-WTL/';
$var[41] = 'J2ME';
$var[42] = 'Opera Mini/';
$var[43] = 'SEC-';
$var[44] = 'ReqwirelessWeb/';
$var[45] = 'AU-MIC/';
$var[46] = 'Sharp';
$var[47] = 'SIE-';
$var[48] = 'SonyEricsson';
$var[49] = 'Elaine/';
$var[50] = 'SAMSUNG-';
$var[51] = 'Panasonic';
$var[52] = 'Siemens';
$var[53] = 'Sony';
$var[54] = 'Verizon';
$var[55] = 'Cingular';
$var[56] = 'Sprint';
$var[57] = 'AT&T;';
$var[58] = 'Nextel';
$var[59] = 'Pocket PC';
$var[60] = 'T-Mobile';   
$var[61] = 'Orange';
$var[62] = 'Casio';
$var[63] = 'HTC';
$var[64] = 'Motorola';
$var[65] = 'Samsung';
$var[66] = 'NEC';

$result = count($var);

for ($i=0;$i<$result;$i++)
    $ausg = stristr($text, $var[$i]);   
        header("location: $mobile");

Just change the url of your mobile site in $mobile

That's all. You have done.;)

Thanks always goes to original script writers
Thread Information
11 posts
5,705 times
Last Post
Last updated on 9 years ago
You can view all discussion threads in this forum.
You cannot set up a bounty in this discussion thread.
You can start a new discussion thread in this forum.
You cannot reply in this discussion thread.
You cannot start on a poll in this forum.
You cannot upload attachments in this forum.
You can download attachments in this forum.
You cannot up or down-vote on the post in this discussion thread.
Users who participated in discussion: younis, Craig, GMUDuckman, Henrik Brobeck, jekov, lankantunes