<?php
/**
* Site map
*
*
* @package DatingPro
* @subpackage User Mode
**/
include_once "./include/config.php";
include_once "./include/config_index.php";
include_once "./common.php";
include_once "./include/functions_index.php";
include_once "./include/functions_auth.php";
include_once "./include/functions_affiliate.php";
include_once "./include/class.lang.php";

$multi_lang = new MultiLang($config, $dbconn);
$field_name = $multi_lang->DefaultFieldName();

$user = auth_index_user();
RefreshAccount($user);
$smarty->assign("sub_menu_num", '0');
Banners(GetRightModulePath(__FILE__));
LeftMenu();
IndexHomePage();
unset ($_SESSION["search_pars"]);
$smarty->assign("my_left_menu", LeftNavigation());

GetMetaTags("map");

GoogleAnalytics($config["google_analytics_activate"], $config["manual_tracker_activate"]);

$smarty->assign("active_user_info", GetActiveUserInfo($user));

$map_links = Array();

$element_arr = array("name"=>$lang["languages"]["title"], "link"=>'', "level"=>1, "is_folder"=>1, "is_active"=>0);
array_push($map_links, $element_arr);
	
foreach($lang_link as $value){
	if(isset($config["use_global_seo"]) && $config["use_global_seo"])
		$element_arr = array("name"=>$value['name'], "link"=>$config['server'].'/'.$value['code'].'/index.php', "level"=>2, "is_folder"=>0, "is_active"=>1);
	else
		$element_arr = array("name"=>$value['name'], "link"=>seo('index', 1).'?language_code='.$value['id'], "level"=>2, "is_folder"=>0, "is_active"=>1);
	
    array_push($map_links, $element_arr);
}

