deeemm-cms /includes/build_sitemap.php

Language PHP Lines 133
MD5 Hash f19a714dc7ed618046c22acb34ee8095 Estimated Cost $1,090 (why?)
Repository https://bitbucket.org/mpercy/deeemm-cms View Raw File View Project SPDX
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
<?php

defined( '_INDM' ) or die( 'POSSIBLE HACK ATTEMPT!' );

$main = read_file($default_url . $templates_dir  . "sitemap.tpl");

/*===========================================================================
Propogate the site map
===========================================================================*/

//generate list with links for modifying category
foreach($all_tables as $value){
	$tables_list = '';
	$sql_query = mysql_query("SELECT * FROM `" . $db_table_prefix . "core_structure` WHERE `table` = '$value'");
	while($sql_result = mysql_fetch_array($sql_query)){
		$type = $sql_result[type];
		$media_library_default_view = $sql_result[media_library_default_view];
		$num_slideshow_images = $sql_result[num_slideshow_images];
		$imagebox_type = $sql_result[imagebox_type];
		$display_in_margin = $sql_result[display_in_margin];
		$display_in_sitemap = $sql_result[display_in_sitemap];
		$allow_comments = $sql_result[allow_comments];
		$category = $sql_result[category_lan_ . $language];
	}

	//get highest order page
	$sql_query = mysql_query("SELECT * FROM `" . $db_table_prefix . 'cat_' . "$value` WHERE `id` > 0 ORDER BY `order` LIMIT 1");
	if($sql_result = mysql_fetch_array($sql_query)){
		$id = $sql_result[id];
		$link_url = $sql_result[link_url];
	}

/*===========================================================================
Get main heading
===========================================================================*/

	switch ($type) {

		case 'list';
		case 'normal';
		if (isset($link_url) && $link_url <> '') {
			$tables_list .= str_replace($value, "<HR size='1px' color='#ddd' class='clear_both'><img class='icon' title='$type' src='$default_url".$templates_dir."images/icons/$type.gif'>&nbsp&nbsp<a class='sitemap_item' href='" . $link_url . "'>" . $category . "</A>", $value);
		} else {
			$tables_list .= str_replace($value, "<HR size='1px' color='#ddd' class='clear_both'><img class='icon' title='$type' src='$default_url".$templates_dir."images/icons/$type.gif'>&nbsp&nbsp<a class='sitemap_item' href='$default_url"."index.php?page=" . $value . "'&amp;id=$id>" . $category . "</A>", $value);
		}
		break;

		case 'media';
		$tables_list .= str_replace($value, "<HR size='1px' color='#ddd' class='clear_both'><img class='icon' title='$type' src='$default_url".$templates_dir."images/icons/$type.gif'>&nbsp&nbsp<a class='sitemap_item' href='$default_url"."index.php?page=" . $value . "'>" . $category . "</A>", $value);
		break;
	}

/*===========================================================================
Get sub heading
===========================================================================*/
	$sql_query  = mysql_query("SELECT * FROM `" . $db_table_prefix . 'cat_' . "$value` ORDER BY `order`");
	while ($sql_result = mysql_fetch_array($sql_query)){
		$title = $sql_result[title_lan_ . $language];
		$id = $sql_result[id];
		$link_url = $sql_result[link_url];

		if ($type == 'normal'){
			$tables_list .= str_replace($value, "<ul><img class='icon' title='$type' src='$default_url".$templates_dir."images/icons/page.gif'>&nbsp;&nbsp;<a class='sitemap_item' href='$default_url"."index.php?page=" . $value . "&amp;id=$id'>" . $title . "</A></span></ul>", $value);
		}
	}
	$tables_list = str_replace('  ', '', $tables_list);
	
	if (isset($display_in_sitemap) && $display_in_sitemap <> ''){
		$sitemap_list .= $tables_list;
	}
}


?>
Back to Top