| 68 |
$this->Itemid = mosGetParam($_REQUEST, 'Itemid', 0); |
$this->Itemid = mosGetParam($_REQUEST, 'Itemid', 0); |
| 69 |
$this->getConfig(); |
$this->getConfig(); |
| 70 |
$this->fixLanguage(); |
$this->fixLanguage(); |
|
$this->secure(); |
|
| 71 |
@set_magic_quotes_runtime( 0 ); |
@set_magic_quotes_runtime( 0 ); |
| 72 |
if (@$this->mosConfig_error_reporting === 0) error_reporting(0); |
if (@$this->mosConfig_error_reporting === 0) error_reporting(0); |
| 73 |
elseif (@$this->mosConfig_error_reporting > 0) error_reporting($this->mosConfig_error_reporting); |
elseif (@$this->mosConfig_error_reporting > 0) error_reporting($this->mosConfig_error_reporting); |
| 147 |
if (($scheme == 'http' AND $port == ':80') OR ($scheme == 'https' AND $port == ':443')) $port = ''; |
if (($scheme == 'http' AND $port == ':80') OR ($scheme == 'https' AND $port == ':443')) $port = ''; |
| 148 |
} |
} |
| 149 |
else $port = ''; |
else $port = ''; |
| 150 |
$this->mosConfig_live_site = $scheme.'://'.$servername.$port.$this->subdirectory; |
$afterscheme = '://'.$servername.$port.$this->subdirectory; |
| 151 |
|
$this->mosConfig_live_site = $this->mosConfig_secure_site = $scheme.$afterscheme; |
| 152 |
|
$this->mosConfig_unsecure_site = 'http'.$afterscheme; |
| 153 |
// $this->mosConfig_live_site = 'http://'.$_SERVER['SERVER_NAME'].$this->subdirectory; |
// $this->mosConfig_live_site = 'http://'.$_SERVER['SERVER_NAME'].$this->subdirectory; |
| 154 |
$this->mosConfig_absolute_path = $this->rootPath; |
$this->mosConfig_absolute_path = $this->rootPath; |
| 155 |
preg_match_all('/\$this\-\>([A-Za-z_][A-Za-z0-9_]*)/', $code, $matches); |
preg_match_all('/\$this\-\>([A-Za-z_][A-Za-z0-9_]*)/', $code, $matches); |
| 227 |
$gettext->bind_textdomain_codeset($domain, $this->language['encoding']); |
$gettext->bind_textdomain_codeset($domain, $this->language['encoding']); |
| 228 |
$gettext->textdomain($domain); |
$gettext->textdomain($domain); |
| 229 |
/**/ |
/**/ |
|
|
|
|
} |
|
|
|
|
|
function secure () { |
|
|
$this->mosConfig_unsecure_site = $this->mosConfig_live_site; |
|
|
if ($_SERVER['SERVER_PORT'] == 443) { |
|
|
if (!isset($this->mosConfig_secure_site)) $this->mosConfig_secure_site = str_replace('http://', 'https://', $this->mosConfig_live_site); |
|
|
$this->mosConfig_live_site = $this->mosConfig_secure_site; |
|
|
} |
|
| 230 |
} |
} |
| 231 |
|
|
| 232 |
function handleGlobals () { |
function handleGlobals () { |
| 1339 |
return $instance; |
return $instance; |
| 1340 |
} |
} |
| 1341 |
/** |
/** |
| 1342 |
|
* Register a class-type mambot, provided it has a perform method |
| 1343 |
|
* - can register for multiple events if desired |
| 1344 |
|
* @param object The mambot object |
| 1345 |
|
* @param mixed string or array of strings - the mambot events to be registered |
| 1346 |
|
* @param int the subscript for use in the main array of mambots |
| 1347 |
|
*/ |
| 1348 |
|
function _botRegister (&$botObject, &$selected, $i) { |
| 1349 |
|
$function = array(&$newbot, 'perform'); |
| 1350 |
|
if (!is_callable($function)) return; |
| 1351 |
|
if (is_array($selected)) foreach ($selected as $select) $this->_botRegister($botObject, $select); |
| 1352 |
|
$this->_events[$selected][] = array ($function, $i); |
| 1353 |
|
$this->_registered[$i] = true; |
| 1354 |
|
} |
| 1355 |
|
|
| 1356 |
|
/** |
| 1357 |
* Loads all the bot files for a particular group |
* Loads all the bot files for a particular group |
| 1358 |
* @param string The group name, relates to the sub-directory in the mambots directory |
* @param string The group name, relates to the sub-directory in the mambots directory |
| 1359 |
*/ |
*/ |
| 1370 |
require_once( $path ); |
require_once( $path ); |
| 1371 |
if (!isset($this->_registered[$i])) { |
if (!isset($this->_registered[$i])) { |
| 1372 |
$botclass = str_replace('.','_',$bot->element); |
$botclass = str_replace('.','_',$bot->element); |
| 1373 |
|
if (class_exists($botclass)) { |
| 1374 |
$newbot = new $botclass(); |
$newbot = new $botclass(); |
| 1375 |
$function = array ($newbot, 'perform'); |
if (is_callable(array(&$newbot, 'register'))) { |
| 1376 |
$selected = $newbot->register(); |
$selected = $newbot->register(); |
| 1377 |
if (is_array($selected)) foreach ($selected as $select) $this->_events[$select][] = array($function, $i); |
$this->_botRegister($newbot, $selected, $i); |
| 1378 |
else $this->_events[$selected][] = array ($function, $i); |
} |
| 1379 |
$this->_registered[$i] = true; |
} |
| 1380 |
} |
} |
| 1381 |
$total++; |
$total++; |
| 1382 |
} |
} |