_record_fetched || !$Language->is_used) { unset($lang); if($lang_from_cookie) { $lang = $lang_from_cookie; $Language = new CLanguage($lang); if(!$Language->_record_fetched || !$Language->is_used) { unset($lang); } } } } // if language is not set from URL or Cookie then attempt to find it from the browser, or from the default allowed Language if(!$lang) { $Language = CLanguage::get_matched_browser_language(); $lang = $Language->code; } CCookie::set('lang', $lang); // On Windows: //http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vclib/html/_crt_language_strings.asp //http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vclib/html/_crt_country_strings.asp //"can" or "canada" //"frc" or "french-canadian" //"fra" or "french" if($lang=='fr') { if(!setlocale(LC_TIME, "fr_FR")) { // unix setlocale(LC_TIME, "can", "french-canadian"); // windows } } //echo htmlentities(strftime( "%B %d, %Y", strtotime('2008-12-05'))); // my_print_r($lang, '$lang'); // my_print_r($Language, '$Language'); //$lang = $URL->set_language($lang); //$en = CLanguage::get_instance('en'); //my_print_r($en, '$en'); // initialize the mainframe object $mainframe = &new CMainFrame(); if (!CCounter::was_counted('sessions')) { $counter = new CCounter(); $counter->add_count('sessions'); } $categoryID = _POST_GET('catID', 'PG', 0); // Initialize a new CMember object from Session. // Attempt to get the logged-in member from session or from cookie // If (Cannot Login from Session) -and- (Cannot Login from Cookie) -then- Initialize an empty $member variable if ( !($member = CMember::initLoginFromSession()) && !($member = CMember::initLoginFromCookie()) ) { //echo "Failed Login
"; $member = & new CMember(); } // Get the currently logged-in administrator - If Cannot Login from Session or Cookie -then- Initialize an empty $AdminUser variable uses_model('CAdminUser'); if ( !($AdminUser = CAdminUser::initLoginFromSession())&& !($AdminUser = CAdminUser::initLoginFromCookie())) { $AdminUser = & new CAdminUser(); } // if an admin is logged in, then set the $admin_logged_in flag so that we may display administration icons. $admin_logged_in = $AdminUser->isLoggedIn(); if($admin_logged_in) { $display_front_links = $AdminUser->display_front_links; } // Dispatch Ajax Calls if this is an ajax call if(isAjax()) { require_once 'main.ajax.php'; } $mainframe->set_member($member); // make the main menu module and call it's initialization functions $module = & new CModuleManager(AE_CURRENT_LOCATION); //my_print_r($module->name, '$module->name'); // if failed loading the main module, substitute it with the 404 page module if (!$module->require_moduleFile()) { //echo "ERROR1"; $module = & new CModuleManager('front', '404'); if (!$module->require_moduleFile()) { echo "Failed including 404 module file!"; // last resort } } $module->construct_module($mainframe); $mainframe->set_main_module($module->Module); // set the actual module inside the $mainframe $Module = & $module->Module; // for forward compatibility $Module->lang = $lang; $module->setMemberObject($member); // call module's functions $module->call_module_init(); $module->call_module_properties($property); if (!$module->Module->_no_gzip && getConfigValue('USE_GZIP')) { ob_start("ob_gzhandler"); } // LUKAS: COMMENT THIS OUT! //$debug = _POST_GET('debug', 'GS', 'N'); if ($debug == 't') show_debug_info(); $_SESSION['debug'] = $debug; //getConfigValues($meta, 'META'); //my_print_r($meta, '$meta'); uses_model('CListItem'); CListItem::fetch_list_array($meta, 'META_TAGS'); // Define meta tags keywords and description. $meta['keywords'] = $Module->get_meta_tag('keywords'); $meta['description'] = $Module->get_meta_tag('description'); $meta['title'] = $module->getPageTitle($meta['title']." - "); // 2009-03-30 New URL class now contains $Link attribute //$link = $URL->Link->make(); //my_print_r($URL->Link, '$URL->Link'); //echo "

$link

"; //echo "\n"; // 2009-03-30 Prepare links to this URL for each language $Links['fr'] = $URL->Link; $Links['fr']->params['lang'] = 'fr'; $Links['en'] = $URL->Link; $Links['en']->params['lang'] = 'en'; //echo "

make()."'>".$Links['en']->make()."

"; //echo "

make()."'>".$Links['fr']->make()."

"; // Include the main page template and render it include ($MAIN_TEMPLATE ? $MAIN_TEMPLATE : 'main.template.php'); //my_print_r($meta, '$meta'); /** * Assigns all the template values for blocks items */ function display_block_group($group, $module_name) { $array_blocks_obj = CBlock::get_enabled_blocks($group, $module_name); $array_vals = CBlock::get_blocks_tpl_vals($array_blocks_obj); $tpl = new CSmarty(); // assign all values for blocks $tpl->assign( 'block_items_count', count($array_vals), false); $tpl->assign( 'block_items', $array_vals, false); // Include the main template blocks $tpl->display('tpl.blocks.htm'); } if (isset($_GET['ACKLEYVERSIONQUERY'])) { ackley_version_query(); }