'; } #----------------------------------------------- # 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;