browser_is("ie5.5+")) && ($client->property('platform') == "win")) || ($client->browser_is("mz1.3+")) ) { $ie_ok = 1; } else { $ie_ok = 0; } // check requested module and set to start module if not present if (empty($name)) { $name = pnConfigGetVar('startpage'); } if (empty($module)){ $module = $name; } // get module information $modinfo = pnModGetInfo(pnModGetIDFromName($module)); // New-style of loading modules if ($modinfo['type'] == 2) { if (empty($type)) { $type = 'user'; } if (empty($func)) { $func = 'main'; } // if (empty($return)) { $return = 'error'; // } if (pnModAvailable($module)) { if (pnModLoad($module, $type)) { // Run the function $return = pnModFunc($module, $type, $func); } else { // Failed to load the module pnRedirect(pnModURL('Errore', 'admin', 'main', array('op' => 'noexist','modname' => $module,'modfile' => $func))); break; } } else { // Failed to load the module pnRedirect(pnModURL('Errore', 'admin', 'main', array('op' => 'noexist','modname' => $module,'modfile' => $func))); break; } if (empty($return) || $return == false) { // Failed to load the module //-- $output = new pnHTML(); //-- $output->StartPage(); //-- $output->Text('Failed to load module ' . $module .' ( At function: "'.$func.'" )'); //-- $output->EndPage(); //-- $output->PrintPage(); pnRedirect(pnModURL('Errore', 'admin', 'main', array('op' => 'noexist','modname' => $module,'modfile' => $func))); exit; } elseif (strlen($return) > 1) { // Text if ((pnModGetVar('rtemulti','RteEnable')==1)and(pnModAvailable('RteMulti'))and($ie_ok)) { $output = new pnHTML(); if (!pnModAPILoad('RteMulti', 'user')) { $output->Text(_LOADFAILED); //return $output->GetOutput(); } // WindMeUp TEST $output->StartPage(); $output->EndPage(); $output->ManipulatePage(); $output->PrintPage(); exit; // WindMeUp TEST END } else { $output = new pnHTML(); $output->StartPage(); $output->SetInputMode(_PNH_VERBATIMINPUT); $output->Text($return); $output->SetInputMode(_PNH_PARSEINPUT); $output->EndPage(); $output->PrintPage(); exit; } } exit; // Old-style of loading modules } else { if (empty($op)) { $op = "modload"; } if (empty($file)) { $file = "index"; } switch ($op) { case 'modload': define("LOADED_AS_MODULE", "1"); include_once 'includes/legacy.php'; if (!file_exists('modules/' . pnVarPrepForOS($module) . '/' . pnVarPrepForOS($file) . '.php')) { pnRedirect(pnModURL('Errore', 'admin', 'main', array('op' => 'noexist','modname' => $module,'modfile' => $file))); break; } if (!pnModAvailable($module)) { pnRedirect(pnModURL('Errore', 'admin', 'main', array('op' => 'noactive','modname' => $module,'modfile' => $file))); break; } include 'modules/'.pnVarPrepForOS($module).'/'.pnVarPrepForOS($file).'.php'; if (function_exists('session_write_close')) { session_write_close(); } else { // Hack for old versions of PHP with bad session save $sessvars = ''; foreach ($GLOBALS as $k => $v) { if ((preg_match('/^PNSV/', $k)) && (isset($v))) { $sessvars .= "$k|" . serialize($v); } } pnSessionWrite(session_id(), $sessvars); } break; default: // Failed to load the module $output = new pnHTML(); $output->StartPage(); $output->Text('Sorry, you cannot access this file directly...'); $output->EndPage(); $output->PrintPage(); break; } } ?>