News:

Wondering if this will always be free?  See why free is better.

Main Menu

Turning off WAP

Started by Patrick Simmons, June 10, 2007, 12:56:13 PM

Previous topic - Next topic

Patrick Simmons

Is there a way to disable it? All my staff uses blackberry devices but we do a lot of our moderating on the go. This is the first software we have used that automatically converts to WAP.

greyknight17

Look here and see if it's of any user. Editing that index.php file might do it ;)

Patrick Simmons

Thanks for the reply, I just don't know what to edit out.

greyknight17

Not sure if this will eliminate it, so make sure you create a backup copy of the file you will be editing. Go into your main SMF folder and look for index.php. Open it up and look for:

if (!defined('WIRELESS'))
define('WIRELESS', isset($_REQUEST['wap']) || isset($_REQUEST['wap2']) || isset($_REQUEST['imode']));

// Some settings and headers are different for wireless protocols.
if (WIRELESS)
{
define('WIRELESS_PROTOCOL', isset($_REQUEST['wap']) ? 'wap' : (isset($_REQUEST['wap2']) ? 'wap2' : (isset($_REQUEST['imode']) ? 'imode' : '')));

// Some cellphones can't handle output compression...
$modSettings['enableCompressedOutput'] = '0';
// !!! Do we want these hard coded?
$modSettings['defaultMaxMessages'] = 5;
$modSettings['defaultMaxTopics'] = 9;

// Wireless protocol header.
if (WIRELESS_PROTOCOL == 'wap')
header('Content-Type: text/vnd.wap.wml');
}


Delete those lines of code above. Save the file and test it out.

Patrick Simmons

I got this error when I did that:

Unable to load the 'WIRELESS_PROTOCOL_above' template.

greyknight17

OK, change it back...

Try this. Look for SSI.php in your root SMF folder. Then open up that file and look for:

// Make sure wireless is always off.
define('WIRELESS', false);


Change that false to TRUE and see if that does it.

Patrick Simmons

I tried that but it had no affect on it converting to the wap version. I reay apprciate the help btw.

greyknight17

Do you want to turn it off or have it on?

Go to Themes/default and look for Wireless.template.php. Rename that file to Wireless.template.php~ and see if that did anything.

Patrick Simmons

I will try that now.

Quote from: greyknight17 on June 10, 2007, 06:30:10 PM
Do you want to turn it off or have it on?

I want it off completey.

Patrick Simmons

It had no affectt when viewing from pc but when I use my Blackberry it says "Unable to load the wap2_abve sub tempate!"

This may be a more difficult task than i expected.

greyknight17

Yeah I know. The problem is that there is a whole bunch of references to the WAP protocol in a bunch of the SMF files. I'm not too savvy on WAP, but I'm guessing you don't want users to view it using their mobile devices?

I'll see if I can dig up more info on this. Or maybe try eliminating all references to the WAP function...which will be a headache.

Patrick Simmons

The problem is that 90% of my users are trying to view from Backberry devices (especially staff to moderate on the go) and by only having the weak WAP browser we are unable to handle business besides being right in front of an actual computer.  I thought it wud be as easy as a switch or a small mod but as I look through and mess with the files, it seems to be a large project.

greyknight17

Sorry, but this just doesn't make sense to me. So do you want them to have access with their Blackberry phones or not?

Patrick Simmons

Yes but not with wap. Blackberry phones have a regular html browser built-in as well as a wap browser. For some reason with the smf software it is automatically detecting and running the wap version instead of the one you woud normally see if you were to use a regular computer. Any other non smf site I go to I have the choice of which version to view based on the urls.

greyknight17

I know what you mean. I remember browsing my forum with my Blackberry and it was basically text based since it's made for ease of navigation.

Was going to edit those files that included the code for the wireless, but gave up. Too much and I'm not sure if it will mess up the forum code.

KGIII

I have a silly idea... There's an archive mod. I haven't tried it yet. If you install it and then re-direct those people to the archive.php site to use the forum does that have the moderation links? I really don't know... Every time I try to access my site with my cell it tends to crash and burn.

My PC Support Forum
Please ask in-thread before PMing
                   SMF Help
                   Visit My Blog

How can we improve the support process?:
http://www.simplemachines.org/community/index.php?topic=163533.0

SMF vs. Godzilla? Who do you think will win?

Daniel15

Rather than disabling it completely, you can just remove the redirect. That way, the WAP mod will not be used unless the user adds ;wap to the end of the URL themself.
In index.php, find:

// Determine if this is using WAP, WAP2, or imode.  Technically, we should check that wap comes before application/xhtml or text/html, but this doesn't work in practice as much as it should.
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;
}

Remove this segment of code.
Daniel15, former Customisation team member, resigned due to lack of time. I still love everyone here :D.
Go to smfshop.com for SMFshop support, do NOT email or PM me!

Patrick Simmons

Quote from: Daniel15 on June 11, 2007, 01:55:39 AM
Rather than disabling it completely, you can just remove the redirect. That way, the WAP mod will not be used unless the user adds ;wap to the end of the URL themself.
In index.php, find:

// Determine if this is using WAP, WAP2, or imode.  Technically, we should check that wap comes before application/xhtml or text/html, but this doesn't work in practice as much as it should.
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;
}

Remove this segment of code.

That worked perfectly.  I would like to thank everyone who attempted to help me with this and Daniel fr solvong my problem.

Advertisement: