• [MOD] Google Sitemap for your gallery 5 0 5 1
Currently:  

Author Topic: [MOD] Google Sitemap for your gallery  (Read 278641 times)

0 Members and 1 Guest are viewing this topic.

Offline Szooguun

  • Newbie
  • *
  • Posts: 47
    • View Profile
Re: [MOD] Google Sitemap for your gallery
« Reply #180 on: May 10, 2013, 04:33:40 PM »
Hello!
Tell me, please, how to do that in this Sitemap have a "category paging"?

Now this mod takes into sitemap.xml only the first page of the category, without &page=2 etc.

For example, I want:

Code: [Select]
<url>
<loc>http://www.mysite/gallery/categories.php?cat_id=123&page=2</loc>
<priority>0.8</priority>
<changefreq>daily</changefreq>
</url>

<url>
<loc>http://www.mysite/gallery/categories.php?cat_id=123&page=3</loc>
<priority>0.8</priority>
<changefreq>daily</changefreq>
</url>

I think it would also be interesting to other users...


Also, I'm curious about how to achieve this effect.

How can I add more to the sitemap Search for keywords:

http://www.mysite/search.php?search_keywords=xxx

Offline alekseyn1

  • Full Member
  • ***
  • Posts: 102
    • View Profile
    • My Project
Re: [MOD] Google Sitemap for your gallery
« Reply #181 on: July 03, 2015, 08:06:30 PM »
A little update for this mod.
Looks like the old schema validation did not work.

here is a good site to validate your sitemap
http://www.xmlcheck.com/

Here is my google.php (with my conversion from win1251 to utf-8)

