Simple Machines Community Forum

SMF Support => SMF 1.1.x Support => Aiheen aloitti: tooman - kesäkuu 29, 2009, 08:04:17 IP

Otsikko: Auto Redirect to wap, wap2, or imode When Using Mobilephone
Kirjoitti: tooman - kesäkuu 29, 2009, 08:04:17 IP
dear SMF expert

i'm using my phone (with operamini) to access my forum, and this home :)

i've edit my wireless.template.php, so i can do simple moderate (quote, edit, remove, stick, lock) and quick reply etc - its fantastic forum software

is it possible (and how) to adding some script that can auto redirect to wap when i'm using phone (and operamini) like vbulletin mobile ? it will be great, no more vb, phpbb, ipb! just SMF :)

regard

tooman
Otsikko: Re: Auto Redirect to wap, wap2, or imode When Using Mobilephone
Kirjoitti: N3RVE - kesäkuu 30, 2009, 05:53:46 AP
SMF automatically redirects to wap / wap2 or imode depending on the mobile phone it detects. However, when the mobile device can load the full page, it will serve that instead of the mobile version. For example, My Nokia E71 returns the full page so I have to manually add ?wap2 to the end of the URL to load the mobile pages to cut the charges.

-[n3rve]
Otsikko: Re: Auto Redirect to wap, wap2, or imode When Using Mobilephone
Kirjoitti: tooman - kesäkuu 30, 2009, 08:03:41 IP
how about opera mini? it can load full page, but load big page is painful, wap view is better for small screen. how can i edit it?
Otsikko: Re: Auto Redirect to wap, wap2, or imode When Using Mobilephone
Kirjoitti: N3RVE - heinäkuu 01, 2009, 04:56:40 AP
Lainaus käyttäjältä: Arantor - kesäkuu 30, 2009, 08:59:52 IP
When you first browse to the forum, add ;wap to the end of the URL.

..and you'll have mini pages served throughout that session. If you require additional assistance, let us know :)

-[n3rve]
Otsikko: Re: Auto Redirect to wap, wap2, or imode When Using Mobilephone
Kirjoitti: tooman - heinäkuu 01, 2009, 06:31:38 AP
i mean it should like mobility.mobi (they using vb)
Otsikko: Re: Auto Redirect to wap, wap2, or imode When Using Mobilephone
Kirjoitti: N3RVE - heinäkuu 01, 2009, 07:28:18 AP
That looks great, let us know if it works for you :)

-[n3rve]
Otsikko: Re: Auto Redirect to wap, wap2, or imode When Using Mobilephone
Kirjoitti: tooman - heinäkuu 02, 2009, 04:22:55 IP
wow, i dont know it available :o

i'll try, thx guys
Otsikko: Re: Auto Redirect to wap, wap2, or imode When Using Mobilephone
Kirjoitti: N3RVE - heinäkuu 03, 2009, 03:19:28 AP
Updates?

-[n3rve]
Otsikko: Re: Auto Redirect to wap, wap2, or imode When Using Mobilephone
Kirjoitti: tooman - heinäkuu 04, 2009, 04:00:45 IP
where i find it? i dont know :st
Otsikko: Re: Auto Redirect to wap, wap2, or imode When Using Mobilephone
Kirjoitti: N3RVE - heinäkuu 04, 2009, 04:09:05 IP
./Index.php

Replace:

if (isset($_SERVER['HTTP_ACCEPT']) && strpos($_SERVER['HTTP_ACCEPT'], 'application/vnd.wap.xhtml+xml') !== false)


With:

if ((isset($_SERVER['HTTP_ACCEPT']) && strpos($_SERVER['HTTP_ACCEPT'], 'application/vnd.wap.xhtml+xml') !== false) || isset($_SERVER['HTTP_X_OPERAMINI_PHONE_UA']))