// sitemap for guests
if($user[0] == 2){
    // index
    $element_arr = array("name"=>$lang["top"]["index"], "link"=>$config["server"].$config_index["top_menu"]["index"], "level"=>1, "is_folder"=>1, "is_active"=>1);
    array_push($map_links, $element_arr);
    
    $element_arr = array("name"=>$lang["top"]["register"], "link"=>$config["server"].$config_index["top_menu"]["register"], "level"=>2, "is_folder"=>0, "is_active"=>1);
    array_push($map_links, $element_arr);    
    ////// tell a friend
    $element_arr = array("name"=>$lang["tell_a_friend"]["top_header"], "link"=>seo('tell_a_friend', 1), "level"=>2, "is_folder"=>0, "is_active"=>1);
    array_push($map_links, $element_arr);

    // Chat
    if ($config["use_pilot_module_flashchat"] == 1) {
            $element_arr = array("name"=>$lang["section"]["chat"], "link"=>$config["server"].$config_index["leftmenu_path"][4], "level"=>1, "is_folder"=>0, "is_active"=>1, "is_new_window"=>1);
    } elseif ($config["use_pilot_module_webchat"] == 1) {
            $element_arr = array("name"=>$lang["section"]["chat"], "link"=>$config["server"].$config_index["leftmenu_path"][24], "level"=>1, "is_folder"=>0, "is_active"=>1, "is_new_window"=>1);
    }
    array_push($map_links, $element_arr);

    // IM
    $element_arr = array("name"=>$lang["section"]["im"], "link"=>$config["server"].$config_index["leftmenu_path"][20], "level"=>1, "is_folder"=>0, "is_active"=>1, "is_new_window"=>1, "on_click" => "javascript: open_im_window(); return false;");
    array_push($map_links, $element_arr);

    // forum module
    if (isset($config["use_pilot_module_forum"]) && $config["use_pilot_module_forum"] == 1) {
            $element_arr = array("name"=>$lang["section"]["forum"], "link"=>$config["server"].$config_index["leftmenu_path"][21], "level"=>1, "is_folder"=>0, "is_active"=>1);
            array_push($map_links, $element_arr);
    }
    // events module
    if (isset($config["use_pilot_module_events"]) && $config["use_pilot_module_events"] == 1) {
            $element_arr = array("name"=>$lang["section"]["events"], "link"=>$config["server"].$config_index["leftmenu_path"][23], "level"=>1, "is_folder"=>0, "is_active"=>1);
            array_push($map_links, $element_arr);
    }
    
    // club module
    if (isset($config["use_pilot_module_club"]) && $config["use_pilot_module_club"] == 1) {
            $element_arr = array("name"=>$lang["section"]["club"], "link"=>$config["server"].$config_index["leftmenu_path"][27], "level"=>1, "is_folder"=>0, "is_active"=>1);
            array_push($map_links, $element_arr);
    }

	// New faces
    $element_arr = array("name"=>$lang["new_faces"], "link"=>$config["server"]."/".seo('new_faces', 0), "level"=>1, "is_folder"=>0, "is_active"=>1);
    array_push($map_links, $element_arr);

	//top_users
    $element_arr = array("name"=>$lang["top_100"], "link"=>$config["server"]."/".seo('top_users', 0), "level"=>1, "is_folder"=>0, "is_active"=>1);
    array_push($map_links, $element_arr);
	
    // Advanced Search
    $element_arr = array("name"=>$lang["section"]["a_search"], "link"=>$config["server"].$config_index["leftmenu_path"][3], "level"=>1, "is_folder"=>0, "is_active"=>1);
    array_push($map_links, $element_arr);
    // Quick Search  ...
    $element_arr = array("name"=>$lang["section"]["q_search"], "link"=>$config["server"].$config_index["leftmenu_path"][2], "level"=>1, "is_folder"=>1, "is_active"=>1);
    array_push($map_links, $element_arr);
    //////  Quick search : Search...
    $element_arr = array("name"=>$lang["search"]["search_1_name"], "link"=>seo("quick_search", 1), "level"=>2, "is_folder"=>1, "is_active"=>1);
    array_push($map_links, $element_arr);
    //////////  Quick search : Search by country
    $element_arr = array("name"=>$lang["search"]["country"]." ".$lang["search"]["search_1_name"], "link"=>seo("quick_search", 1), "level"=>3, "is_folder"=>0, "is_active"=>0);
    array_push($map_links, $element_arr);
    //////////  Quick search : Search by zip
    $element_arr = array("name"=>$lang["search"]["zipcode"]." ".$lang["search"]["search_1_name"], "link"=>seo("quick_search", 1), "level"=>3, "is_folder"=>0, "is_active"=>0);
    array_push($map_links, $element_arr);
    //////  Quick search : By LOgin
    $element_arr = array("name"=>$lang["search"]["search_2_name"], "link"=>seo("quick_search", 1), "level"=>2, "is_folder"=>0, "is_active"=>1);
    array_push($map_links, $element_arr);
    //////  Quick search : Direct search
    $element_arr = array("name"=>$lang["search"]["search_3_name"], "link"=>seo("quick_search", 1), "level"=>2, "is_folder"=>0, "is_active"=>1);
    array_push($map_links, $element_arr);
    
    // Photo Gallery ...
    $element_arr = array("name"=>$lang["gallery"]["photo"], "link"=>$config["server"].$config_index["leftmenu_path"][16], "level"=>1, "is_folder"=>1, "is_active"=>1);
    array_push($map_links, $element_arr);
	
    $element_arr = array("name"=>$lang["latest_uploads"], "link"=>seo('photo_gallery_latest', 1), "level"=>2, "is_folder"=>0, "is_active"=>1);
    array_push($map_links, $element_arr);
	
	// Video gallery
    $element_arr = array("name"=>$lang["gallery"]["video"], "link"=>seo('video_gallery', 1), "level"=>1, "is_folder"=>1, "is_active"=>1);
    array_push($map_links, $element_arr);

	$element_arr = array("name"=>$lang["latest_uploads"], "link"=>seo('video_gallery_latest', 1), "level"=>2, "is_folder"=>0, "is_active"=>1);
    array_push($map_links, $element_arr);

 
    if (isset($config["use_pilot_module_classified"]) && ($config["use_pilot_module_classified"] == 1)) {
	// Classified
	$element_arr = array("name"=>$lang["modules"]["classified"]["name"], "link"=>$config["server"]."/classified.php", "level"=>1, "is_folder"=>1, "is_active"=>1);
	array_push($map_links, $element_arr);
	//My blog
	$element_arr = array("name"=>$lang["classified"]["post_ad"], "link"=>$config["server"]."/classified.php?sel=add", "level"=>2, "is_folder"=>0, "is_active"=>1);
	array_push($map_links, $element_arr);
	//Calendar
	$element_arr = array("name"=>$lang["classified"]["all_ads"], "link"=>$config["server"]."/classified.php", "level"=>2, "is_folder"=>0, "is_active"=>1);
	array_push($map_links, $element_arr);
	//Friends
	$element_arr = array("name"=>$lang["classified"]["my_ads"], "link"=>$config["server"]."/classified.php?sel=my_ads", "level"=>2, "is_folder"=>0, "is_active"=>1);
	array_push($map_links, $element_arr);
    }
    
    // News
    $element_arr = array("name"=>$lang["bottom"]["news"], "link"=>$config["server"].$config_index["bottom_menu"]["news"], "level"=>1, "is_folder"=>0, "is_active"=>1);
    array_push($map_links, $element_arr);
    
    // Take A Tour
    $element_arr = array("name"=>$lang["bottom"]["take_tour"], "link"=>$config["server"].$config_index["bottom_menu"]["take_tour"], "level"=>1, "is_folder"=>0, "is_active"=>1);
    array_push($map_links, $element_arr);
    
    // Dating Advice
    $element_arr = array("name"=>$lang["bottom"]["advice"], "link"=>$config["server"].$config_index["bottom_menu"]["advice"], "level"=>1, "is_folder"=>0, "is_active"=>1);
    array_push($map_links, $element_arr);
    
    // Contact Us
    $element_arr = array("name"=>$lang["bottom"]["contact"], "link"=>$config["server"].$config_index["bottom_menu"]["contact"], "level"=>1, "is_folder"=>0, "is_active"=>1);
    array_push($map_links, $element_arr);
    
    // Help
    $element_arr = array("name"=>$lang["bottom"]["help"], "link"=>$config["server"].$config_index["bottom_menu"]["help"], "level"=>1, "is_folder"=>0, "is_active"=>1);
    array_push($map_links, $element_arr);
    
    // Info pages
    foreach ($config_index["bottom_menu"]["info"] as $k => $path) {
            $element_arr = array("name"=>$lang["bottom"]["info"][$k], "link"=>$config["server"].'/'.$path, "level"=>1, "is_folder"=>0, "is_active"=>1);
            array_push($map_links, $element_arr);
    }
    
    // Success Stories
    if ($settings["use_success_stories"]) {
            $element_arr = array("name"=>$lang["bottom"]["stories"], "link"=>$config["server"].$config_index["bottom_menu"]["stories"], "level"=>1, "is_folder"=>0, "is_active"=>1);
            array_push($map_links, $element_arr);
    }
    
    // Site Map
    $element_arr = array("name"=>$lang["bottom"]["map"], "link"=>$config["server"].$config_index["bottom_menu"]["map"], "level"=>1, "is_folder"=>0, "is_active"=>1);
    array_push($map_links, $element_arr);    
    
    AffiliateSiteMap($map_links, $element_arr);
	
	//locations
	$map_links = Loader::Call("locationsForMap", $map_links);
	
	//usertypes
	$map_links = Loader::Call("usertypesForMap", $map_links);
}
else{
	// registered user
	
    // index
    $element_arr = array("name"=>$lang["top"]["index"], "link"=>$config["server"].$config_index["top_menu"]["index"], "level"=>1, "is_folder"=>1, "is_active"=>1);
    array_push($map_links, $element_arr);
    
    ////// tell a friend
    $element_arr = array("name"=>$lang["tell_a_friend"]["top_header"], "link"=>$config["server"]."/".seo('tell_a_friend', 0), "level"=>2, "is_folder"=>0, "is_active"=>1);
    array_push($map_links, $element_arr);
	////// Members who have ...
	$element_arr = array("name"=>$lang["homepage"]["hotlist_header_1"], "link"=>"", "level"=>2, "is_folder"=>1, "is_active"=>0);
	array_push($map_links, $element_arr);
	////////// Visited My Page
	$element_arr = array("name"=>$lang["homepage"]["hotlist_text_1_1"], "link"=>$config["server"].$config_index["leftmenu_path"][8], "level"=>3, "is_folder"=>0, "is_active"=>1);
	array_push($map_links, $element_arr);
	////////// Want to meet me
	$element_arr = array("name"=>$lang["homepage"]["hotlist_text_1_2"], "link"=>$config["server"].$config_index["leftmenu_path"][10], "level"=>3, "is_folder"=>0, "is_active"=>1);
	array_push($map_links, $element_arr);
	////////// Send me a kiss
	$element_arr = array("name"=>$lang["homepage"]["hotlist_text_1_3"], "link"=>$config["server"].$config_index["leftmenu_path"][14], "level"=>3, "is_folder"=>0, "is_active"=>1);
	array_push($map_links, $element_arr);
	////////// Emailed me
	$element_arr = array("name"=>$lang["homepage"]["hotlist_text_1_4"], "link"=>$config["server"]."/mailbox.php?sel=inbox", "level"=>3, "is_folder"=>0, "is_active"=>1);
	array_push($map_links, $element_arr);
	////// Members you have ...
	$element_arr = array("name"=>$lang["homepage"]["hotlist_header_1"], "link"=>"", "level"=>2, "is_folder"=>1, "is_active"=>0);
	array_push($map_links, $element_arr);
	if ($config["social"] != '1') {
		////////// Perfect Match
		$element_arr = array("name"=>$lang["homepage"]["hotlist_text_2_1"], "link"=>$config["server"].$config_index["leftmenu_path"][7], "level"=>3, "is_folder"=>0, "is_active"=>1);
		array_push($map_links, $element_arr);
	}
	////////// Want to meet them
	$element_arr = array("name"=>$lang["homepage"]["hotlist_text_2_2"], "link"=>$config["server"].$config_index["leftmenu_path"][9], "level"=>3, "is_folder"=>0, "is_active"=>1);
	array_push($map_links, $element_arr);
	////////// Send them a kiss
	$element_arr = array("name"=>$lang["homepage"]["hotlist_text_2_3"], "link"=>$config["server"].$config_index["leftmenu_path"][15], "level"=>3, "is_folder"=>0, "is_active"=>1);
	array_push($map_links, $element_arr);
	////////// Emailed
	$element_arr = array("name"=>$lang["homepage"]["hotlist_text_2_4"], "link"=>$config["server"]."/mailbox.php?sel=outbox", "level"=>3, "is_folder"=>0, "is_active"=>1);
	array_push($map_links, $element_arr);
	////// horoscope
	if ($settings["use_horoscope_feature"]) {
		$element_arr = array("name"=>$lang["section"]["horoscope"], "link"=>$config["server"]."/".seo('horoscope',0), "level"=>2, "is_folder"=>0, "is_active"=>1);
		array_push($map_links, $element_arr);
	}
	// Profile  ...
	$element_arr = array("name"=>$lang["section"]["profile"], "link"=>$config["server"].$config_index["leftmenu_path"][0], "level"=>1, "is_folder"=>1, "is_active"=>1);
	array_push($map_links, $element_arr);

	$map_links = Loader::Call('profileFieldsForMap', $map_links);

	// Account  ...
	$element_arr = array("name"=>$lang["section"]["account"], "link"=>$config["server"].$config_index["leftmenu_path"][1], "level"=>1, "is_folder"=>1, "is_active"=>1);
	array_push($map_links, $element_arr);
	//////  My registration Information...
	$element_arr = array("name"=>$lang["account"]["subheader_info"], "link"=>"", "level"=>2, "is_folder"=>1, "is_active"=>0);
	array_push($map_links, $element_arr);
	//////////  Change Password
	$element_arr = array("name"=>$lang["account"]["subheader_changepass"], "link"=>$config["server"]."/account.php?sel=passw", "level"=>3, "is_folder"=>0, "is_active"=>1);
	array_push($map_links, $element_arr);
	//////  Status Of My Account...
	$element_arr = array("name"=>$lang["account"]["subheader_account"], "link"=>"", "level"=>2, "is_folder"=>0, "is_active"=>0);
	array_push($map_links, $element_arr);

	//////  Modify Group
	$element_arr = array("name"=>$lang["account"]["group_modify"], "link"=>$config["server"]."/payment.php", "level"=>3, "is_folder"=>0, "is_active"=>1);
	array_push($map_links, $element_arr);
	//////  My Alerts
	$element_arr = array("name"=>$lang["account"]["subheader_myalerts"], "link"=>"", "level"=>2, "is_folder"=>0, "is_active"=>0);
	array_push($map_links, $element_arr);
		
	if (isset($config["use_pilot_module_blog"]) && ($config["use_pilot_module_blog"] == 1)) {
		// My blog_calendar
		$element_arr = array("name"=>$lang["blog"]["blog_menu_1"], "link"=>$config["server"]."/".seo('blog', 0), "level"=>1, "is_folder"=>1, "is_active"=>1);
		array_push($map_links, $element_arr);
		//My blog
		if ($settings["use_global_seo"] && $settings["use_seo_multilang"] && $settings["use_tags"]){ //seo ������� � ���� ��������
			$element_arr = array("name"=>$lang["blog"]["blog_menu_1"], "link"=>$config["server"]."/".seo('blog_my', 0), "level"=>2, "is_folder"=>0, "is_active"=>1);
			array_push($map_links, $element_arr);
		}
		//Calendar
		$element_arr = array("name"=>$lang["blog"]["blog_menu_2"], "link"=>$config["server"]."/blog_calendar.php", "level"=>2, "is_folder"=>0, "is_active"=>1);
		array_push($map_links, $element_arr);
		//Friends
		$element_arr = array("name"=>$lang["blog"]["blog_menu_4"], "link"=>$config["server"]."/".seo('blog_friends', 0), "level"=>2, "is_folder"=>0, "is_active"=>1);
		array_push($map_links, $element_arr);
	}	
	
    // Chat
    if ($config["use_pilot_module_flashchat"] == 1) {
            $element_arr = array("name"=>$lang["section"]["chat"], "link"=>$config["server"].$config_index["leftmenu_path"][4], "level"=>1, "is_folder"=>0, "is_active"=>1, "is_new_window"=>1);
    } elseif ($config["use_pilot_module_webchat"] == 1) {
            $element_arr = array("name"=>$lang["section"]["chat"], "link"=>$config["server"].$config_index["leftmenu_path"][24], "level"=>1, "is_folder"=>0, "is_active"=>1, "is_new_window"=>1);
    }
    array_push($map_links, $element_arr);

    // IM
    $element_arr = array("name"=>$lang["section"]["im"], "link"=>$config["server"].$config_index["leftmenu_path"][20], "level"=>1, "is_folder"=>0, "is_active"=>1, "is_new_window"=>1, "on_click" => "javascript: open_im_window(); return false;");
    array_push($map_links, $element_arr);

    // forum module
    if (isset($config["use_pilot_module_forum"]) && $config["use_pilot_module_forum"] == 1) {
            $element_arr = array("name"=>$lang["section"]["forum"], "link"=>$config["server"].$config_index["leftmenu_path"][21], "level"=>1, "is_folder"=>0, "is_active"=>1);
            array_push($map_links, $element_arr);
    }
    // events module
    if (isset($config["use_pilot_module_events"]) && $config["use_pilot_module_events"] == 1) {
		if ($settings["use_global_seo"] && $settings["use_seo_multilang"] && $settings["use_tags"]){ //seo ������� � ���� ��������
            $element_arr = array("name"=>$lang["section"]["events"], "link"=>$config["server"].$config_index["leftmenu_path"][23], "level"=>1, "is_folder"=>0, "is_active"=>1);
            array_push($map_links, $element_arr);
		}
    }
    
    // club module
    if (isset($config["use_pilot_module_club"]) && $config["use_pilot_module_club"] == 1) {
		if ($settings["use_global_seo"] && $settings["use_seo_multilang"] && $settings["use_tags"]){ //seo ������� � ���� ��������
            $element_arr = array("name"=>$lang["section"]["club"], "link"=>$config["server"].$config_index["leftmenu_path"][27], "level"=>1, "is_folder"=>0, "is_active"=>1);
            array_push($map_links, $element_arr);
		}
    }

	// New faces
    $element_arr = array("name"=>$lang["new_faces"], "link"=>$config["server"]."/".seo('new_faces', 0), "level"=>1, "is_folder"=>0, "is_active"=>1);
    array_push($map_links, $element_arr);

	//top_users
    $element_arr = array("name"=>$lang["top_100"], "link"=>$config["server"]."/".seo('top_users', 0), "level"=>1, "is_folder"=>0, "is_active"=>1);
    array_push($map_links, $element_arr);
	
    // Advanced Search
    $element_arr = array("name"=>$lang["section"]["a_search"], "link"=>$config["server"].$config_index["leftmenu_path"][3], "level"=>1, "is_folder"=>0, "is_active"=>1);
    array_push($map_links, $element_arr);
    // Quick Search  ...
    $element_arr = array("name"=>$lang["section"]["q_search"], "link"=>$config["server"].$config_index["leftmenu_path"][2], "level"=>1, "is_folder"=>1, "is_active"=>1);
    array_push($map_links, $element_arr);
    //////  Quick search : Search...
    $element_arr = array("name"=>$lang["search"]["search_1_name"], "link"=>$config["server"]."/".seo("quick_search", 0), "level"=>2, "is_folder"=>0, "is_active"=>1);
    array_push($map_links, $element_arr);
    //////////  Quick search : Search by country
    /*$element_arr = array("name"=>$lang["search"]["country"]." ".$lang["search"]["search_1_name"], "link"=>$config["server"]."/".seo("quick_search", 0), "level"=>3, "is_folder"=>0, "is_active"=>0);
    array_push($map_links, $element_arr);
    //////////  Quick search : Search by zip
    $element_arr = array("name"=>$lang["search"]["zipcode"]." ".$lang["search"]["search_1_name"], "link"=>$config["server"]."/".seo("quick_search", 0), "level"=>3, "is_folder"=>0, "is_active"=>0);
    array_push($map_links, $element_arr);*/
    //////  Quick search : By LOgin
    $element_arr = array("name"=>$lang["search"]["search_2_name"], "link"=>$config["server"]."/".seo("quick_search", 0), "level"=>2, "is_folder"=>0, "is_active"=>1);
    array_push($map_links, $element_arr);
	//////  Quick search : By Tags
	if ($settings["use_global_seo"] && $settings["use_seo_multilang"] && $settings["use_tags"]){ //seo ������� � ���� ��������
		$element_arr = array("name"=>$lang["search"]["search_5_name"], "link"=>$config["server"]."/".seo("quick_search", 0), "level"=>2, "is_folder"=>0, "is_active"=>1);
		array_push($map_links, $element_arr);
	}
	// Mailbox  ...
	$element_arr = array("name"=>$lang["section"]["email"], "link"=>$config["server"].$config_index["leftmenu_path"][5], "level"=>1, "is_folder"=>1, "is_active"=>1);
	array_push($map_links, $element_arr);
	////// Inbox
	$element_arr = array("name"=>$lang["mailbox"]["inbox"], "link"=>$config["server"]."/mailbox.php?sel=inbox", "level"=>2, "is_folder"=>0, "is_active"=>1);
	array_push($map_links, $element_arr);
	////// Outbox
	$element_arr = array("name"=>$lang["mailbox"]["outbox"], "link"=>$config["server"]."/mailbox.php?sel=outbox", "level"=>2, "is_folder"=>0, "is_active"=>1);
	array_push($map_links, $element_arr);
	////// Compose
	$element_arr = array("name"=>$lang["mailbox"]["compose"], "link"=>$config["server"]."/mailbox.php?sel=write", "level"=>2, "is_folder"=>0, "is_active"=>1);
	array_push($map_links, $element_arr);
	
    // Photo Gallery ...
    $element_arr = array("name"=>$lang["gallery"]["photo"], "link"=>$config["server"].$config_index["leftmenu_path"][16], "level"=>1, "is_folder"=>1, "is_active"=>1);
    array_push($map_links, $element_arr);
	
	$element_arr = array("name"=>$lang["latest_uploads"], "link"=>$config["server"]."/".seo('photo_gallery_latest', 0), "level"=>2, "is_folder"=>0, "is_active"=>1);
    array_push($map_links, $element_arr);

	// Video gallery
    $element_arr = array("name"=>$lang["gallery"]["video"], "link"=>$config["server"]."/".seo('video_gallery', 0), "level"=>1, "is_folder"=>1, "is_active"=>1);
    array_push($map_links, $element_arr);

	$element_arr = array("name"=>$lang["latest_uploads"], "link"=>$config["server"]."/".seo('video_gallery_latest', 0), "level"=>2, "is_folder"=>0, "is_active"=>1);
    array_push($map_links, $element_arr);
 
    if (isset($config["use_pilot_module_classified"]) && ($config["use_pilot_module_classified"] == 1)) {
		// Classified
		$element_arr = array("name"=>$lang["modules"]["classified"]["name"], "link"=>$config["server"]."/classified.php", "level"=>1, "is_folder"=>1, "is_active"=>1);
		array_push($map_links, $element_arr);
		//My blog
		$element_arr = array("name"=>$lang["classified"]["post_ad"], "link"=>$config["server"]."/classified.php?sel=add", "level"=>2, "is_folder"=>0, "is_active"=>1);
		array_push($map_links, $element_arr);
		//Calendar
		$element_arr = array("name"=>$lang["classified"]["all_ads"], "link"=>$config["server"]."/classified.php", "level"=>2, "is_folder"=>0, "is_active"=>1);
		array_push($map_links, $element_arr);
		//Friends
		$element_arr = array("name"=>$lang["classified"]["my_ads"], "link"=>$config["server"]."/classified.php?sel=my_ads", "level"=>2, "is_folder"=>0, "is_active"=>1);
		array_push($map_links, $element_arr);
    }
    
    // News
    $element_arr = array("name"=>$lang["bottom"]["news"], "link"=>$config["server"].$config_index["bottom_menu"]["news"], "level"=>1, "is_folder"=>0, "is_active"=>1);
    array_push($map_links, $element_arr);
    
    // Take A Tour
    $element_arr = array("name"=>$lang["bottom"]["take_tour"], "link"=>$config["server"].$config_index["bottom_menu"]["take_tour"], "level"=>1, "is_folder"=>0, "is_active"=>1);
    array_push($map_links, $element_arr);
    
    // Dating Advice
    $element_arr = array("name"=>$lang["bottom"]["advice"], "link"=>$config["server"].$config_index["bottom_menu"]["advice"], "level"=>1, "is_folder"=>0, "is_active"=>1);
    array_push($map_links, $element_arr);
    
    // Contact Us
    $element_arr = array("name"=>$lang["bottom"]["contact"], "link"=>$config["server"].$config_index["bottom_menu"]["contact"], "level"=>1, "is_folder"=>0, "is_active"=>1);
    array_push($map_links, $element_arr);
    
    // Help
    $element_arr = array("name"=>$lang["bottom"]["help"], "link"=>$config["server"].$config_index["bottom_menu"]["help"], "level"=>1, "is_folder"=>0, "is_active"=>1);
    array_push($map_links, $element_arr);
    
    // Info pages
    foreach ($config_index["bottom_menu"]["info"] as $k => $path) {
            $element_arr = array("name"=>$lang["bottom"]["info"][$k], "link"=>$config["server"].'/'.$path, "level"=>1, "is_folder"=>0, "is_active"=>1);
            array_push($map_links, $element_arr);
    }
    
    // Success Stories
    if ($settings["use_success_stories"]) {
            $element_arr = array("name"=>$lang["bottom"]["stories"], "link"=>$config["server"].$config_index["bottom_menu"]["stories"], "level"=>1, "is_folder"=>0, "is_active"=>1);
            array_push($map_links, $element_arr);
    }

	if (isset($config["use_pilot_module_organizer"]) && ($config["use_pilot_module_organizer"] == 1)) {
		// Personal organizer
		$element_arr = array("name"=>$lang["organizer"]["page_title"], "link"=>$config["server"]."/organizer.php", "level"=>1, "is_folder"=>1, "is_active"=>1);
		array_push($map_links, $element_arr);
		//My bookmarks
		$element_arr = array("name"=>$lang["organizer"]["my_bookmarks"], "link"=>$config["server"]."/organizer.php?sel=bookmarks", "level"=>2, "is_folder"=>0, "is_active"=>1);
		array_push($map_links, $element_arr);
		if (isset($config["use_pilot_module_events"]) && $config["use_pilot_module_events"] == 1) {
			//My Events Statistics
			$element_arr = array("name"=>$lang["organizer"]["my_events_stats"], "link"=>$config["server"]."/events_calendar.php?from=organizer", "level"=>2, "is_folder"=>0, "is_active"=>1);
			array_push($map_links, $element_arr);
		}
		//Billing History
		$element_arr = array("name"=>$lang["organizer"]["billing_history"], "link"=>$config["server"]."/organizer.php?sel=billing", "level"=>2, "is_folder"=>0, "is_active"=>1);
		array_push($map_links, $element_arr);
		//Homepage management
		$element_arr = array("name"=>$lang["organizer"]["homepage_management"], "link"=>$config["server"]."/organizer.php?sel=homepage_management", "level"=>2, "is_folder"=>0, "is_active"=>1);
		array_push($map_links, $element_arr);
	}

    // Site Map
    $element_arr = array("name"=>$lang["bottom"]["map"], "link"=>$config["server"].$config_index["bottom_menu"]["map"], "level"=>1, "is_folder"=>0, "is_active"=>1);
    array_push($map_links, $element_arr);    
    
    AffiliateSiteMap($map_links, $element_arr);
	
	//locations
	$map_links = Loader::Call("locationsForMap", $map_links);
	
	//usertypes
	$map_links = Loader::Call("usertypesForMap", $map_links);	
	
	// LogOff
	$element_arr = array("name"=>$lang["logoff"], "link"=>$config["server"].$config_index["top_menu"]["logoff"], "level"=>1, "is_folder"=>0, "is_active"=>1);
	array_push($map_links, $element_arr);	
	
}

$total = count($map_links);
$subTotal = ceil($total/3);

if (isset($include)) {
	$use_hp_links = $settings['use_seo_urls'];
	$strSQL = "SELECT login FROM " . USERS_TABLE . " WHERE status='1' AND confirm='1' AND visible='1' AND root_user='0' AND guest_user='0'";
	$p_array = $dbconn->GetCol($strSQL);
	foreach ($p_array as $user) {
		$map_links[] = array("name" => "user profile link", "link" => $config["seo_site_root"] . "/user/" . $user, "level" => 1, "is_folder" => 0, "is_active" => 1);
	}
	$strSQL = "SELECT DISTINCT(tag) FROM " . TAGS_TABLE . " WHERE allow_index='1' ";
	$p_array = $dbconn->GetCol($strSQL);
	foreach ($p_array as $tag) {
		$map_links[] = array("name" => "tag link", "link" => $config["seo_site_root"] . "/tag/" . $tag, "level" => 1, "is_folder" => 0, "is_active" => 1);
	}
}
$smarty->assign("map_links", $map_links);
$smarty->assign("subtotal", $subTotal);

if (!isset($include)) {
	$smarty->display(TrimSlash($config["index_theme_path"])."/map.tpl");
}


?>