setBasePath($bp ? "/".$bp : ""); /* Setup the URL routing. This is production ready. */ // Main routes that non-customers see $router->map('GET|POST','/', 'home.php'); $router->map('GET|POST','/test.php', 'test.php'); $router->map('GET|POST','/search', 'search.php'); $router->map('GET|POST','/home/[a:lang]?/?', 'home.php'); $router->map('GET|POST','/home/[a:lang]?/[a:country]?/?', 'home.php'); $router->map('GET|POST','/signup/?', 'signup.php'); $router->map('GET|POST','/index1/?', 'index1.php'); $router->map('GET|POST','/index2/?', 'index2.php'); $router->map('GET|POST','/login/?', 'login.php'); $router->map('GET|POST','/logout/?', 'logout.php'); $router->map('GET|POST','/message/?', 'message.php'); $router->map('GET|POST','/forgot_password/?', 'forgot.php'); $router->map('GET|POST','/dashboard/?', 'dashboard.php'); $router->map('GET|POST','/my_ads/[*:page]?/?', 'ad-my.php'); $router->map('GET|POST','/pending_ads/[*:page]?/?', 'ad-pending.php'); $router->map('GET|POST','/expire_ads/[*:page]?/?', 'ad-expire.php'); $router->map('GET|POST','/favourite_ads/[*:page]?/?', 'ad-favourite.php'); $router->map('GET|POST','/hidden_ads/[*:page]?/?', 'ad-hidden.php'); $router->map('GET|POST','/resubmission_ads/[*:page]?/?', 'ad-resubmission.php'); $router->map('GET|POST','/my_transaction/?', 'transaction.php'); $router->map('GET|POST','/account_setting/?', 'account-setting.php'); $router->map('GET|POST','/report_ads/?', 'report.php'); $router->map('GET|POST','/contact_us/?', 'contact.php'); $router->map('GET|POST','/site_status/?', 'sitemap.php'); $router->map('GET|POST','/countries/?', 'countries.php'); $router->map('GET|POST','/faq/?', 'faq.php'); $router->map('GET|POST','/feedback_us/?', 'feedback.php'); $router->map('GET|POST','/test/?', 'test.php'); $router->map('GET|POST','/my_messages', 'my_messages.php'); $router->map('GET|POST','/my_wallet', 'my_wallet.php'); $router->map('GET|POST','/my_payments', 'my_payments.php'); $router->map('GET|POST','/term_condition.php', 'term_condition.php'); $router->map('GET|POST','/safety', 'safety.php'); // Profile $router->map('GET|POST','/profile/?', 'my_profile.php'); $router->map('GET|POST','/profile_edit', 'profile_edit.php'); // Special (GET processing, etc) $router->map('GET|POST','/my_profile/[*:username]?/[*:page]?/?','profile.php'); $router->map('GET|POST','/ad/[i:id]?/[*:slug]?/?', 'ad-detail.php'); $router->map('GET|POST','/profile/[i:id]?/[*:slug]?/?', 'ad-user.php'); $router->map('GET|POST','/post_ads/[a:lang]?/[a:country]?/[a:action]?/?', 'ad-post.php'); $router->map('GET|POST','/edit_ads/[i:id]?/[a:lang]?/[a:country]?/[a:action]?/?', 'ad-edit.php'); $router->map('GET|POST','/listing_ads/?', 'listing.php'); $router->map('GET|POST','/category/[*:cat]?/[*:subcat]?/[*:subsubcat]?/[*:subsubsubcat]?/[*:subsubsubsubcat]?/?', 'listing.php'); $router->map('GET|POST','/category/[*:cat]?/[*:subcat]?/[*:subsubcat]?/[*:subsubsubcat]?/?', 'listing.php'); $router->map('GET|POST','/category/[*:cat]?/[*:subcat]?/[*:subsubcat]?/?', 'listing.php'); $router->map('GET|POST','/category/[*:cat]?/[*:subcat]?/?', 'listing.php'); $router->map('GET|POST','/sub-category/[*:subcat]?/[*:slug]?/?', 'listing.php'); $router->map('GET|POST','/city/[i:city]?/[*:slug]?/?', 'listing.php'); $router->map('GET|POST','/keywords/[*:keywords]?/?', 'listing.php'); $router->map('GET|POST','/page/[*:id]?/?', 'html.php'); $router->map('GET|POST','/premium_membership/[a:change_plan]?/?', 'membership.php'); $router->map('GET|POST','/ipn/[a:i]?/[*:id]?/?', 'ipn.php'); $router->map('GET|POST','/payments/[*:token]?/[a:status]?/[*:message]?/?', 'payment.php'); $router->map('GET','/sitemap.xml/?', 'xml.php'); // API Routes /* Match the current request */ $match=$router->match(); if($match) { if ($_SERVER["REQUEST_METHOD"] == "GET") { $_GET = array_merge($match['params'],$_GET); } require_once ROOTPATH . '/includes/config.php'; if(!isset($config['installed'])) { $protocol = stripos($_SERVER['SERVER_PROTOCOL'],'https') === true ? 'https://' : 'http://'; $site_url = $protocol . $_SERVER['HTTP_HOST'] . str_replace ("index.php", "", $_SERVER['PHP_SELF']); header("Location: ".$site_url."install/"); exit; } require_once ROOTPATH . '/includes/sql_builder/idiorm.php'; require_once ROOTPATH . '/includes/db.php'; require_once ROOTPATH . '/includes/classes/class.template_engine.php'; require_once ROOTPATH . '/includes/classes/class.country.php'; require_once ROOTPATH . '/includes/functions/func.global.php'; require_once ROOTPATH . '/includes/lib/password.php'; require_once ROOTPATH . '/includes/functions/func.users.php'; require_once ROOTPATH . '/includes/functions/func.sqlquery.php'; require_once ROOTPATH . '/includes/classes/GoogleTranslate.php'; if(isset($_GET['lang'])) { if ($_GET['lang'] != ""){ change_user_lang($_GET['lang']); } } require_once ROOTPATH . '/includes/lang/lang_'.$config['lang'].'.php'; require_once ROOTPATH . '/includes/seo-url.php'; $mysqli = db_connect(); redirectMobile(true); sec_session_start(); require APPPATH.$match['target']; } else { redirectMobile(); header("HTTP/1.0 404 Not Found"); require APPPATH.'404.php'; }