-[n3rve]
Otsikko: Re: Auto Redirect to wap, wap2, or imode When Using Mobilephone
Kirjoitti: tooman - heinäkuu 04, 2009, 09:04:23 IP
wow, im trying than mark this topic as solved, thx guys :x
Otsikko: Re: Auto Redirect to wap, wap2, or imode When Using Mobilephone
Kirjoitti: tooman - heinäkuu 05, 2009, 05:01:00 IP
it work, forces operamini to use wap2, when i click desktop button (in my wap) it still show wap2 :(

one more question, how to solve this (no force to show wap if i click desktop versio)

thx for help me guys
Otsikko: Re: Auto Redirect to wap, wap2, or imode When Using Mobilephone
Kirjoitti: N3RVE - heinäkuu 05, 2009, 05:34:04 IP
Attach ./Themes/../Wireless.template.php

-[n3rve]
Otsikko: Re: Auto Redirect to wap, wap2, or imode When Using Mobilephone
Kirjoitti: tooman - heinäkuu 05, 2009, 07:54:38 IP
it will be like http://forum.com/display=fullsite

im sorry, im too stupid to do it :(
Otsikko: Re: Auto Redirect to wap, wap2, or imode When Using Mobilephone
Kirjoitti: Aleksi "Lex" Kilpinen - heinäkuu 06, 2009, 03:20:57 AP
Attaching the Wireless.template.php would help.

Lainaus käyttäjältä: [n3rve] - heinäkuu 05, 2009, 05:34:04 IP
Attach ./Themes/../Wireless.template.php

-[n3rve]
Otsikko: Re: Auto Redirect to wap, wap2, or imode When Using Mobilephone
Kirjoitti: tooman - heinäkuu 06, 2009, 06:21:02 AP
i'll attach if using my PC
Otsikko: Re: Auto Redirect to wap, wap2, or imode When Using Mobilephone
Kirjoitti: N3RVE - heinäkuu 09, 2009, 07:30:14 AP
Do you still require assistance?

-[n3rve]
Otsikko: Re: Auto Redirect to wap, wap2, or imode When Using Mobilephone
Kirjoitti: tooman - heinäkuu 09, 2009, 05:12:44 IP
i'm still using my phone mr. n3rv3

i just want my site can redirect to wap2 when using operamini, but not force, i still can view desktop version, with code you give above, i will only view wap2 if using operamini

maybe it will like 'swith to full' in wordpress mobile
Otsikko: Re: Auto Redirect to wap, wap2, or imode When Using Mobilephone
Kirjoitti: N3RVE - heinäkuu 09, 2009, 05:19:15 IP
I don't get it, when I visit your forum (http://mig33pantura.com/) using Firefox / Opera, it loads the Desktop version.
Not tried with an Opera mini browser, but since you say it works, isn't that what you want? I don't quite get it.

-[n3rve]
Otsikko: Re: Auto Redirect to wap, wap2, or imode When Using Mobilephone
Kirjoitti: tooman - heinäkuu 10, 2009, 02:07:03 IP
i'm tryng on my localhost,

when using operamini > redirect to wap2 automatically > but can't view desktop version :)
Otsikko: Re: Auto Redirect to wap, wap2, or imode When Using Mobilephone
Kirjoitti: N3RVE - heinäkuu 13, 2009, 03:20:36 AP
I don't see how attaching the file is a problem.

-[n3rve]
Otsikko: Re: Auto Redirect to wap, wap2, or imode When Using Mobilephone
Kirjoitti: projectnaija - elokuu 23, 2011, 03:39:08 IP
n3rve am having a similar issue on my site i want autoRedirect to wap2 for operamini users and not to force operamini to wap2
Otsikko: Re: Auto Redirect to wap, wap2, or imode When Using Mobilephone
Kirjoitti: Illori - elokuu 23, 2011, 04:06:17 IP
please do not bump old topics and please use a separate topic for each issue, this topic belongs to someone else.
Otsikko: Re: Auto Redirect to wap, wap2, or imode When Using Mobilephone
Kirjoitti: projectnaija - elokuu 25, 2011, 11:31:37 IP
here is the code to replace in you index.php


if (isset($_REQUEST['nowap']))
   $_SESSION['nowap'] = true;
elseif (!isset($_SESSION['nowap']))
{
   if (isset($_SERVER['HTTP_ACCEPT']) && strpos($_SERVER['HTTP_ACCEPT'], 'application/vnd.wap.xhtml+xml') !== false)
      $_REQUEST['wap2'] = 1;
   elseif (isset($_SERVER['HTTP_ACCEPT']) && strpos($_SERVER['HTTP_ACCEPT'], 'text/vnd.wap.wml') !== false)
   {
      if (strpos($_SERVER['HTTP_USER_AGENT'], 'DoCoMo/') !== false || strpos($_SERVER['HTTP_USER_AGENT'], 'portalmmm/') !== false)
         $_REQUEST['imode'] = 1;
      else
         $_REQUEST['wap'] = 1;
   }
   elseif(preg_match('/Opera Mini/i',$_SERVER['HTTP_USER_AGENT']))
                               $_REQUEST['wap2'] = 1;
}