\n"; $sitemap .= " " . $pagelink . "\n"; $sitemap .= " " . $date . "\n"; $sitemap .= " Monthly\n"; $sitemap .= " 1.0\n"; $sitemap .= "\n"; } echo $sitemap; } function map_collections() { global $TABLE_PREFIX; global $config; { $query = "select p . id, c . path as 'collection', max(UNIX_TIMESTAMP(date_modified)) as 'date' " . " from " . $TABLE_PREFIX . "pictures p " . " join " . $TABLE_PREFIX . "collections c on p . parent_collection = c . id " . " group by c . path " . " order by id desc "; } $result = mysql_query ($query); while ($row = mysql_fetch_assoc ($result)) { $date = date("Y-m-d\TH:i:s\Z", $row["date"]); $pagelink = $config['baseurl'] . $row["collection"]; $sitemap .= "\n"; $sitemap .= " " . $pagelink . "\n"; $sitemap .= " " . $date . "\n"; $sitemap .= " Monthly\n"; $sitemap .= " 0.6\n"; $sitemap .= "\n"; } echo $sitemap; } function map_albums() { global $TABLE_PREFIX; global $config; { $query = "select p . id, c . path as 'collection', a . path as 'album', max(UNIX_TIMESTAMP(date_modified)) as 'date' " . " from " . $TABLE_PREFIX . "pictures p " . " join " . $TABLE_PREFIX . "collections c on p . parent_collection = c . id " . " join " . $TABLE_PREFIX . "albums a on p . parent_album = a . id " . " group by c . path , a . path " . " order by id desc "; } $result = mysql_query ($query); while ($row = mysql_fetch_assoc ($result)) { $date = date("Y-m-d\TH:i:s\Z", $row["date"]); $pagelink = $config['baseurl'] . $row["collection"] . "/" . $row["album"]; $sitemap .= "\n"; $sitemap .= " " . $pagelink . "\n"; $sitemap .= " " . $date . "\n"; $sitemap .= " Monthly\n"; $sitemap .= " 0.6\n"; $sitemap .= "\n"; } echo $sitemap; } function map_pictures() { global $TABLE_PREFIX; global $config; { $query = "select id , path , UNIX_TIMESTAMP(date_modified) as 'date' " . " from " . $TABLE_PREFIX . "pictures " . " order by id desc "; } $result = mysql_query ($query); while ($row = mysql_fetch_assoc ($result)) { $date = date("Y-m-d\TH:i:s\Z", $row["date"]); $pagelink = $config["baseurl"] . $row["path"]; $sitemap .= "\n"; $sitemap .= " " . $pagelink . "\n"; $sitemap .= " " . $date . "\n"; $sitemap .= " Monthly\n"; $sitemap .= " 0.6\n"; $sitemap .= "\n"; } echo $sitemap; } echo ''; echo "\n"; echo ''; echo "\n"; map_root(); map_collections(); map_albums(); map_pictures(); echo ''; ?>