spath = ASCMS_MODULE_PATH."/support/index.class.php"; if (file_exists($modulespath)) { /** @ignore */ require_once($modulespath); } else { die ($_CORELANG['TXT_THIS_MODULE_DOESNT_EXISTS']); } $objSupport = new support($page_content); $objTemplate->setVariable("CONTENT_TEXT", $objSupport->getPage()); break; //------------------------------------------------------- // Partners Module //------------------------------------------------------- case "partners": $modulespath = "modules/partners/index.class.php"; /** * @ignore */ if (file_exists($modulespath)) require_once($modulespath); else die ($_CORELANG['TXT_THIS_MODULE_DOESNT_EXISTS']); $objPartners = new Partners($page_content); $objTemplate->setVariable('CONTENT_TEXT', $objPartners->getPage()); break; //------------------------------------------------------- // U2U Module //------------------------------------------------------- case "u2u": $modulespath = "modules/u2u/index.class.php"; if (file_exists($modulespath)) require_once($modulespath); else die($_CORELANG['TXT_THIS_MODULE_DOESNT_EXISTS']); $objAccess = new u2u($page_content); $objTemplate->setVariable('CONTENT_TEXT', $objAccess->getPage($page_metatitle, $page_title)); break; //------------------------------------------------------- // Auction Module //------------------------------------------------------- case "auction": $modulespath = "modules/auction/index.class.php"; /** * @ignore */ if (file_exists($modulespath)) require_once($modulespath); else die ($_CORELANG['TXT_THIS_MODULE_DOESNT_EXISTS']); $auction = new Auction($page_content); $objTemplate->setVariable("CONTENT_TEXT", $auction->getPage()); break; //------------------------------------------------------- // Download Module //------------------------------------------------------- case "downloads": $modulespath = "modules/downloads/index.class.php"; if (file_exists($modulespath)) require_once($modulespath); else die ($_CORELANG['TXT_THIS_MODULE_DOESNT_EXISTS']); $objDownloadsModule = new downloads($page_content); $objTemplate->setVariable('CONTENT_TEXT', $objDownloadsModule->getPage()); $downloads_pagetitle = $objDownloadsModule->getPageTitle(); if(!empty($downloads_pagetitle)) { $page_metatitle = $downloads_pagetitle; $page_title = $downloads_pagetitle; } break; //------------------------------------------------------- // default case //------------------------------------------------------- default: $objTemplate->setVariable('CONTENT_TEXT', $page_content); } //------------------------------------------------------- // show shop navbar on each page //------------------------------------------------------- if (isset($_CONFIGURATION['custom']['shopnavbar']) AND $_CONFIGURATION['custom']['shopnavbar'] == TRUE) { if (!is_object($shopObj)){ $modulespath = "modules/shop/index.class.php"; if (file_exists($modulespath)){ /** * @ignore */ require_once($modulespath); if (!is_object($sessionObj)) $sessionObj=new cmsSession(); $_ARRAYSHOPLANG = $objInit->loadLanguageData('shop'); $_ARRAYLANG = array_merge($_ARRAYLANG, $_ARRAYSHOPLANG); $boolShop = true; $shopObj = new Shop(); $objTemplate->setVariable('SHOPNAVBAR_FILE', $shopObj->getShopNavbar($themesPages['shopnavbar'])); } } } //------------------------------------------------------- // Calendar //------------------------------------------------------- // print_r($objTemplate->getPlaceholderList()); $calendarCheck1 = $objTemplate->placeholderExists('CALENDAR'); $calendarCheck2 = $objTemplate->placeholderExists('CALENDAR_EVENTS'); if(!empty($calendarCheck1) OR !empty($calendarCheck2)) { $modulespath = "modules/calendar/HomeCalendar.class.php"; if (file_exists($modulespath)){ /** * @ignore */ require_once($modulespath); $objHomeCalendar = new HomeCalendar(); if(!empty($calendarCheck1)) { $objTemplate->setVariable('CALENDAR', $objHomeCalendar->getHomeCalendar()); } if(!empty($calendarCheck2)) { $objTemplate->setVariable('CALENDAR_EVENTS', $objHomeCalendar->getHomeCalendarEvents()); } } } //------------------------------------------------------- // Directory Show Latest //------------------------------------------------------- //$directoryCheck = $objTemplate->blockExists('directoryLatest_row_1'); $directoryCheck = array(); for($i = 1; $i <= 10; $i++){ if($objTemplate->blockExists('directoryLatest_row_'.$i)){ array_push($directoryCheck, $i); } } if(!empty($directoryCheck)) { $modulespath = "modules/directory/index.class.php"; if (file_exists($modulespath)){ /** * @ignore */ require_once($modulespath); $objDirectory = new rssDirectory(''); if(!empty($directoryCheck)) { $objTemplate->setVariable('TXT_DIRECTORY_LATEST', $_CORELANG['TXT_DIRECTORY_LATEST']); $objDirectory->getBlockLatest($directoryCheck); } } } //------------------------------------------------------- // Market Show Latest //------------------------------------------------------- $marketCheck = $objTemplate->blockExists('marketLatest'); if(!empty($marketCheck)) { $modulespath = "modules/market/index.class.php"; if (file_exists($modulespath)){ /** * @ignore */ require_once($modulespath); $objMarket = new Market(''); if(!empty($marketCheck)) { $objTemplate->setVariable('TXT_MARKET_LATEST', $_CORELANG['TXT_MARKET_LATEST']); $objMarket->getBlockLatest(); } } } //------------------------------------------------------- // Set banner variables //------------------------------------------------------- if ($_CONFIG['bannerStatus'] == '1') { $modulespath = "core_modules/banner/index.class.php"; if (file_exists($modulespath)) { /** * @ignore */ include_once($modulespath); $objBanner = new Banner(); $objTemplate->setVariable(array( 'BANNER_GROUP_1' => $objBanner->getBannerCode(1, $pageId), 'BANNER_GROUP_2' => $objBanner->getBannerCode(2, $pageId), 'BANNER_GROUP_3' => $objBanner->getBannerCode(3, $pageId), 'BANNER_GROUP_4' => $objBanner->getBannerCode(4, $pageId), 'BANNER_GROUP_5' => $objBanner->getBannerCode(5, $pageId), 'BANNER_GROUP_6' => $objBanner->getBannerCode(6, $pageId), 'BANNER_GROUP_7' => $objBanner->getBannerCode(7, $pageId), 'BANNER_GROUP_8' => $objBanner->getBannerCode(8, $pageId), 'BANNER_GROUP_9' => $objBanner->getBannerCode(9, $pageId), 'BANNER_GROUP_10' => $objBanner->getBannerCode(10, $pageId) )); } if(isset($_REQUEST['bannerId'])){ $objBanner->updateClicks(intval($_REQUEST['bannerId'])); } } //------------------------------------------------------- // Frontend Editing: prepare needed code-fragments //------------------------------------------------------- $strFeInclude = $strFeLink = $strFeContent = null; if ($_CONFIG['frontendEditingStatus'] == 'on') { $modulespath = "core_modules/frontendEditing/frontendEditingLib.class.php"; if (file_exists($modulespath)) { /** * @ignore */ include_once($modulespath); $strFeInclude = frontendEditingLib::getIncludeCode(); $strFeLink = frontendEditingLib::getLinkCode(); $strFeContent = frontendEditingLib::getContentCode($pageId, $section, $command); } } //------------------------------------------------------- // set global template variables //------------------------------------------------------- $objTemplate->setVariable(array( 'CHARSET' => $objInit->getFrontendLangCharset(), 'TITLE' => $page_title, 'METATITLE' => $page_metatitle, 'NAVTITLE' => $page_catname, 'GLOBAL_TITLE' => $_CONFIG['coreGlobalPageTitle'], 'DOMAIN_URL' => $_CONFIG['domainUrl'], 'BASE_URL' => ASCMS_PROTOCOL.'://'.$_CONFIG['domainUrl'].ASCMS_PATH_OFFSET, 'METAKEYS' => $page_keywords, 'METADESC' => $page_desc, 'METAROBOTS' => $page_robots, 'CONTENT_TITLE' => ''.$page_title.'', 'CSS_NAME' => $pageCssName, 'PRINT_URL' => $objInit->getPrintUri(), 'PDF_URL' => $objInit->getPDFUri(), 'PAGE_URL' => htmlspecialchars($objInit->getPageUri()), 'CURRENT_URL' => $objInit->getCurrentPageUri(), 'DATE' => showFormattedDate(), 'TIME' => date("H:i", time()), 'NAVTREE' => $objNavbar->getTrail(), 'SUBNAVBAR_FILE' => $objNavbar->getNavigation($themesPages['subnavbar'],$boolShop), 'SUBNAVBAR2_FILE' => $objNavbar->getNavigation($themesPages['subnavbar2'],$boolShop), 'SUBNAVBAR3_FILE' => $objNavbar->getNavigation($themesPages['subnavbar3'],$boolShop), 'NAVBAR_FILE' => $objNavbar->getNavigation($themesPages['navbar'],$boolShop), 'ONLINE_USERS' => $objCounter->getOnlineUsers(), 'VISITOR_NUMBER' => $objCounter->getVisitorNumber(), 'COUNTER' => $objCounter->getCounterTag(), 'BANNER' => isset($objBanner) ? $objBanner->getBannerJS() : '', 'VERSION' => $_CONFIG['coreCmsName'], 'LANGUAGE_NAVBAR' => $objNavbar->getFrontendLangNavigation(), 'ACTIVE_LANGUAGE_NAME' => $objInit->getFrontendLangName(), 'RANDOM' => md5(microtime()), 'TXT_SEARCH' => $_CORELANG['TXT_SEARCH'], 'MODULE_INDEX' => MODULE_INDEX, 'LOGIN_INCLUDE' => (isset($strFeInclude) ? $strFeInclude : ''), 'LOGIN_URL' => (isset($strFeLink) ? $strFeLink : ''), 'LOGIN_CONTENT' => (isset($strFeContent) ? $strFeContent : ''), 'JAVASCRIPT' => "javascript_inserting_here" )); if ($objTemplate->blockExists('access_logged_in')) { $objFWUser = FWUser::getFWUserObject(); if ($objFWUser->objUser->login()) { $objFWUser->setLoggedInInfos(); $objTemplate->parse('access_logged_in'); } else { $objTemplate->hideBlock('access_logged_in'); } } if ($objTemplate->blockExists('access_logged_out')) { $objFWUser = FWUser::getFWUserObject(); if ($objFWUser->objUser->login()) { $objTemplate->hideBlock('access_logged_out'); } else { $objTemplate->touchBlock('access_logged_out'); } } // currently online users if (FWUser::showCurrentlyOnlineUsers()) { if ($objTemplate->blockExists('access_currently_online_member_list')) { if ($objTemplate->blockExists('access_currently_online_female_members')) { // TODO: // $objAccessBlocks is never even mentioned in the code above! // Just inititialize the object when either males or females are shown. if (isset($objAccessBlocks) && is_object($objAccessBlocks) || ($modulespath = 'core_modules/access/lib/blocks.class.php') && file_exists($modulespath) && (include_once($modulespath)) && ($objAccessBlocks = new Access_Blocks()) ) { $objAccessBlocks->setCurrentlyOnlineUsers('female'); } } if ($objTemplate->blockExists('access_currently_online_male_members')) { if (isset($objAccessBlocks) && is_object($objAccessBlocks) || ($modulespath = 'core_modules/access/lib/blocks.class.php') && file_exists($modulespath) && (include_once($modulespath)) && ($objAccessBlocks = new Access_Blocks()) ) { $objAccessBlocks->setCurrentlyOnlineUsers('male'); } } if ($objTemplate->blockExists('access_currently_online_members')) { if (isset($objAccessBlocks) && is_object($objAccessBlocks) || ($modulespath = 'core_modules/access/lib/blocks.class.php') && file_exists($modulespath) && (include_once($modulespath)) && ($objAccessBlocks = new Access_Blocks()) ) { $objAccessBlocks->setCurrentlyOnlineUsers(); } } } } elseif ($objTemplate->blockExists('access_currently_online_member_list')) { $objTemplate->hideBlock('access_currently_online_member_list'); } // last active users if (FWUser::showLastActivUsers()) { if ($objTemplate->blockExists('access_last_active_member_list')) { if ($objTemplate->blockExists('access_last_active_female_members')) { if (isset($objAccessBlocks) && is_object($objAccessBlocks) || ($modulespath = 'core_modules/access/lib/blocks.class.php') && file_exists($modulespath) && (include_once($modulespath)) && ($objAccessBlocks = new Access_Blocks()) ) { $objAccessBlocks->setLastActiveUsers('female'); } } if ($objTemplate->blockExists('access_last_active_male_members')) { if (isset($objAccessBlocks) && is_object($objAccessBlocks) || ($modulespath = 'core_modules/access/lib/blocks.class.php') && file_exists($modulespath) && (include_once($modulespath)) && ($objAccessBlocks = new Access_Blocks()) ) { $objAccessBlocks->setLastActiveUsers('male'); } } if ($objTemplate->blockExists('access_last_active_members')) { if (isset($objAccessBlocks) && is_object($objAccessBlocks) || ($modulespath = 'core_modules/access/lib/blocks.class.php') && file_exists($modulespath) && (include_once($modulespath)) && ($objAccessBlocks = new Access_Blocks()) ) { $objAccessBlocks->setLastActiveUsers(); } } } } elseif ($objTemplate->blockExists('access_last_active_member_list')) { $objTemplate->hideBlock('access_last_active_member_list'); } // latest registered users if (FWUser::showLatestRegisteredUsers()) { if ($objTemplate->blockExists('access_latest_registered_member_list')) { if ($objTemplate->blockExists('access_latest_registered_female_members')) { if (isset($objAccessBlocks) && is_object($objAccessBlocks) || ($modulespath = 'core_modules/access/lib/blocks.class.php') && file_exists($modulespath) && (include_once($modulespath)) && ($objAccessBlocks = new Access_Blocks()) ) { $objAccessBlocks->setLatestRegisteredUsers('female'); } } if ($objTemplate->blockExists('access_latest_registered_male_members')) { if (isset($objAccessBlocks) && is_object($objAccessBlocks) || ($modulespath = 'core_modules/access/lib/blocks.class.php') && file_exists($modulespath) && (include_once($modulespath)) && ($objAccessBlocks = new Access_Blocks()) ) { $objAccessBlocks->setLatestRegisteredUsers('male'); } } if ($objTemplate->blockExists('access_latest_registered_members')) { if (isset($objAccessBlocks) && is_object($objAccessBlocks) || ($modulespath = 'core_modules/access/lib/blocks.class.php') && file_exists($modulespath) && (include_once($modulespath)) && ($objAccessBlocks = new Access_Blocks()) ) { $objAccessBlocks->setLatestRegisteredUsers(); } } } } elseif ($objTemplate->blockExists('access_latest_registered_member_list')) { $objTemplate->hideBlock('access_latest_registered_member_list'); } // birthday users if (FWUser::showBirthdayUsers()) { if ($objTemplate->blockExists('access_birthday_member_list')) { if ( ( isset($objAccessBlocks) && is_object($objAccessBlocks) || ($modulespath = 'core_modules/access/lib/blocks.class.php') && file_exists($modulespath) && (include_once($modulespath)) && ($objAccessBlocks = new Access_Blocks()) ) && $objAccessBlocks->isSomeonesBirthdayToday() ) { if ($objTemplate->blockExists('access_birthday_female_members')) { $objAccessBlocks->setBirthdayUsers('female'); } if ($objTemplate->blockExists('access_birthday_male_members')) { $objAccessBlocks->setBirthdayUsers('male'); } if ($objTemplate->blockExists('access_birthday_members')) { $objAccessBlocks->setBirthdayUsers(); } $objTemplate->touchBlock('access_birthday_member_list'); } else { $objTemplate->hideBlock('access_birthday_member_list'); } } } elseif ($objTemplate->blockExists('access_birthday_member_list')) { $objTemplate->hideBlock('access_birthday_member_list'); } //------------------------------------------------------- // parse system //------------------------------------------------------- $parsingtime = explode(' ', microtime()); $time = round(((float)$parsingtime[0] + (float)$parsingtime[1]) - ((float)$starttime[0] + (float)$starttime[1]), 5); $objTemplate->setVariable('PARSING_TIME', $time); //Allow PRINT_URL & PDF_URL in sidebar $themesPages['sidebar'] = str_replace('{PRINT_URL}',$objInit->getPrintUri(), $themesPages['sidebar']); $themesPages['sidebar'] = str_replace('{PDF_URL}',$objInit->getPDFUri(), $themesPages['sidebar']); $objTemplate->setVariable(array( 'SIDEBAR_FILE' => $themesPages['sidebar'], 'JAVASCRIPT_FILE' => $themesPages['javascript'], 'BUILDIN_STYLE_FILE' => $themesPages['buildin_style'] )); $objTemplate->setVariable(array( 'JAVASCRIPT_LIGHTBOX' => ' ' )); $objTemplate->setVariable(array( 'JAVASCRIPT_MOBILE_DETECTOR' => '' )); if (!empty($moduleStyleFile)) { $objTemplate->setVariable(array( 'STYLE_FILE' => "" )); } if (isset($_GET['pdfview']) && intval($_GET['pdfview']) == 1) { require_once ASCMS_CORE_PATH.'/pdf.class.php'; $objPDF = new PDF(); $objPDF->title = $page_title.(!empty($page_title) ? '.pdf' : null); $objPDF->content = $objTemplate->get(); $objPDF->Create(); } else { /** * Get all javascripts in the code, replace them with nothing, and register the js file * to the javascript lib. This is because we don't want something twice, and there could be * a theme that requires a javascript, which then could be used by a module too and therefore would * be loaded twice. */ $endcode = $objTemplate->get(); /* Finds all uncommented script tags, strips them out of the HTML and * stores them internally so we can put them in the placeholder later * (see JS::getCode() below) */ JS::findJavascripts($endcode); /* * Proposal: Use this * $endcode = preg_replace_callback('/