$var) { $filter_tmp = array(); if(strpos($var, ':') != 0) { $filter_tmp = explode(":", $var); $filters_url[$filter_tmp[0]] = $filter_tmp[1]; unset($vars_tmp[$k]); } } $_GET['rlVareables'] = implode("/", $vars_tmp); unset($vars_tmp); unset($filter_tmp); $_SERVER['REQUEST_URI'] = trim($_SERVER['REQUEST_URI'], "/"); $server_uri = explode("/", $_SERVER['REQUEST_URI']); foreach($server_uri as $k => $server) { if(strpos($server, ':') != 0) { unset($server_uri[$k]); } } $_SERVER['REQUEST_URI'] = '/' . implode("/", $server_uri) . '/'; unset($server_uri); } // end check filters /* system controller */ require_once( RL_INC . 'control.inc.php' ); $rlHook -> load('init'); /* load cache control */ $reefless -> loadClass('Cache'); /* load template settings */ $ts_path = RL_ROOT . 'templates' . RL_DS . $config['template'] . RL_DS . 'settings.tpl.php'; if ( is_readable( $ts_path ) ) { require_once( $ts_path ); } /* check user login */ $reefless -> loadClass( 'Account' ); if ( $rlAccount -> isLogin() ) { $rlSmarty -> assign( 'isLogin', $_SESSION['account']['Username'] ); define( 'IS_LOGIN', true ); $account_info = $_SESSION['account']; $rlSmarty -> assign_by_ref('account_info', $account_info); } if(isset($_GET['test5'])) { echo 5; exit; } /* rewrite GET method vareables */ $reefless -> loadClass( 'Navigator' ); $rlNavigator -> rewriteGet( $_GET['rlVareables'], $_GET['page'], $_GET['language'] ); /* define site languages */ $rlDb -> setTable( 'languages' ); $rlLang -> defineLanguage( $rlNavigator -> cLang ); if(isset($_GET['test6'])) { echo 6; exit; } /* load all fronEnd phrases */ $lang = $rlLang -> getLangBySide( 'frontEnd', RL_LANG_CODE ); $GLOBALS['lang'] = &$lang; $rlSmarty -> assign_by_ref( 'lang', $lang ); /* load system libs */ require_once( RL_LIBS . 'system.lib.php' ); /* account abilities handler */ $reefless -> loadClass('ListingTypes', null, false, true); foreach ( $rlListingTypes -> types as $listingType ) { if ( !in_array($listingType['Key'], $account_info['Abilities']) ) { $deny_pages[] = 'my_'. $listingType['Key']; } /* count admin only types */ $admin_only_types += $listingType['Admin_only'] ? 1 : 0; } unset($listingType); $rlSmarty -> assign_by_ref('admin_only_types', $admin_only_types); if ( empty($account_info['Abilities']) || empty($rlListingTypes -> types) || $admin_only_types == count($rlListingTypes -> types) ) { $deny_pages[] = 'add_listing'; $deny_pages[] = 'payment_history'; $deny_pages[] = 'my_packages'; } /* assign base path */ $bPath = RL_URL_HOME; if ($config['lang'] != RL_LANG_CODE && $config['mod_rewrite']) { $bPath .= RL_LANG_CODE . '/'; } if (!$config['mod_rewrite']) { $bPath .= 'index.php'; } define( 'SEO_BASE', $bPath ); $rlSmarty -> assign( 'rlBase', $bPath); define('RL_TPL_BASE', RL_URL_HOME . 'templates/' . $config['template'] . '/'); $rlSmarty -> assign( 'rlTplBase', RL_TPL_BASE ); if(isset($_GET['test4'])) { echo 4; exit; } /* get all pages keys/paths */ $pages = $rlNavigator -> getAllPages(); $rlSmarty -> assign_by_ref( 'pages', $pages ); /* define system page */ $page_info = $rlNavigator -> definePage(); /* save previous visited page key */ if ($_SERVER['REDIRECT_REDIRECT_STATUS'] != 404) { $page_info['prev'] = $_SESSION['page_info']['current'] ? $_SESSION['page_info']['current'] : false; $_SESSION['page_info']['current'] = $page_info['Key']; } $rlHook -> load('pageinfoArea'); /* load mobile class */ $reefless -> loadClass('Mobile'); if ( $rlMobile -> isMobile ) { $config['featured_per_page'] = $config['mobile_featured_number']; $config['messages_module'] = 1; $rlSmarty -> register_function('paging_mobile', array( 'rlMobile', 'paging' )); } $rlSmarty -> assign_by_ref( 'pageInfo', $page_info ); /* redirect link handler */ $currentPage = trim($_SERVER['REQUEST_URI'], '/'); if ( $config['lang'] != $rlNavigator -> cLang ) { $currentPage = substr($currentPage, 3, strlen($currentPage)); $currentPage = !(bool)preg_match('/\.html$/', $currentPage) ? $currentPage .'/' : $currentPage; } elseif ( strlen($currentPage) == 2 ) { $currentPage = ''; } $rlSmarty -> assign_by_ref( 'pageLink', $currentPage ); $linkPage = $rlNavigator -> cPage == 'index' ? "" : $rlNavigator -> cPage; $rlSmarty -> assign_by_ref( 'page', $linkPage ); if(isset($_GET['test7'])) { echo 7; exit; } /* load page controller */ if ( $page_info['Tpl'] ) { require_once( RL_CONTROL . 'common.inc.php' ); /* assign available hooks */ $rlCommon -> getHooks(); } /* load page controller */ if ( $page_info['Controller'] != '404' ) { if ( $page_info['Plugin'] ) { require_once( RL_PLUGINS . $page_info['Plugin'] . RL_DS . $page_info['Controller'] . '.inc.php' ); } else { if(isset($_GET['test8'])) { echo 8; exit; } require_once( RL_CONTROL . $page_info['Controller'] . '.inc.php' ); if(isset($_GET['test9'])) { echo 9; exit; } } /* load 404 page */ if ( $sError === true ) { $rlSmarty -> assign_by_ref( 'errors', $GLOBALS['lang']['error_404'] ); unset($page_info['Controller']); } } else { $rlSmarty -> assign_by_ref( 'errors', $GLOBALS['lang']['error_404'] ); } /* get notice */ if (isset( $_SESSION['notice'] )) { $reefless -> loadClass( 'Notice' ); $pNotice = $_SESSION['notice']; $rlSmarty -> assign_by_ref( 'pNotice', $pNotice ); $rlNotice -> resetNotice(); } /* assign errors */ if ( !empty($errors) ) { $rlSmarty -> assign_by_ref( 'errors', $errors ); $rlSmarty -> assign('error_fields', $error_fields); } /* ajax process request / get javascripts */ $rlXajax -> processRequest(); ob_start(); $rlXajax -> printJavascript(); $ajax_javascripts = ob_get_contents(); ob_end_clean(); /* assign ajax javascripts */ $rlSmarty -> assign_by_ref( 'ajaxJavascripts', $ajax_javascripts ); /* load boot hooks */ $rlHook -> load('boot'); /* exit in ajax mode */ if ( $_REQUEST['xjxfun'] ) { exit; } /* load templates */ if ( $page_info['Tpl'] ) { $rlSmarty -> assign_by_ref( 'bread_crumbs', $bread_crumbs ); $rlCommon -> pageTitle($bread_crumbs); $page_info['Login'] = !empty($page_info['Deny']) ? 1 : $page_info['Login']; $rlSmarty -> display( 'header.tpl' ); if ( $page_info['Login'] && !defined('IS_LOGIN') ) { $page_info['Controller'] = 'login'; $page_info['Plugin'] = ''; $page_info['Page_type'] = 'system'; $rlSmarty -> assign( 'request_page', $page_info['Path'] ); $rlSmarty -> assign( 'errors', $lang['notice_should_login'] ); } elseif ( (isset($account_info['Type']) && in_array($account_info['Type_ID'], explode(',', $page_info['Deny']))) || (isset($account_info['Abilities'][$page_info['Key']]) && $account_info['Abilities'][$page_info['Key']] === false) ) { $page_info['Controller'] = '404'; $page_info['Page_type'] = 'system'; $rlSmarty -> assign( 'request_page', $page_info['Path'] ); $rlSmarty -> assign( 'errors', $lang['notice_account_access_deny'] ); } if ( $page_info['Plugin'] ) { $rlSmarty -> assign( 'content', RL_PLUGINS . $page_info['Plugin'] . RL_DS . $page_info['Controller'] . '.tpl' ); } else { $rlSmarty -> assign( 'content', 'controllers' . RL_DS . $page_info['Controller'] . '.tpl' ); } if(isset($_GET['test11'])) { echo 11; exit; } $rlSmarty -> display( 'content.tpl' ); if(isset($_GET['test12'])) { echo 12; exit; } $rlSmarty -> display( 'footer.tpl' ); if(isset($_GET['test13'])) { echo 13; exit; } } else { if ( $page_info['Login'] && !defined('IS_LOGIN') ) { $page_info['Controller'] = 'login'; $page_info['Page_type'] = 'system'; $rlSmarty -> assign( 'request_page', $page_info['Path'] ); $rlSmarty -> assign( 'errors', $lang['notice_should_login'] ); } if ( $page_info['Page_type'] == 'system' ) { $rlSmarty -> display( 'controllers' . RL_DS . $page_info['Controller'] . '.tpl' ); } else { require_once( RL_CONTROL . $page_info['Controller'] . '.inc.php' ); echo $content['Value']; } }