# 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)
# Adapted for [MOD] Google Friendly Urls by Fábio Dantas (fabio@amopiaui.com http://www.famosasx.info)
# Date: 28/11/2006 | 02.01.2007 | 16/06/2008
# You can send ping to Google with this request: http://www.google.com/webmasters/sitemaps/ping?sitemap=URL_TO_YOUR_SITEMAP
#---------------------------------
require('config.php');
define('ROOT_PATH', './');
include(ROOT_PATH.'global.php');
require(ROOT_PATH.'includes/sessions.php');
$link=mysql_connect("$db_host","$db_user","$db_password");
mysql_select_db("$db_name") or die ('Cannot connect database!');
#-----------------------------------------------
# xml_head
#-----------------------------------------------
function xml_head() {
$freq = 'daily';
$priority = '1.0';
$mod = date('Y-m-d').'T'.date('H:i:s').'+00:00';
return '
';
}
#-----------------------------------------------
# xml_foot
#-----------------------------------------------
function xml_foot() {
return '
';
}
#-----------------------------------------------
# print_xml
#-----------------------------------------------
function print_xml($url,$priority,$lastmod,$changefreq) {
$temp = '
'.$url.'';
$temp .= ''.$priority.'';
if ($lastmod != '') {
$temp .=''.$lastmod.'';
}
$temp .= ''.$changefreq.'';
return $temp;
/*
$temp = "
{$url}";
$temp .= " {$priority}";
if ($lastmod != '') {
$temp .=" {$lastmod}";
}
$temp .= " {$changefreq}
";
return $temp;
*/
}
# 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.6;
$prio_cat = 0.8;
$prio_profile = 0.3;
# Frequency
//"always", "hourly", "daily", "weekly", "monthly", "yearly" or "never"
$freq_img = 'weekly';
$freq_cat = 'daily';
$freq_profile = 'weekly';
# Print XML header
$xml = xml_head();
# Print Cats URLs
$categories = mysql_query('SELECT cat_id FROM ' . $table_prefix . 'categories');
while ($category = mysql_fetch_array($categories))
{
$catid = $category['cat_id'];
$cat_url = $site_sess->url(ROOT_PATH.'categories.php?'.URL_CAT_ID.'='.$catid);
$xml .= print_xml($cat_url,$prio_cat,'',$freq_cat);
}
# Print Images URLs
$images = mysql_query('SELECT image_id,image_active,image_date FROM ' . $table_prefix . 'images WHERE image_active = 1');
while ($image = mysql_fetch_array($images))
{
$date = date('Y-m-d',$image['image_date']).'T'.date('H:i:s',$image['image_date']).'+00:00';
$img_url = $site_sess->url(ROOT_PATH.'details.php?'.URL_IMAGE_ID.'='.$image['image_id']);
$xml .= print_xml($img_url,$prio_img,$date,$freq_img);
/*
$imgid = $image['image_id'];
$date = $image['image_date'];
$date = date('Y-m-d',$date).'T'.date('H:i:s',$date).'+00:00';
$img_url = $site_sess->url(ROOT_PATH.'details.php?'.URL_IMAGE_ID.'='.$imgid);
$xml .= print_xml($img_url,$prio_img,$date,$freq_img);
*/
}
# Print Profiles URLs
$profiles = mysql_query('SELECT user_id, user_lastaction FROM ' . $table_prefix . 'users WHERE user_id >= "1"');
while ($profile = mysql_fetch_array($profiles))
{
$profileid = $profile['user_id'];
$date = $profile['user_lastaction'];
$date = date('Y-m-d',$date).'T'.date('H:i:s',$date).'+00:00';
$profile_url = $site_sess->url(ROOT_PATH.'member.php?action=showprofile&'.URL_USER_ID.'='.$profileid);
$xml .= print_xml($profile_url,$prio_profile,$date,$freq_profile);
}
# Print XML footer
$xml .= xml_foot();
echo $xml;