<?
# 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
#---------------------------------
define('ROOT_PATH''./');
require(
"config.php");
include(
ROOT_PATH.'global.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 'http://www.fotodvor.com/';

# 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;
$prio_profile
	
0.1;

# Frequency
//"always", "hourly", "daily", "weekly", "monthly", "yearly" or "never"
$freq_img
	
	
'daily';
$freq_cat
	
	
'daily';
$freq_profile
	
'monthly';

# Use Short URLs
$shortURL
	
	
1// 0 or 1

# Print XML header
xml_head();

# Print URLs

$categories mysql_query('SELECT cat_id, cat_name FROM ' $table_prefix 'categories');
while (
$category mysql_fetch_array($categories))
{
	
$catid $category['cat_id'];
	
$catname strtr($category['cat_name'], " eeeaeauoiiaaABCDEFGHIJKLMNOPQRSTUVWXYZ","-eeeaeauoiiaaabcdefghijklmnopqrstuvwxyz");
	
$catname fixname(multilang($catname));
	
if (
$shortURL == 1) {
	
	
$cat_url $gallery_url.'cat-'.$catname.'-'.$catid.'.htm';
	
}else {
	
	
$cat_url $gallery_url.'categories.php?cat_id='.$catid;
	
}

	
print_xml($cat_url,$prio_cat,$lastmod,$freq_cat);
}

$images mysql_query('SELECT image_id,image_name,image_active,image_date FROM ' $table_prefix 'images');
while (
$image mysql_fetch_array($images))
{
	
if (
$image['image_active'] == 1) {
	
	
$imgid $image['image_id'];
        
$imgname strtr($image['image_name'], ", eeeaeauoiiaaABCDEFGHIJKLMNOPQRSTUVWXYZ","--eeeaeauoiiaaabcdefghijklmnopqrstuvwxyz");
	
	
$imgname fixname ($imgname);
	
	
$date $image['image_date'];
	
	
$lastmod date("Y-m-d",$date)."T".date("H:i:s",$date)."+00:00";
	
	
if (
$shortURL == 1) {
	
	
	
$img_url $gallery_url.'img-'.$imgname.'-'.$imgid.'.htm';
	
	
}else{
	
	
	
$img_url $gallery_url.'details.php?image_id='.$imgid;
	
	
}
	
	
print_xml($img_url,$prio_img,$lastmod,$freq_img);
	
}
}


$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'];
	

	
if (
$date == 0) {
	
	
$date_ time();
	
	
$date date("Y-m-d",$date_)."T".date("H:i:s",$date_)."+00:00";
	
else
	
{
	
	
$date date("Y-m-d",$date)."T".date("H:i:s",$date)."+00:00";
	

	

	
$profile_url $gallery_url.'member.php?action=showprofile&amp;user_id='.$profileid;
	
print_xml($profile_url,$prio_profile,$date,$freq_profile);
}

# 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 version=\"1.0\" encoding=\"UTF-8\"?>
	
<urlset xmlns=\"http://www.sitemaps.org/schemas/sitemap/0.9\">"
;
}

#-----------------------------------------------
# xml_foot
#-----------------------------------------------
function xml_foot() {
	
echo 
"
</urlset>"
;
}

#-----------------------------------------------
# print_xml
#-----------------------------------------------
function print_xml($url,$priority,$lastmod,$changefreq) {
	
$temp "<url>
	
<loc>
$url</loc>";
	
if (
$lastmod != '') {
	
	
$temp .="  <lastmod>$lastmod</lastmod>";
	
}
	
$temp .= "  <changefreq>$changefreq</changefreq>";
	
$temp .= "  <priority>$priority</priority>
	
</url>"
;
	
echo 
$temp;
}

function 
fixname($text)
{
  return 
strtolower(strtr(
    
$text,
     array(
      
"e" => "e",
      
"e" => "e",
      
"e" => "e",
      
"a" => "a",
      
"e" => "e",
      
"a" => "a",
      
"u" => "a",
      
"o" => "o",
      
"i" => "i",
      
"a" => "a",

      
//russian UTF8 encoded alphabet (lower and upper cases)
      
"&#38;#1040;" => "a",
      
"&#38;#1072;" => "a",
      
"&#38;#1041;" => "b",
      
"&#38;#1073;" => "b",
      
"&#38;#1042;" => "v",
      
"&#38;#1074;" => "v",
      
"&#38;#1043;" => "g",
      
"&#38;#1075;" => "g",
      
"&#38;#1044;" => "d",
      
"&#38;#1076;" => "d",
      
"&#38;#1045;" => "e",
      
"&#38;#1077;" => "e",
      
"&#38;#1025;" => "yo",
      
"&#38;#1105;" => "yo",
      
"&#38;#1046;" => "zh",
      
"&#38;#1078;" => "zh",
      
"&#38;#1047;" => "z",
      
"&#38;#1079;" => "z",
      
"&#38;#1048;" => "i",
      
"&#38;#1080;" => "i",
      
"&#38;#1049;" => "j",
      
"&#38;#1081;" => "j",
      
"&#38;#1050;" => "k",
      
"&#38;#1082;" => "k",
      
"&#38;#1051;" => "l",
      
"&#38;#1083;" => "l",
      
"&#38;#1052;" => "m",
      
"&#38;#1084;" => "m",
      
"&#38;#1053;" => "n",
      
"&#38;#1085;" => "n",
      
"&#38;#1054;" => "o",
      
"&#38;#1086;" => "o",
      
"&#38;#1055;" => "p",
      
"&#38;#1087;" => "p",
      
"&#38;#1056;" => "r",
      
"&#38;#1088;" => "r",
      
"&#38;#1057;" => "s",
      
"&#38;#1089;" => "s",
      
"&#38;#1058;" => "t",
      
"&#38;#1090;" => "t",
      
"&#38;#1059;" => "u",
      
"&#38;#1091;" => "u",
      
"&#38;#1060;" => "f",
      
"&#38;#1092;" => "f",
      
"&#38;#1061;" => "h",
      
"&#38;#1093;" => "h",
      
"&#38;#1062;" => "c",
      
"&#38;#1094;" => "c",
      
"&#38;#1063;" => "ch",
      
"&#38;#1095;" => "ch",
      
"&#38;#1064;" => "sh",
      
"&#38;#1096;" => "sh",
      
"&#38;#1065;" => "sch",
      
"&#38;#1097;" => "sch",
      
"&#38;#1066;" => "",
      
"&#38;#1098;" => "",
      
"&#38;#1067;" => "i",
      
"&#38;#1099;" => "i",
      
"&#38;#1068;" => "'",
      
"&#38;#1100;" => "'",
      
"&#38;#1069;" => "e",
      
"&#38;#1101;" => "e",
      
"&#38;#1070;" => "yu",
      
"&#38;#1102;" => "yu",
      
"&#38;#1071;" => "ya",
      
"&#38;#1103;" => "ya",
	
  
//russian 1251 encoded alphabet (lower and upper cases)
      
"&#1072;" => "a",
      
"&#1040;" => "a",
      
"&#1073;" => "b",
      
"&#1041;" => "b",
      
"&#1074;" => "v",
      
"&#1042;" => "v",
      
"&#1075;" => "g",
      
"&#1043;" => "g",
      
"&#1076;" => "d",
      
"&#1044;" => "d",
      
"&#1077;" => "e",
      
"&#1045;" => "e",
      
"&#1105;" => "yo",
      
"&#1025;" => "yo",
      
"&#1078;" => "zh",
      
"&#1046;" => "zh",
      
"&#1079;" => "z",
      
"&#1047;" => "z",
      
"&#1080;" => "i",
      
"&#1048;" => "i",
      
"&#1081;" => "j",
      
"&#1049;" => "j",
      
"&#1082;" => "k",
      
"&#1050;" => "k",
      
"&#1083;" => "l",
      
"&#1051;" => "l",
      
"&#1084;" => "m",
      
"&#1052;" => "m",
      
"&#1085;" => "n",
      
"&#1053;" => "n",
      
"&#1086;" => "o",
      
"&#1054;" => "o",
      
"&#1087;" => "p",
      
"&#1055;" => "p",
      
"&#1088;" => "r",
      
"&#1056;" => "r",
      
"&#1089;" => "s",
      
"&#1057;" => "s",
      
"&#1090;" => "t",
      
"&#1058;" => "t",
      
"&#1091;" => "u",
      
"&#1059;" => "u",
      
"&#1092;" => "f",
      
"&#1060;" => "f",
      
"&#1093;" => "h",
      
"&#1061;" => "h",
      
"&#1094;" => "c",
      
"&#1062;" => "c",
      
"&#1095;" => "ch",
      
"&#1063;" => "ch",
      
"&#1096;" => "sh",
      
"&#1064;" => "sh",
      
"&#1097;" => "sch",
      
"&#1065;" => "sch",
      
"&#1098;" => "",
      
"&#1066;" => "",
      
"&#1099;" => "i",
      
"&#1067;" => "i",
      
"&#1100;" => "'",
      
"&#1068;" => "'",
      
"&#1101;" => "e",
      
"&#1069;" => "e",
      
"&#1102;" => "yu",
      
"&#1070;" => "yu",
      
"&#1103;" => "ya",
      
"&#1071;" => "ya",
      
"/" => "",
	
  
"&" => "-",
	
  
"&#8470;" => "",
	
  
"," => "-",
	
  
"°" => "",
	
  
"\"" => "",
	
  
"?" => "",
	
  
"&#1110;" => "i"//ukranian i
	
  
"&#1030;" => "i"//ukranian i
	
  
"&#1111;" => "i"//ukranian &#1111;
	
  
"&#1108;" => "e"//ukranian &#1108;
	
  
"«" => "",
	
  
"»" => "",
	
  
"*" => "",
	
  
"?" => "",
	
  
"!" => "",
	
  
")" => "",
	
  
"(" => "",
	
  
"=" => "",
	
  
"." => "",
	
  
"#" => "",
	
  
"%" => "",
	
  
	
  
"–" => ""
  
)));
}
?>