| Copyright (c) 2005-2006 visiblesoul.net | http://www.visiblesoul.net | Some functions based on module code by Meo aka Luponero | http://www.mkportal.it | Email: luponero@mclink.it +-------------------------------------------------------------------------- */ if (!defined("IN_MKP")) { die ("Sorry !! You cannot access this file directly."); } $idx = new mk_sitemap; class mk_sitemap { var $config = array(); function mk_sitemap() { global $mkportals, $mklib; $mklib->load_lang("lang_sitemap.php"); // To prohibit guest access to module uncomment this code /* if(!$mkportals->member['id']) { $message = "{$mklib->lang['sm_unauth']}"; $mklib->error_page($message); exit; } */ switch($mkportals->input['op']) { case 'credits': $this->credits(); break; default: $this->sitemap(); break; } } function sitemap() { global $mklib, $Skin, $MK_BOARD, $MK_PATH, $blocks; /*********************************************** * Sitemap Configuration **********************************************/ //$list_home = "1"; // List portal home link. No=0, Yes=1 $list_modules = "2"; // List portal modules. //No=0, Yes=1, List with categories=2, List with perms=3, List with categories & perms=4 $list_pages = "1"; // List portal internal pages. No=0, Yes=1, List with perms=2 $list_forums = "1"; // List Forums. No=0, List top level forums only=1, List sub-forums=2 $list_search = "1"; // List Search pages. No=0, Yes=1 /*********************************************/ switch($MK_BOARD) { case 'IPB': $board_functions = "ipb_sitemap_functions.php"; break; case 'PHPBB': $board_functions = "php_sitemap_functions.php"; break; case 'VB': $board_functions = "vb_sitemap_functions.php"; break; case 'IPB13': $board_functions = "ipb13_sitemap_functions.php"; break; case 'MYBB': $board_functions = "mybb_sitemap_functions.php"; break; default: //SMF $board_functions = "smf_sitemap_functions.php"; break; } require $MK_PATH."mkportal/modules/sitemap/board/$board_functions"; $output = " "; $output .= "
images}/locbar.gif\" alt=\"\" />
{$mklib->lang['sm_mkpsitemap']}
"; $output .= "
{$mklib->lang['sm_announce']}
"; $output .= "
"; //if ($list_home == "1") { $output .= "

{$mklib->lang['portal_home']}

"; $output .= "\n"; //} if ($list_modules != "0") { $output .= $this->get_modules(); } $output .= "
"; $output .= "
"; if ($list_pages != "0") { $output .= $this->get_pages(); } if ($list_forums != "0") { $output .= $mksite_board->get_forums(); } if ($list_search != "0") { $output .= $this->get_search(); } $output .= "
"; // !!!! PLEASE BE COOL. DO NOT REMOVE LINK TO CREDITS. LOOK HOW SMALL I MADE IT !!!! $output .= "
{$mklib->lang['sm_footnote']}
{$mklib->lang['sm_credits']}
"; $blocks .= $Skin->view_block("{$mklib->lang['sm_pagetitle']}", $output); $mklib->printpage("1", "1", "{$mklib->lang['sm_pagetitle']}", $blocks); } //Modules function get_modules() { global $mklib; $dselect = $this->row_downloads(); $gselect = $this->row_gallery(); $nselect = $this->row_news(); $rselect = $this->row_reviews(); $content = "

Modules

"; $content .= "\n"; $output = $content; return $output; } // Internal Pages function get_pages() { global $mkportals, $DB, $mklib; $content = "

{$mklib->lang['internalpages']}

"; $content .= ""; $output = $content; return $output; } // Search function get_search() { global $mklib, $mklib_board; $forumsearch = $mklib_board->forum_link("forumsearch"); $content = "

{$mklib->lang['m_search']}

"; $content .= ""; $output = $content; return $output; } // Modified function from MKPortal M1.1 Pr1 /admin/ad_download.php (function row_select_event) function row_downloads() { global $mkportals, $DB, $mklib; $dselect = ''; $chache_sections = array(); //load cache $DB->query( "SELECT * FROM mkp_download_sections ORDER BY `id`"); while( $row = $DB->fetch_row() ) { $chache_sections[] = $row; } $listall = array(); $children = array(); foreach ($chache_sections as $row) { if ($row['father']) { $children[ $row['father'] ][] = $row; } } foreach ($chache_sections as $row) { $idevento = $row['id']; $evento = $row['evento']; $father = $row['father']; if (!in_array($idevento, $listall) && !$row['father']) { $dselect.= "
  • siteurl/index.php?ind=downloads&op=section_view&idev=$idevento\">$evento
  • \n"; $listall[] = $idevento; } //$pref = "|"; if (count($children[$idevento]) > 0) { $dselect.= ""; } } return $dselect; } // Modified function from MKPortal M1.1 Pr1 /admin/ad_download.php (function row_select_event) function row_gallery() { global $mkportals, $DB, $mklib; $gselect = ''; $chache_sections = array(); //load cache $DB->query( "SELECT * FROM mkp_gallery_events ORDER BY `id`"); while( $row = $DB->fetch_row() ) { $chache_sections[] = $row; } $listall = array(); $children = array(); foreach ($chache_sections as $row) { if ($row['father']) { $children[ $row['father'] ][] = $row; } } foreach ($chache_sections as $row) { $idevento = $row['id']; $evento = $row['evento']; $father = $row['father']; if (!in_array($idevento, $listall) && !$row['father']) { $gselect .= "
  • siteurl/index.php?ind=gallery&op=section_view&idev=$idevento\">$evento
  • \n"; $listall[] = $idevento; } //$pref = "|"; if (count($children[$idevento]) > 0) { $gselect .= ""; } } return $gselect; } function row_news() { global $mkportals, $DB, $mklib; $nselect = ''; $query = $DB->query( "SELECT id, titolo FROM mkp_news ORDER BY `id` DESC"); while( $row = $DB->fetch_row($query) ) { $idevento = $row['id']; $evento = $row['titolo']; $nselect.= "
  • siteurl/index.php?ind=news&op=news_show_category&idc=$idevento\">$evento
  • \n"; } return $nselect; } function row_reviews() { global $mkportals, $DB, $mklib; $rselect = ''; $query = $DB->query( "SELECT id, title FROM mkp_reviews ORDER BY `id` DESC"); while( $row = $DB->fetch_row($query) ) { $idevento = $row['id']; $evento = $row['title']; $rselect.= "
  • siteurl/index.php?ind=reviews&op=section_view&idev=$idevento\">$evento
  • \n"; } return $rselect; } // Credits function credits() { global $mkportals, $mklib, $Skin, $blocks; $output = "
    images}/locbar.gif\" alt=\"\" />
    {$mklib->lang['sm_mkpsitemap']} > {$mklib->lang['sm_credits']}

    MKPSiteMap"; //Some credits displayed to Admin only if ($mkportals->member['g_access_cp']) { $output .= " 1.0"; } $output .= "

    "; $blocks .= $Skin->view_block("{$mklib->lang['sm_pagetitle']} {$mklib->lang[sm_credits]}", $output); $mklib->printpage("1", "1", "{$mklib->lang['sm_pagetitle']} {$mklib->lang[sm_credits]}", $blocks); } } ?>