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:
|
//************** Configuration ******************************//
$map_item_limit = '500'; // how much items should be on sitemap (not to much)
//global
$filename="sitemap.php";
require("./global.php");
//query
$sitemapdate = $db->query("SELECT
bb".$n."_threads.topic,
bb".$n."_threads.threadid,
bb".$n."_threads.lastposttime,
bb".$n."_threads.boardid as parentid
FROM bb".$n."_threads
LEFT JOIN bb".$n."_boards ON (bb".$n."_boards.boardid=bb".$n."_threads.boardid)
WHERE bb".$n."_boards.showinarchive=1 AND bb".$n."_threads.closed<3 AND bb".$n."_threads.visible=1
ORDER BY bb".$n."_threads.lastposttime DESC LIMIT $map_item_limit");
//get data
while ($data=$db->fetch_array($sitemapdate))
{
$map_threadid = intval($data['threadid']);
$map_date = date('Y-m-d', $data['lastposttime']);
//Item-Data
$map_item .= '
<url>
<loc>'.$url2board.'/archive/'.$map_threadid.'/thread.html</loc>
<lastmod>'.$map_date.'</lastmod>
</url>';
}
//do output
header("Content-type: text/xml");
echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>
<urlset xmlns=\"http://www.google.com/schemas/sitemap/0.84\">
<url>
<loc>$url2board/archive/index.html</loc>
<changefreq>always</changefreq>
<priority>1.0</priority>
</url>$map_item
</urlset>";
?> |