News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

An extra line of code in index.php?

Started by boardjive, December 31, 2005, 02:34:02 PM

Previous topic - Next topic

boardjive

I was upgrading my test machine (Joomla 1.0.5 + SMF 1.1RC1) and things went perfect.  When I went into the forums, a PHP error showed up at the top of the page:  Notice: Constant WIRELESS already defined in /Users/Eric/Sites/boardjive/forum/index.php on line 107

So, I opened index.php, looked a bit and commented out line 88: if (!defined('WIRELESS'))

What does this one line do?

Regards

Thantos

well its an if statement so you have to look at the next statement:


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


So combined its asking if WIRELESS is defined, if its not then define it and assign it a value depending on if one of the $_REQUEST values are set.

Are you running any type of intergrating?

boardjive

Yes, it's integrated using a component from Joomlahacks.com.   :P

boardjive

Ok, figured this one out to.  It seems the Joomlahacks.com [nofollow] component inserts a few lines of code.  The problem is that it inserts them between these two lines of code causing the problems.

What Joomlahacks does:

if (!defined('WIRELESS'))


//JOOMLAHACKS.COM

if (defined('_VALID_MOS')) {

$modSettings['integrate_login'] = 'integrateLogin';

$modSettings['integrate_redirect'] = 'integrateRedirect';

$modSettings['integrate_exit'] = 'integrateExit';

$modSettings['enableCompressedOutput'] = '0';

error_reporting(E_ALL ^ E_NOTICE);

}

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


The fix:

//JOOMLAHACKS.COM

if (defined('_VALID_MOS')) {

$modSettings['integrate_login'] = 'integrateLogin';

$modSettings['integrate_redirect'] = 'integrateRedirect';

$modSettings['integrate_exit'] = 'integrateExit';

$modSettings['enableCompressedOutput'] = '0';

error_reporting(E_ALL ^ E_NOTICE);

}

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

:-[

Happy new year,
Eric

Advertisement: