# Create Google Sitemap for 4images
# Created by Mai Minh (minh@maingo.com http://www.vna2z.com)
# Modified by Oliver van der Werf (info@flash-webdesign.de http://www.flash-webdesign.de)
# Date: 28/11/2006 | 02.01.2007
# You can send ping to Google with this request: http://www.google.com/webmasters/sitemaps/ping?sitemap=URL_TO_YOUR_SITEMAP
#---------------------------------
require("config.php");
$link=mysql_connect("$db_host","$db_user","$db_password");
mysql_select_db("$db_name") or die ("Cannot connect database!");
# 4images top page (with trailing slash)
$gallery_url = 'https://www.tapeteos.pl/';
# Priotity
//select between 0.0 and 1.0
//0.0 identifies the lowest priority page(s) on your website
//1.0 identifies the highest priority page(s) on your website
$prio_img = 0.5;
$prio_cat = 0.8;
# Frequency
//"always", "hourly", "daily", "weekly", "monthly", "yearly" or "never"
$freq_img = 'yearly';
$freq_cat = 'daily';
# Use Short URLs
$shortURL = 1; // 0 or 1
# Print XML header
xml_head();
# Print URLs
$images = mysql_query('SELECT image_id,image_name,image_active,image_date FROM ' . $table_prefix . 'images ORDER by image_id ASC limit 60000,20000');
while ($image = mysql_fetch_array($images))
{
if ($image['image_active'] == 1) {
$imgid = $image['image_id'];
$date = $image['image_date'];
$date = date("Y-m-d",$date)."T".date("H:i:s",$date)."+00:00";
if ($shortURL == 1) {
$img_url = $gallery_url.'details.php?image_id='.$imgid;
}
print_xml($img_url,$prio_img,$date,$freq_img);
}
}
# Print XML footer
xml_foot();
function xml_head() {
$freq = 'daily';
$priority = '1.0';
$mod = date("Y-m-d")."T".date("H:i:s")."+00:00";
echo "
";
}
#-----------------------------------------------
# xml_foot
#-----------------------------------------------
function xml_foot() {
echo "
";
}
#-----------------------------------------------
# print_xml
#-----------------------------------------------
function print_xml($url,$priority,$lastmod,$changefreq) {
$temp = "
$url";
$temp .= " $priority";
if ($lastmod != '') {
$temp .=" $lastmod";
}
$temp .= " $changefreq
";
echo $temp;
}
?>