} } } if (!$Itemid) { // when no Itemid give a default value $Itemid = 99999999; } // mainframe is an API workhorse, lots of 'core' interaction routines $mainframe = new mosMainFrame($database, $option, '.'); $mainframe->initSession(); // trigger the onAfterStart events $_MAMBOTS->trigger('onAfterStart'); // checking if we can find the Itemid thru the content if ($option == 'com_content' && $Itemid === 0) { $id = intval(mosGetParam($_REQUEST, 'id', 0)); $Itemid = $mainframe->getItemid($id); } /** do we have a valid Itemid yet?? */ if ($Itemid === 0) { /** Nope, just use the homepage then. */ $query = "SELECT id" . "\n FROM #__menu" . "\n WHERE menutype = 'mainmenu'" . "\n AND published = 1" . "\n ORDER BY parent, ordering"; $database->setQuery($query, 0, 1); $Itemid = $database->loadResult(); } // patch to lessen the impact on templates if ($option == 'search') { $option = 'com_search'; } // loads english language file by default if ($mosConfig_lang == '') { $mosConfig_lang = 'english';