4images Forum & Community

4images Modifications / Modifikationen => Mods & Plugins (Releases & Support) => Topic started by: thestroller on November 28, 2006, 07:54:24 AM

Title: [MOD] Google Sitemap for your gallery
Post by: thestroller on November 28, 2006, 07:54:24 AM
Hi,

You can create a Google Sitemap for your Gallery to improve traffic to your site.

You must install the Search Engine friendly MOD before use this file.

1. Upload the file google.php to the root folder of 4images.
2. Modify the .htaccess to rewrite the URL of sitemap.

Code: [Select]
RewriteRule ^sitemap.xml$ google.php
Now the URL of sitemap is: http://www.yourdomain.com/sitemap.xml

You can send a ping to Google to notify your new sitemap by this way: http://www.google.com/webmasters/sitemaps/ping?sitemap=URL_TO_YOUR_SITEMAP

Good luck!
Mai
Title: Re: Create Google Sitemap for your gallery
Post by: Naveen on December 02, 2006, 09:00:50 AM
Thanx a million  :lol:

This is an excellent MOD, been looking for it for quite a while now.

Cheers  :mrgreen:
Title: Re: Create Google Sitemap for your gallery
Post by: Naveen on December 02, 2006, 09:53:56 AM
Ok there is an error in the sitemap.

There is no Last Modified Date for categories and google throws that as an error. Maybe we can assign current date there similar to $mod
Title: Re: Create Google Sitemap for your gallery
Post by: Zyga on December 03, 2006, 09:42:44 AM
In php file is
Code: [Select]
echo "<?xml version='1.0' encoding='UTF-8'?>   Should I change it to ISO-8859-2 is whole my gallery works with it ?
Yeah I know i can check it but... I don't want play with google


How can add a links for profiles to a map ?
Title: Re: Create Google Sitemap for your gallery
Post by: Acidgod on January 02, 2007, 05:13:23 PM
I have modify the Code a little bit... (o:

-now the Profiles are included
-now you can use it also without the Short URL Mod
(# Use Short URLs
$shortURL      = 1; // 0 or 1)

-bugfix: Last Modified Date for categories...

Enjoy it...

Code: [Select]
<?
# 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 = 'http://www.picsforfree.de/';

# 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.3;

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

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

# Print XML header
xml_head();

# Print URLs
$categories = mysql_query('SELECT cat_id FROM ' . $table_prefix . 'categories');
while ($category = mysql_fetch_array($categories))
{
$catid = $category['cat_id'];
if ($shortURL == 1) {
$cat_url = $gallery_url.'cat'.$catid.'.htm';
}else {
$cat_url = $gallery_url.'categories.php?cat_id='.$catid;
}

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

$images = mysql_query('SELECT image_id,image_active,image_date FROM ' . $table_prefix . 'images ');
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.'img'.$imgid.'.htm';
}else{
$img_url = $gallery_url.'details.php?image_id='.$imgid;
}
print_xml($img_url,$prio_img,$date,$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'];
$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.google.com/schemas/sitemap/0.84\"
xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"
xsi:schemaLocation=\"http://www.google.com/schemas/sitemap/0.84 http://www.google.com/schemas/sitemap/0.84/sitemap.xsd\">";
}

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

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

@mawenzi
Verschiebe diesen Thread doch bitte mal und umbennen des Titels wäre bestimmt auch keine schlechte Idee... (o:
Title: Re: [MOD] Google Sitemap for your gallery
Post by: mawenzi on January 02, 2007, 06:04:45 PM
@ Acidgod 
... gesagt ... getan ... ;)
Title: Re: [MOD] Google Sitemap for your gallery
Post by: Acidgod on January 02, 2007, 06:05:05 PM
THX... (o:
Title: Re: [MOD] Google Sitemap for your gallery
Post by: kai on January 02, 2007, 06:13:29 PM
Great job!
Title: Re: [MOD] Google Sitemap for your gallery
Post by: son_gokou on January 03, 2007, 02:45:24 AM
I think I dont have access to .htaccess.

Can you tell me exactly what this mod does?
Title: Re: [MOD] Google Sitemap for your gallery
Post by: Acidgod on January 03, 2007, 09:41:59 AM
You don't need the .htaccess Part....

Here you can take a look:
http://www.picsforfree.de/google.php
Title: Re: [MOD] Google Sitemap for your gallery
Post by: medo007 on January 03, 2007, 10:53:45 AM
You don't need the .htaccess Part....

Here you can take a look:
http://www.picsforfree.de/google.php

I can't see it!

I get this:
Code: [Select]
http://www.picsforfree.de/cat1.htm 0.8 daily   http://www.picsforfree.de/cat2.htm 0.8 daily   http://www.picsforfree.de/cat4.htm 0.8 daily   http://www.picsforfree.de/cat5.htm 0.8 daily   http://www.picsforfree.de/cat6.htm 0.8 daily   http://www.picsforfree.de/cat7.htm 0.8 daily   http://www.picsforfree.de/cat8.htm 0.8 daily   http://www.picsforfree.de/cat9.htm 0.8 daily   http://www.picsforfree.de/cat10.htm 0.8 daily   http://www.picsforfree.de/cat11.htm 0.8 daily   http://www.picsforfree.de/cat12.htm 0.8 daily   http://www.picsforfree.de/cat13.htm 0.8 daily   http://www.picsforfree.de/cat14.htm 0.8 daily   http://www.picsforfree.de/cat15.htm 0.8 daily   http://www.picsforfree.de/cat16.htm 0.8 daily   http://www.picsforfree.de/cat17.htm 0.8 daily   http://www.picsforfree.de/cat18.htm 0.8 daily   http://www.picsforfree.de/cat19.htm 0.8 daily   http://www.picsforfree.de/cat20.htm 0.8 daily   http://www.picsforfree.de/cat21.htm 0.8 daily   http://www.picsforfree.de/cat22.htm 0.8 daily   http://www.picsforfree.de/cat23.htm 0.8 daily   http://www.picsforfree.de/cat24.htm 0.8 daily   http://www.picsforfree.de/cat25.htm 0.8 daily   http://www.picsforfree.de/cat26.htm 0.8 daily   http://www.picsforfree.de/cat27.htm 0.8 daily   http://www.picsforfree.de/cat28.htm 0.8 daily   http://www.picsforfree.de/cat29.htm 0.8 daily   http://www.picsforfree.de/cat30.htm 0.8 daily   http://www.picsforfree.de/cat31.htm 0.8 daily   http://www.picsforfree.de/cat32.htm 0.8 daily   http://www.picsforfree.de/cat33.htm 0.8 daily   http://www.picsforfree.de/cat34.htm 0.8 daily   http://www.picsforfree.de/cat36.htm 0.8 daily   http://www.picsforfree.de/cat37.htm 0.8 daily   http://www.picsforfree.de/cat38.htm 0.8 daily   http://www.picsforfree.de/cat39.htm 0.8 daily   http://www.picsforfree.de/cat40.htm 0.8 daily   http://www.picsforfree.de/cat41.htm 0.8 daily   http://www.picsforfree.de/cat42.htm 0.8 daily   http://www.picsforfree.de/cat43.htm 0.8 daily   http://www.picsforfree.de/cat44.htm 0.8 daily   http://www.picsforfree.de/cat45.htm 0.8 daily   http://www.picsforfree.de/cat46.htm 0.8 daily   http://www.picsforfree.de/cat47.htm 0.8 daily   http://www.picsforfree.de/cat48.htm 0.8 daily   http://www.picsforfree.de/cat49.htm 0.8 daily   http://www.picsforfree.de/cat50.htm 0.8 daily   http://www.picsforfree.de/cat51.htm 0.8 daily   http://www.picsforfree.de/cat52.htm 0.8 daily   http://www.picsforfree.de/cat53.htm 0.8 daily   http://www.picsforfree.de/cat54.htm 0.8 daily   http://www.picsforfree.de/cat55.htm 0.8 daily   http://www.picsforfree.de/cat56.htm 0.8 daily   http://www.picsforfree.de/cat57.htm 0.8 daily   http://www.picsforfree.de/cat58.htm 0.8 daily   http://www.picsforfree.de/cat68.htm 0.8 daily   http://www.picsforfree.de/cat73.htm 0.8 daily   http://www.picsforfree.de/cat83.htm 0.8 daily   http://www.picsforfree.de/cat84.htm 0.8 daily   http://www.picsforfree.de/cat85.htm 0.8 daily   http://www.picsforfree.de/cat86.htm 0.8 daily   http://www.picsforfree.de/cat87.htm 0.8 daily   http://www.picsforfree.de/cat88.htm 0.8 daily   http://www.picsforfree.de/cat89.htm 0.8 daily   http://www.picsforfree.de/cat90.htm 0.8 daily   http://www.picsforfree.de/cat91.htm 0.8 daily   http://www.picsforfree.de/cat92.htm 0.8 daily   http://www.picsforfree.de/cat93.htm 0.8 daily   http://www.picsforfree.de/cat94.htm 0.8 daily   http://www.picsforfree.de/cat95.htm 0.8 daily   http://www.picsforfree.de/cat96.htm 0.8 daily   http://www.picsforfree.de/cat97.htm 0.8 daily   http://www.picsforfree.de/cat98.htm 0.8 daily   http://www.picsforfree.de/cat99.htm 0.8 daily   http://www.picsforfree.de/cat100.htm 0.8 daily   http://www.picsforfree.de/cat101.htm 0.8 daily   http://www.picsforfree.de/cat102.htm 0.8 daily   http://www.picsforfree.de/cat103.htm 0.8 daily   http://www.picsforfree.de/cat104.htm 0.8 daily   http://www.picsforfree.de/cat105.htm 0.8 daily   http://www.picsforfree.de/cat106.htm 0.8 daily   http://www.picsforfree.de/cat107.htm 0.8 daily   http://www.picsforfree.de/cat108.htm 0.8 daily   http://www.picsforfree.de/cat109.htm 0.8 daily   http://www.picsforfree.de/cat110.htm 0.8 daily   http://www.picsforfree.de/cat111.htm 0.8 daily   http://www.picsforfree.de/cat112.htm 0.8 daily   http://www.picsforfree.de/cat113.htm 0.8 daily   http://www.picsforfree.de/cat114.htm 0.8 daily   http://www.picsforfree.de/cat115.htm 0.8 daily   http://www.picsforfree.de/cat116.htm 0.8 daily   http://www.picsforfree.de/cat117.htm 0.8 daily   http://www.picsforfree.de/cat118.htm 0.8 daily   http://www.picsforfree.de/cat119.htm 0.8 daily   http://www.picsforfree.de/cat120.htm 0.8 daily   http://www.picsforfree.de/cat121.htm 0.8 daily   http://www.picsforfree.de/cat122.htm 0.8 daily   http://www.picsforfree.de/cat123.htm 0.8 daily   http://www.picsforfree.de/cat124.htm 0.8 daily   http://www.picsforfree.de/cat125.htm 0.8 daily   http://www.picsforfree.de/cat126.htm 0.8 daily   http://www.picsforfree.de/cat127.htm 0.8 daily   http://www.picsforfree.de/cat128.htm 0.8 daily   http://www.picsforfree.de/cat129.htm 0.8 daily   http://www.picsforfree.de/cat130.htm 0.8 daily   http://www.picsforfree.de/cat131.htm 0.8 daily   http://www.picsforfree.de/cat132.htm 0.8 daily   http://www.picsforfree.de/cat134.htm 0.8 daily   http://www.picsforfree.de/cat135.htm 0.8 daily   http://www.picsforfree.de/cat136.htm 0.8 daily   http://www.picsforfree.de/cat137.htm 0.8 daily   http://www.picsforfree.de/cat138.htm 0.8 daily   http://www.picsforfree.de/cat139.htm 0.8 daily   http://www.picsforfree.de/cat140.htm 0.8 daily   http://www.picsforfree.de/cat141.htm 0.8 daily   http://www.picsforfree.de/cat142.htm 0.8 daily   http://www.picsforfree.de/cat143.htm 0.8 daily   http://www.picsforfree.de/cat144.htm 0.8 daily   http://www.picsforfree.de/img7367.htm 0.5 2006-09-05T11:07:18+00:00 yearly   http://www.picsforfree.de/img7368.htm 0.5 2006-09-05T11:07:18+00:00 yearly   http://www.picsforfree.de/img193.htm 0.5 2005-09-06T16:16:20+00:00 yearly   http://www.picsforfree.de/img192.htm 0.5 2005-09-06T16:16:20+00:00 yearly   http://www.picsforfree.de/img191.htm 0.5 2005-09-06T16:16:20+00:00 yearly   http://www.picsforfree.de/img190.htm 0.5 2005-09-06T16:16:20+00:00 yearly   http://www.picsforfree.de/img189.htm 0.5 2005-09-06T16:16:20+00:00 yearly   http://www.picsforfree.de/img188.htm 0.5 2005-09-06T16:16:20+00:00 yearly   http://www.picsforfree.de/img274.htm 0.5 2005-09-06T17:01:54+00:00 yearly   http://www.picsforfree.de/img186.htm 0.5 2005-09-06T16:16:20+00:00 yearly   http://www.picsforfree.de/img276.htm 0.5 2005-09-06T17:01:54+00:00 yearly   http://www.picsforfree.de/img185.htm 0.5 2005-09-06T16:16:20+00:00 yearly   http://www.picsforfree.de/img202.htm 0.5 2005-09-06T16:43:19+00:00 yearly   http://www.picsforfree.de/img275.htm 0.5 2005-09-06T17:01:54+00:00 yearly   http://www.picsforfree.de/img182.htm 0.5 2005-09-06T16:16:20+00:00 yearly   http://www.picsforfree.de/img181.htm 0.5 2005-09-06T16:16:20+00:00 yearly   http://www.picsforfree.de/img180.htm 0.5 2005-09-06T16:16:20+00:00 yearly   http://www.picsforfree.de/img179.htm 0.5 2005-09-06T16:16:20+00:00 yearly   http://www.picsforfree.de/img178.htm 0.5 2005-09-06T16:16:20+00:00 yearly   http://www.picsforfree.de/img177.htm 0.5 2005-09-06T16:16:20+00:00 yearly   http://www.picsforfree.de/img176.htm 0.5 2005-09-06T16:16:20+00:00 yearly   http://www.picsforfree.de/img175.htm

Lot's of that!  :D
Title: Re: [MOD] Google Sitemap for your gallery
Post by: Acidgod on January 03, 2007, 10:58:27 AM
LOL...

You don't now Google Sitemap?  8O

http://www.google.com/webmasters/sitemaps/
Title: Re: [MOD] Google Sitemap for your gallery
Post by: medo007 on January 03, 2007, 11:26:15 AM
I don't have sitemap.xml file!
I have to create it manualy or...?  :?
Title: Re: [MOD] Google Sitemap for your gallery
Post by: Acidgod on January 03, 2007, 01:41:04 PM
Try to use the IE... (o:

Mozilla don't show XML Files correctly...
Title: Re: [MOD] Google Sitemap for your gallery
Post by: lorddean on January 04, 2007, 11:05:24 PM
How does this MOD treat links to images/categories which belong to locked/non-public categories/images?
Title: Re: [MOD] Google Sitemap for your gallery
Post by: Acidgod on January 05, 2007, 09:59:27 AM
is it so hard to put the file on your webspace and take a look?  :? :?
Title: Re: [MOD] Google Sitemap for your gallery
Post by: Bugfixed on January 05, 2007, 10:38:01 AM
thanks for mod.

But
Acidgod  I see this error.

Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /.../galeri/google.php on line 68
Title: Re: [MOD] Google Sitemap for your gallery
Post by: Acidgod on January 05, 2007, 10:45:00 AM
which mysql version?
Title: Re: [MOD] Google Sitemap for your gallery
Post by: Bugfixed on January 05, 2007, 11:23:09 AM
thanks for reply.

my mysql version: 4.1.20-1
my php version: 4.4.2-1
my httpd version: 2.0.53-9.15
on suse linux 9.3

 :(
Title: Re: [MOD] Google Sitemap for your gallery
Post by: Acidgod on January 05, 2007, 11:27:03 AM
try to change
'users WHERE user_id >= "1"'

to
'users'
Title: Re: [MOD] Google Sitemap for your gallery
Post by: Bugfixed on January 05, 2007, 11:34:55 AM
thanks for reply.

but some error.  :cry:

Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /.../galeri/google.php on line 68
Title: Re: [MOD] Google Sitemap for your gallery
Post by: lorddean on January 05, 2007, 04:08:39 PM
is it so hard to put the file on your webspace and take a look?  :? :?
Well I tried and I found out that it listed ALL images/categories. Also those which is supposed to be non-public. I don't know anything about is, but is that smart? Or doesn't it compromise the procettion of non-public images/categories?
Title: Re: [MOD] Google Sitemap for your gallery
Post by: __G__ on February 02, 2007, 10:36:57 PM
how do i get the xml file ?
Title: Re: [MOD] Google Sitemap for your gallery
Post by: Acidgod on February 03, 2007, 01:10:39 AM

1. Upload the file google.php to the root folder of 4images.
2. Modify the .htaccess to rewrite the URL of sitemap.

Code: [Select]
RewriteRule ^sitemap.xml$ google.php
Now the URL of sitemap is: http://www.yourdomain.com/sitemap.xml
Title: Re: [MOD] Google Sitemap for your gallery
Post by: __G__ on February 03, 2007, 01:29:46 AM
Got it thanks a lot
Title: Re: [MOD] Google Sitemap for your gallery
Post by: __G__ on February 03, 2007, 09:40:34 AM
i get this error

 Errors
Line:
   5
   Paths don't match
We've detected that you submitted your Sitemap using a URL path that doesn't include the www prefix (for instance, http://example.com/sitemap.xml). However, the URLs listed inside your Sitemap do use the www prefix (for instance, http://www.example.com/myfile.htm).    [?]    URL:
   http://www.mehsus.com
Line:
   14
   Invalid date
An invalid date was found. Please fix the date or formatting before resubmitting.    [?]    Parent tag:
Tag:
Value:    url
lastmod
Line:
   11
   Paths don't match
We've detected that you submitted your Sitemap using a URL path that doesn't include the www prefix (for instance, http://example.com/sitemap.xml). However, the URLs listed inside your Sitemap do use the www prefix (for instance, http://www.example.com/myfile.htm).    [?]    URL:
   http://www.mehsus.com/cat1.htm
Line:
   20
   Invalid date
An invalid date was found. Please fix the date or formatting before resubmitting.    [?]    Parent tag:
Tag:
Value:    url
lastmod
Line:
   17
   Paths don't match
We've detected that you submitted your Sitemap using a URL path that doesn't include the www prefix (for instance, http://example.com/sitemap.xml). However, the URLs listed inside your Sitemap do use the www prefix (for instance, http://www.example.com/myfile.htm).    [?]    URL:
   http://www.mehsus.com/cat2.htm
Line:
   26
   Invalid date
An invalid date was found. Please fix the date or formatting before resubmitting.    [?]    Parent tag:
Tag:
Value:    url
lastmod
Line:
   23
   Paths don't match
We've detected that you submitted your Sitemap using a URL path that doesn't include the www prefix (for instance, http://example.com/sitemap.xml). However, the URLs listed inside your Sitemap do use the www prefix (for instance, http://www.example.com/myfile.htm).    [?]    URL:
   http://www.mehsus.com/cat3.htm
Line:
   32
   Invalid date
An invalid date was found. Please fix the date or formatting before resubmitting.    [?]    Parent tag:
Tag:
Value:    url
lastmod
Line:
   29
   Paths don't match
We've detected that you submitted your Sitemap using a URL path that doesn't include the www prefix (for instance, http://example.com/sitemap.xml). However, the URLs listed inside your Sitemap do use the www prefix (for instance, http://www.example.com/myfile.htm).    [?]    URL:
   http://www.mehsus.com/cat4.htm
Line:
   38
   Invalid date
An invalid date was found. Please fix the date or formatting before resubmitting.    [?]    Parent tag:
Tag:
Value:    url
lastmod
Title: Re: [MOD] Google Sitemap for your gallery
Post by: Acidgod on February 03, 2007, 10:23:48 AM
The Mod works fine... (o:

But you have set up google sitemap wrong...

go to google.com an setup the sitemap with www in front of your domain...

http://www.mehsus.com/google.php

and not:
http://mehsus.com/google.php

Do you understand what i meen?
Title: Re: [MOD] Google Sitemap for your gallery
Post by: __G__ on February 03, 2007, 10:53:05 AM
thanks a lot its done now :D
Title: Re: [MOD] Google Sitemap for your gallery
Post by: __G__ on February 03, 2007, 11:15:29 PM
bro 1200 submitted successfully but whats this error about ?

 Errors
Line:
   14
   Invalid date
An invalid date was found. Please fix the date or formatting before resubmitting.    [?]    Parent tag:
Tag:
Value:    url
lastmod
Line:
   20
   Invalid date
An invalid date was found. Please fix the date or formatting before resubmitting.    [?]    Parent tag:
Tag:
Value:    url
lastmod
Line:
   26
   Invalid date
An invalid date was found. Please fix the date or formatting before resubmitting.    [?]    Parent tag:
Tag:
Value:    url
lastmod
Line:
   32
   Invalid date
An invalid date was found. Please fix the date or formatting before resubmitting.    [?]    Parent tag:
Tag:
Value:    url
lastmod
Line:
   38
   Invalid date
An invalid date was found. Please fix the date or formatting before resubmitting.    [?]    Parent tag:
Tag:
Value:    url
lastmod
Line:
   44
   Invalid date
An invalid date was found. Please fix the date or formatting before resubmitting.    [?]    Parent tag:
Tag:
Value:    url
lastmod
Line:
   50
   Invalid date
An invalid date was found. Please fix the date or formatting before resubmitting.    [?]    Parent tag:
Tag:
Value:    url
lastmod
Line:
   56
   Invalid date
An invalid date was found. Please fix the date or formatting before resubmitting.    [?]    Parent tag:
Tag:
Value:    url
lastmod
Line:
   62
   Invalid date
An invalid date was found. Please fix the date or formatting before resubmitting.    [?]    Parent tag:
Tag:
Value:    url
lastmod
Line:
   68
   Invalid date
An invalid date was found. Please fix the date or formatting before resubmitting.    [?]    Parent tag:
Tag:
Value:    url
las
Title: Re: [MOD] Google Sitemap for your gallery
Post by: Acidgod on February 04, 2007, 02:33:31 PM
please post you google.php here....
Title: Re: [MOD] Google Sitemap for your gallery
Post by: __G__ on February 04, 2007, 02:36:55 PM
here it is bro
Title: Re: [MOD] Google Sitemap for your gallery
Post by: Acidgod on February 04, 2007, 02:41:18 PM
why you don't use my code???


Code: [Select]
<?
# 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 = 'http://www.picsforfree.de/';

# 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.3;

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

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

# Print XML header
xml_head();

# Print URLs
$categories = mysql_query('SELECT cat_id FROM ' . $table_prefix . 'categories');
while ($category = mysql_fetch_array($categories))
{
$catid = $category['cat_id'];
if ($shortURL == 1) {
$cat_url = $gallery_url.'cat'.$catid.'.htm';
}else {
$cat_url = $gallery_url.'categories.php?cat_id='.$catid;
}

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

$images = mysql_query('SELECT image_id,image_active,image_date FROM ' . $table_prefix . 'images ');
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.'img'.$imgid.'.htm';
}else{
$img_url = $gallery_url.'details.php?image_id='.$imgid;
}
print_xml($img_url,$prio_img,$date,$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'];
$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.google.com/schemas/sitemap/0.84\"
xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"
xsi:schemaLocation=\"http://www.google.com/schemas/sitemap/0.84 http://www.google.com/schemas/sitemap/0.84/sitemap.xsd\">";
}

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

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

Title: Re: [MOD] Google Sitemap for your gallery
Post by: __G__ on February 04, 2007, 02:56:41 PM
ok bro using da code u gave me thx bro
Title: Re: [MOD] Google Sitemap for your gallery
Post by: cpuswe on February 04, 2007, 10:30:00 PM
Works great! Thanks both!

Got a "Parse error: syntax error, unexpected T_STRING"

replaced

echo "<?xml version='1.0' encoding='UTF-8'?>

with

echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>


Dont know if its a cut/paste/firefox/IE/PHP error but that solved it.

/Thomas
Title: Re: [MOD] Google Sitemap for your gallery
Post by: medo007 on February 06, 2007, 12:19:52 AM
I still can't get sitemap.xml file!  :(
Title: Re: [MOD] Google Sitemap for your gallery
Post by: son_gokou on February 06, 2007, 01:01:05 AM
http://www.4homepages.de/forum/index.php?action=dlattach;topic=15687.0;attach=1098

here dude
Title: Re: [MOD] Google Sitemap for your gallery
Post by: SAD on May 18, 2007, 09:39:11 AM
What to avoid mistakes at processing google the robot of categories, it is necessary a code

Code: [Select]
$categories = mysql_query('SELECT cat_id FROM ' . $table_prefix . 'categories');
while ($category = mysql_fetch_array($categories))
{
$catid = $category['cat_id'];
if ($shortURL == 1) {
$cat_url = $gallery_url.'cat'.$catid.'.htm';
}else {
$cat_url = $gallery_url.'categories.php?cat_id='.$catid;
}

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

replace

Code: [Select]
$categories = mysql_query('SELECT cat_id FROM ' . $table_prefix . 'categories');
while ($category = mysql_fetch_array($categories))
{
$catid = $category['cat_id'];
if ($shortURL == 1) {
$cat_url = $gallery_url.'cat'.$catid.'.htm';
}else {
$cat_url = $gallery_url.'categories.php?cat_id='.$catid;
}

$date = date("Y-m-d")."T".date("H:i:s")."+00:00";
print_xml($cat_url,$prio_cat,$date,$freq_cat);
}
Title: Re: [MOD] Google Sitemap for your gallery
Post by: prive on May 21, 2007, 04:03:25 PM
In which directory this the file .htaccecs , is necessary to create one new one in the root of 4i?

In GOOGLE:

That direction is necessary to write in gloogle for sitemap:
http://www.site.com/sitemap.xml
ór
http://www.site.com/google.php

thanks
Title: Re: [MOD] Google Sitemap for your gallery
Post by: Falldog on May 26, 2007, 07:54:57 AM
Nifty code, thank you very much.

My one question is there a way I can get it to output the rewrite URL I use on my site like http://www.imgdump.info/cat-funny-39.htm instead of http://www.imgdump.info/cat39.htm?
Title: Re: [MOD] Google Sitemap for your gallery
Post by: AntiNSA2 on July 05, 2007, 03:06:15 AM
You may need to add this line to you htaccess to get the file to work

RewriteEngine On
Title: Re: [MOD] Google What is the importance of this part of the code
Post by: AntiNSA2 on July 05, 2007, 04:17:55 AM
# Frequency
//"always", "hourly", "daily", "weekly", "monthly", "yearly" or "never"
$freq_img      = 'yearly';
$freq_cat      = 'daily';
$freq_profile   = 'daily';

Does that mean daily indexing?
Title: Re: [MOD] Google Sitemap for your gallery
Post by: AntiNSA2 on July 05, 2007, 04:47:51 AM
and would this

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

which one is for if you dont have the short url mod-

0 or 1?
Title: Re: [MOD] Google Sitemap for your gallery
Post by: Buggy Driver on July 05, 2007, 11:37:38 AM
Its actually very easy (once you know the answer  :wink:)

1 = ON
0 = OFF

so in your case, you don’t need the shortURL so it has to be off     
$shortURL   = 0;   



And this maybe off interest to some of you.
I have several private categories and if I give those url s to Google it will end up at the start page because Google doesn’t have permission to view the image.  I changed the query string so that Google will only get the url for public images.

Code: [Select]
$categories = mysql_query('SELECT cat_id FROM ' . $table_prefix . 'categories WHERE auth_viewimage = 0');

and
Code: [Select]
$images = mysql_query('SELECT image_id,image_active,image_date
                       FROM ' . $table_prefix . 'images
                       WHERE image_active = 1
                       AND cat_id IN (SELECT cat_id
                                      FROM 4images_categories
                                      WHERE auth_viewimage = 0)'); 
Title: Re: [MOD] Google Sitemap for your gallery
Post by: AntiNSA2 on July 05, 2007, 05:40:30 PM
Thanks!

Appreciate it

Robert
Title: Re: [MOD] Google Sitemap for your gallery
Post by: ashfaq on July 21, 2007, 11:06:03 AM
I am using short url and daily update my site, plz tell me will google.php file updates sitemap every time when i update my site ?
one more thing is i give this link "http://www.yourdomain.com/sitemap.xml" but i didnt have sitemap.xml file, will google.php will create sitemap.xml itself ?
Plz can you give code file in zip format for short url enables, infact i am afraid that i will make some mistake in php file.
I will upload wallpapers and gd libarary etc... will create thumbnails itself, Can you plz tell how to control thumbnails size ?
AcidGod Dear Plz Help i will be very thankfull to you and i am using version 1.74
Title: Re: [MOD] Google Sitemap for your gallery
Post by: sami1255 on July 24, 2007, 09:21:24 PM
Hi..

am using google SEO mod.. http://www.4homepages.de/forum/index.php?topic=17598.0 (http://www.4homepages.de/forum/index.php?topic=17598.0)

can i have a site map based on this? please help me out.. ill be grateful

Regards,
sami
Title: Re: [MOD] Google Sitemap for your gallery
Post by: Lennforce on August 24, 2007, 12:30:00 PM
Hallo,
ich möchte den MOD auch gerne Nutzen, aber bei mir wird irgendwie keine sitemap.xml erstellt.

Also wenn ich auf htt://www.picture-collection.net/google.php (http://htt://www.picture-collection.net/google.php) durchlaufen lassen, wird keine sitemap datei erstellt. Habe das auch schon mit dem IE ausprobiert und in meinem Webspace geschaut. Die .htaccess Datei musste ich deaktivieren, da ich sonst das script nicht laufen lassen konnte und bei mir einfach nur der Quellcode erschienen ist.

Wer kann mir helfen.

Gruß Lennforce
Title: Re: [MOD] Google Sitemap for your gallery
Post by: KurtW on August 24, 2007, 01:12:24 PM
Hallo,

das ist auch kein funktionierender link  :wink:

versuch mal: http://www.picture-collection.net/google.php (http://www.picture-collection.net/google.php)


Kurt
Title: Re: [MOD] Google Sitemap for your gallery
Post by: Lennforce on August 24, 2007, 11:27:11 PM
Ja, den meinte ich ja, aber von einer sitemap.xml nichts zu sehen.
Title: Re: [MOD] Google Sitemap for your gallery
Post by: darvid on August 30, 2007, 05:57:56 PM
sehr gute arbeit!
Title: Re: [MOD] Google Sitemap for your gallery
Post by: darvid on September 01, 2007, 12:09:48 PM
oh jetzt hab ich doch noch ne frage bzw. nen problem:

ich nutze den MOD google friendly urls (http://www.4homepages.de/forum/index.php?topic=17598.0), so dass die short urls bei mir anders aussehen. mit diesem sitemap mod stimmen die urls dann nicht überein

Wie müsste ich den code in der google.php umschreiben? ich vermute es handelt sich um zeile 38 - 49.
Title: Re: [MOD] Google Sitemap for your gallery
Post by: ashfaq on September 03, 2007, 06:20:35 PM
I daily update my site, will sitemap also be updated automatically when i update my site ? Plz attach sitemap final working file. Thanks
Title: Re: [MOD] Google Sitemap for your gallery
Post by: skunk on September 10, 2007, 10:14:09 AM
how can i prevent google's search engine/robots from adding my site links to their search engine without "?sessionid=0f89a8a34ec9ef1872abc65b47a0a8dc" , after every link there is "?sessionid=" which i dont like .. :S anybody can help me? thanks
Title: Re: [MOD] Google Sitemap for your gallery
Post by: thunderstrike on September 10, 2007, 12:50:02 PM
@skunk:

Please read this:

http://www.4homepages.de/forum/index.php?topic=8802.0
Title: Re: [MOD] Google Sitemap for your gallery
Post by: ashfaq on September 10, 2007, 05:10:34 PM
I daily update my site, will sitemap also be updated automatically when i update my site ? Plz attach sitemap final working file. Thanks

Will anyone plz help with this issue ?
Title: Re: [MOD] Google Sitemap for your gallery
Post by: darvid on September 10, 2007, 05:35:31 PM
 :arrow: yes
Title: Re: [MOD] Google Sitemap for your gallery
Post by: ashfaq on September 11, 2007, 05:06:13 PM
THen plz dear help as you told yes.
Title: Re: [MOD] Google Sitemap for your gallery
Post by: cpuswe on September 16, 2007, 09:04:57 PM
As others say, this would be nice to have working with the "[MOD] Google Friendly Urls For 4images Best Seo Mod" "http://www.4homepages.de/forum/index.php?topic=17598.60"
Title: Re: [MOD] Google Sitemap for your gallery
Post by: _erc_ on September 19, 2007, 08:28:36 AM
Do not cat id vs photo id

seo activ

/cat1.htm = Not Found
/img700.htm = Not Found

Please help me
Title: Re: [MOD] Google Sitemap for your gallery
Post by: egyptsons on October 15, 2007, 04:44:45 AM
Thanks but I have more than 50000 URL  :roll:
so I got this error on Google Sitemape
Quote
Your Sitemap contains too many URLs. Please create multiple Sitemaps with up to 50000 URLs each and submit all Sitemaps
Title: Re: [MOD] Google Sitemap for your gallery
Post by: son_gokou on October 22, 2007, 08:47:47 PM
I don´t need to copy into the file of this topic my first xml code?
Title: Re: [MOD] Google Sitemap for your gallery
Post by: son_gokou on October 22, 2007, 11:51:50 PM
Forget it... I just have to put the right URL...
Title: Re: [MOD] Google Sitemap for your gallery
Post by: KPeBiz on October 24, 2007, 06:37:28 AM

Hi,

I have done everything as per instruction below. How do I create the sitemap? Is it created automatically or do I need to turn on the process?

Thank you.


Hi,

You can create a Google Sitemap for your Gallery to improve traffic to your site.

You must install the Search Engine friendly MOD before use this file.

1. Upload the file google.php to the root folder of 4images.
2. Modify the .htaccess to rewrite the URL of sitemap.

Code: [Select]
RewriteRule ^sitemap.xml$ google.php
Now the URL of sitemap is: http://www.yourdomain.com/sitemap.xml

You can send a ping to Google to notify your new sitemap by this way: http://www.google.com/webmasters/sitemaps/ping?sitemap=URL_TO_YOUR_SITEMAP

Good luck!
Mai
Title: Re: [MOD] Google Sitemap for your gallery
Post by: son_gokou on October 24, 2007, 02:04:56 PM
Just Download google.zip
Title: Re: [MOD] Google Sitemap for your gallery
Post by: KPeBiz on October 24, 2007, 06:54:41 PM
Just Download google.zip

Thank you.

I have installed it but I encountered a problem.

I have earlier install a MOD to have a Google SEF URL as per this thread: http://www.4homepages.de/forum/index.php?topic=17598.0

The URL format does not work with this Google sitemap. Does anyone has any solution to it? I am not a programmer and it is really tough for me to read those code.

Thank you.
Title: Re: [MOD] Google Sitemap for your gallery
Post by: Julz on October 28, 2007, 09:53:09 AM
Hey dar!

I Need some help please..

Ive installed your mod for short urls http://www.4homepages.de/forum/index.php?topic=6729.msg57268#msg57268 (http://www.4homepages.de/forum/index.php?topic=6729.msg57268#msg57268)

It works fine, and ive also installed Google Sitemap:http://www.4homepages.de/forum/index.php?topic=15687.0 (http://www.4homepages.de/forum/index.php?topic=15687.0)

Now i'd like to know how i can have the same urls in my sitemap as my gallery?

Hope you cna help me :wink:

Julz
Title: Re: [MOD] Google Sitemap for your gallery
Post by: son_gokou on October 28, 2007, 12:16:35 PM
I'm not understanding well what you want...
Title: Re: [MOD] Google Sitemap for your gallery
Post by: Julz on October 28, 2007, 04:39:44 PM
oky

I installed the Short URLs MOD, so my urls are now like this:

www.site.com/cat-categoryname-id.htm & www.site.com/img-imagename-id.htm
That is all working fine, but now in my Google Sitemap, the image name are still as follow:

www.site.com/cat-id.htm & www.site.com/img-id.htm

How could i change it so that my urls in my sitemap will also show the ../img-imagename-id.htm in it?
Hope that makes more sense  :oops:

Julz
Title: Re: [MOD] Google Sitemap for your gallery
Post by: baghdad4ever on January 04, 2008, 02:54:44 PM
plz i confused now :cry:

what is the exact file which i upload it

the one in the attachment

or the code in this reply

http://www.4homepages.de/forum/index.php?topic=15687.msg85639#msg85639

i want the final php after all customization

plz help

Title: Re: [MOD] Google Sitemap for your gallery
Post by: Krali on February 06, 2008, 12:30:15 PM
Hello,

I have the same problem, like other users. I don't get the file "sitemap.xml" in the webroot created.

And please, I want the absolutely updated and latest version of this great mod too.

Kind regards,

Krali
Title: Re: [MOD] Google Sitemap for your gallery
Post by: maineyak on February 26, 2008, 03:22:23 PM
I'm having the same problem others are that are using the Search Engine Friendly URLs aka Short URLs mod found here: http://www.4homepages.de/forum/index.php?topic=6729.0

My new image url's are like this: http://www.domain.com/image-demon-236.htm, but the sitemap is showing the urls like this: http://www.domain.com/img236.htm, which is the old url structure.

Can I fix this?
Title: Re: [MOD] Google Sitemap for your gallery
Post by: CanonInk on February 27, 2008, 09:39:20 PM
I'm having the same problem others are that are using the Search Engine Friendly URLs aka Short URLs mod found here: http://www.4homepages.de/forum/index.php?topic=6729.0

My new image url's are like this: http://www.domain.com/image-demon-236.htm, but the sitemap is showing the urls like this: http://www.domain.com/img236.htm, which is the old url structure.

Can I fix this?

Try this...

Open google.php

Find:
Code: [Select]
$categories = mysql_query('SELECT cat_id FROM ' . $table_prefix . 'categories');

Replace with:
Code: [Select]
$categories = mysql_query('SELECT cat_id, cat_name FROM ' . $table_prefix . 'categories');

Find:
Code: [Select]
$catid = $category['cat_id'];

Add after:
Code: [Select]
$cat_name = $category['cat_name'];

Find:
Code: [Select]
$cat_url = $gallery_url.'cat'.$catid.'.htm';

Replace with:
Code: [Select]
$cat_url = $gallery_url.'cat-'.$cat_name.'-'.$catid.'.htm';

Find:
Code: [Select]
$images = mysql_query('SELECT image_id,image_active,image_date FROM ' . $table_prefix . 'images ');

Replace with:
Code: [Select]
$images = mysql_query('SELECT image_id,image_name,image_active,image_date FROM ' . $table_prefix . 'images ');

Find:
Code: [Select]
$imgid = $image['image_id'];

Add after:
Code: [Select]
$imgna = $image['image_name'];

Find:
Code: [Select]
$img_url = $gallery_url.'img'.$imgid.'.htm';

Replace with:
Code: [Select]
$img_url = $gallery_url.'img'.$image_name.'-'.$imgid.'.htm';

When works, enjoy. It should be not work with "äüöß" or "ÄÖÜ" in cat_name or image_name. Have somebody a solution?

OR

Find:
Code: [Select]
$shortURL = 1;

Change to:
Code: [Select]
$shortURL = 0;


Take care, CanonInk
Title: Re: [MOD] Google Sitemap for your gallery
Post by: rbfabbri on April 06, 2008, 07:22:40 AM
CanonInk, this works for me only for categories.

The images continues

http://www.estampafotos.com/galeria/img-23.htm

Any idea?

Thanks!!!
Title: Re: [MOD] Google Sitemap for your gallery
Post by: rbfabbri on April 06, 2008, 03:20:27 PM
I'm having a problem

My root folder of 4 images is http://www.estampafotos.com/galeria/

The sitemap is generated in http://www.estampafotos.com/sitemap.xml

When i open the sitemap in browser shows this error

Code: [Select]
Warning: require(config.php) [function.require]: failed to open stream: No such file or directory in /home2/estampaf/public_html/google.php on line 9

Warning: require(config.php) [function.require]: failed to open stream: No such file or directory in /home2/estampaf/public_html/google.php on line 9

Fatal error: require() [function.require]: Failed opening required 'config.php' (include_path='.:/usr/lib/php:/usr/local/lib/php:/home2/estampaf/php') in /home2/estampaf/public_html/google.php on line 9

How can i fix this?

Thanks!!!!
Title: Re: [MOD] Google Sitemap for your gallery
Post by: rodier on April 23, 2008, 04:28:37 AM
edit lol..  i was using another seo mod..   im try use the right one now ;)
Title: Re: [MOD] Google Sitemap for your gallery
Post by: rodier on April 23, 2008, 04:29:41 AM
I'm having a problem

My root folder of 4 images is http://www.estampafotos.com/galeria/

The sitemap is generated in http://www.estampafotos.com/sitemap.xml

When i open the sitemap in browser shows this error

Code: [Select]
Warning: require(config.php) [function.require]: failed to open stream: No such file or directory in /home2/estampaf/public_html/google.php on line 9

Warning: require(config.php) [function.require]: failed to open stream: No such file or directory in /home2/estampaf/public_html/google.php on line 9

Fatal error: require() [function.require]: Failed opening required 'config.php' (include_path='.:/usr/lib/php:/usr/local/lib/php:/home2/estampaf/php') in /home2/estampaf/public_html/google.php on line 9

How can i fix this?

Thanks!!!!

you need put google.php to root  where is config.php (it seems config.php missing)  or try set better attributres to config.php (set it to 777)
Title: Re: [MOD] Google Sitemap for your gallery
Post by: KurtW on April 23, 2008, 06:01:48 AM
I'm having a problem

My root folder of 4 images is http://www.estampafotos.com/galeria/

The sitemap is generated in http://www.estampafotos.com/sitemap.xml

Thanks!!!!

Hi,

The 4images Copyright is not available.
I assume that you have been licensed.

http://www.4homepages.de/4images/license.php#english


KurtW
Title: Re: [MOD] Google Sitemap for your gallery
Post by: fbmd on June 17, 2008, 03:46:52 AM
I adapted for those who use the [Mod] Search Engine Friendly URLs aka Short URLs (http://www.4homepages.de/forum/index.php?topic=6729.0).
I hope it will be useful for someone.
Title: Re: [MOD] Google Sitemap for your gallery
Post by: praveen100 on September 15, 2008, 02:56:08 PM
Thanks but I have more than 50000 URL  :roll:
so I got this error on Google Sitemape
Quote
Your Sitemap contains too many URLs. Please create multiple Sitemaps with up to 50000 URLs each and submit all Sitemaps

any fix for this 50000 url limit. i too facing the same issue now :(
Title: Re: [MOD] Google Sitemap for your gallery
Post by: picturexone on October 24, 2008, 06:17:19 PM
Dear sir it is Argent that i using your given site map detail everything is fine but site map is showing the url like that

http://www.picturexone.com/cat4.htm

but my actually link is like that: http://picturexone.com/img-lamberti-car-2-7.htm
how can i change my site map like that please dear do it please please
Title: Re: [MOD] Google Sitemap for your gallery
Post by: om6acw on January 01, 2009, 07:18:01 PM
So I did some changes in google.php and right now I have "almost" properly formatted links in sitemap.xml
but still I cant figure out how to replace empty space in names with "-"
Right now my links in sitemap looks like this:

Quote
http://www.myanimalsworld.com/img-wedge pond-17.htm

but working link should be like this with missing - between words

Quote
http://www.myanimalsworld.com/img-wedge-pond-17.htm

here is my google.php

Code: [Select]
<?
# 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 = 'http://www.myanimalsworld.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.3;

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

# 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 WHERE auth_viewimage = 0');
while ($category = mysql_fetch_array($categories))
{
$catid = $category['cat_id'];
$cat_name = $category['cat_name'] = strtr($category['cat_name'], "éèêàëâúóíáABCDEFGHIJKLMNOPQRSTUVWXYZ","eeeaeauoiaabcdefghijklmnopqrstuvwxyz");
if ($shortURL == 1) {
$cat_url = $gallery_url.'cat-'.$cat_name.'-'.$catid.'.htm';
}else {
$cat_url = $gallery_url.'categories.php?cat_id='.$catid;
}

print_xml($cat_url,$prio_cat,'',$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'];
$imgna = $image['image_name'] = strtr($image['image_name'], "éèêàëâúóíáABCDEFGHIJKLMNOPQRSTUVWXYZ","eeeaeauoiaabcdefghijklmnopqrstuvwxyz");
$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.'img-'.$imgna.'-'.$imgid.'.htm';
}else{
$img_url = $gallery_url.'details.php?image_id='.$imgid;
}
print_xml($img_url,$prio_img,$date,$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'];
$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.google.com/schemas/sitemap/0.84\"
xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"
xsi:schemaLocation=\"http://www.google.com/schemas/sitemap/0.84 http://www.google.com/schemas/sitemap/0.84/sitemap.xsd\">";
}

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

#-----------------------------------------------
# print_xml
#-----------------------------------------------
function print_xml($url,$priority,$lastmod,$changefreq) {
$temp = "<url>
<loc>$url</loc>";
$temp .= "  <priority>$priority</priority>";
if ($lastmod != '') {
$temp .="  <lastmod>$lastmod</lastmod>";
}
$temp .= "  <changefreq>$changefreq</changefreq>
</url>";
echo $temp;
}
?>
Title: Re: [MOD] Google Sitemap for your gallery
Post by: V@no on January 01, 2009, 08:12:02 PM
below
Code: [Select]
$imgna = $image['image_name'] = strtr($image['image_name'], "éèêàëâúóíáABCDEFGHIJKLMNOPQRSTUVWXYZ","eeeaeauoiaabcdefghijklmnopqrstuvwxyz");

Insert:
Code: [Select]
$imgna = str_replace(array(" ", "-"), array("_", "_"), $imgna); ### " - " used as a string separator in URL, it might break the link if image name has such character
$imgna = urlencode($imgna); ### make sure any other non-latin letters or special characters converted to a proper url string
Title: Re: [MOD] Google Sitemap for your gallery
Post by: om6acw on January 01, 2009, 08:47:28 PM
Thanks V@no this help me a lot!!!! I have actually one more question, some of my photo names are in this format
Quote
Ovis Canadensis (Bighorn sheep)
in my links they are shown like 
Quote
ovis_canadensis_(bighorn_sheep)
what kind of characters are safe for using in links because I think I have to change this () to something else. Maybe for _ but I am not sure if you can have two of them in line like this __
Title: Re: [MOD] Google Sitemap for your gallery
Post by: V@no on January 01, 2009, 09:43:24 PM
urlencode() function would convert anything that is not safe for links to link-safe format, so if () are not converted, then they are safe. Do you have problems with such links?

(http://img401.imageshack.us/img401/8317/problemsolvingep8.th.jpg) (http://img401.imageshack.us/img401/8317/problemsolvingep8.jpg)
(warning: foul language)


P.S.
You can have as many _ in a link as a link length standard limit is.
Title: Re: [MOD] Google Sitemap for your gallery
Post by: om6acw on January 01, 2009, 09:48:39 PM
urlencode() function would convert anything that is not safe for links to link-safe format, so if () are not converted, then they are safe. Do you have problems with such links?

(http://img401.imageshack.us/img401/8317/problemsolvingep8.th.jpg) (http://img401.imageshack.us/img401/8317/problemsolvingep8.jpg)
(warning: foul language)

I don't have any problem with this kind of links but I was asking because I wasn't sure if this characters are safe or not. Thanks for you help and time.
Title: Re: [MOD] Google Sitemap for your gallery
Post by: mike30 on January 02, 2009, 12:21:29 AM
Thanks for this mod!
Title: Re: [MOD] Google Sitemap for your gallery
Post by: kandr on January 22, 2009, 03:46:15 PM
Кто нибудь может помочь мне?? Как исправить google.php, чтоб картинки не брались из категории 0?

PLEASE!!! :cry:
Title: Re: [MOD] Google Sitemap for your gallery
Post by: V@no on January 22, 2009, 04:15:22 PM
Code: [Select]
$images = mysql_query('SELECT image_id,image_active,image_date FROM ' . $table_prefix . 'images WHERE cat_id NOT IN (0,1,2,3)');
Title: Re: [MOD] Google Sitemap for your gallery
Post by: kandr on January 22, 2009, 04:42:39 PM
что значит NOT IN (0,1,2,3)');?

Мне нужно не брать из категорий 0 и 7, а брать из 1,2,3,4,5,6.

ps V@no, СПАСИБО! Thanx, +1  :)
Title: Re: [MOD] Google Sitemap for your gallery
Post by: V@no on January 22, 2009, 04:47:27 PM
это был пример. меняете числа на ID категорий, которые хотите исключить из списка. (1,7) = исключить две категории: категорию с ID 7 и с ID 1

P.S.
в 4images не возможно иметь категорию с ID 0
Title: Re: [MOD] Google Sitemap for your gallery
Post by: kandr on January 22, 2009, 04:58:17 PM
Ясно, понял. Как поступить с категориями? Также?

Code: [Select]
$categories = mysql_query('SELECT cat_id, cat_name FROM ' . $table_prefix . 'categories' WHERE cat_id NOT IN (0,1,2,3)');
Еще возвращаясь к карте сайта, возможно ли там добавить к выводу не только категории, но и все картинки?

PS. У меня категория 0 есть, это мод, который делали на заказ отдельно. Он выводит к основной картинке дополнительные, которые появляются рядом, и дают увеличенный вид вместо основной без перезагрузки страницы. Так вот все эти картинки привязаны к 0 категории и к имени основной картинки. Из за этого яша дал кучу ошибок на на не существующие страницы, и выкинул из поиска....

если вам понадобится этот мод могу вам выслать  :wink:
Title: Re: [MOD] Google Sitemap for your gallery
Post by: awall on March 28, 2009, 03:05:46 PM
Need help on google sitemaps,
can't get it work on details page
my url is like this  http://www.arcadewall.net/play_driving_2_gamename_22.html (http://www.arcadewall.net/play_driving_2_gamename_22.html)

so would need to change in google.php something to get url like this so I would need to get mysql query from categories and image tables

play_Categoryname_CategoryID_Gamename_GameID.html

but don't know how to get it working

Awall

http://www.arcadewall.net (http://www.arcadewall.net)
Title: Re: [MOD] Google Sitemap for your gallery
Post by: leblover on April 21, 2009, 02:14:08 PM
hello there


im having this error from google

Code: [Select]
Sitemap file size error
Your Sitemap exceeds the maximum file size limit. Please create multiple Sitemaps containing fewer URLs to meet the file size limit. Help Help
Title: Re: [MOD] Google Sitemap for your gallery
Post by: Nicky on April 21, 2009, 06:45:25 PM
hi leblover,
62000 links is a big deal in one file, btw for you server too...

split you google.php into example
google.php and google2.php
edit mysql queries in google.php to list as example the 1st 20000 entries
and in google2.php the rest of them

add:
Code: [Select]
RewriteRule ^sitemap2.xml$ google2.phpinto .htaccess

tell google to visit the sitemap2.xml

voilla :)
Title: Re: [MOD] Google Sitemap for your gallery
Post by: didoman on April 27, 2009, 11:02:38 AM
This works great. Thank you to all the smart people on this forum.
One question...

Currently the only pages being mapped are:
categories.php?cat_id=
details.php?image_id=
member.php?action=showprofile&user_id=

Is it possible to include other pages that are not in the database.
Eg. I have created extra pages like about.html etc... and their hyperlinks are written http://www.example.com/index.php?template=about

Id like these adhoc pages to be mapped also. Is this feasible.
Thanks in advance.
Rob








Title: Re: [MOD] Google Sitemap for your gallery
Post by: leblover on April 27, 2009, 11:05:39 AM
thx alote but how to make that 20000 in the google.php ?


thats my code

i cant find it ?
 pls

 :oops:

Code: [Select]
<?
# Create Google Sitemap for 4images
# Created by Mai Minh (minh@maingo.com http://www.vna2z.com)
# Date: 28/11/2006
# You can send ping to Google with this request: http://www.google.com/webmasters/sitemaps/ping?sitemap=URL_TO_YOUR_SITEMAP
#---------------------------------

require("config.php");

# 4images top page (with trailing slash)
$gallery_url = 'http://www.leblover.com/gallery/';

$link=mysql_connect("$db_host","$db_user","$db_password");
mysql_select_db("$db_name") or die ("Cannot connect database!");

# Priotity
$prio_img = 0.3;
$prio_cat = 0.8;

# Frequency
$freq_img = 'yearly';
$freq_cat = 'daily';

# Print XML header
xml_head();

# Print URLs
$categories = mysql_query('SELECT cat_id FROM ' . $table_prefix . 'categories');
while ($category = mysql_fetch_array($categories))
{
        $catid = $category['cat_id'];
        $cat_url = $gallery_url.'cat'.$catid.'.htm';
        print_xml($cat_url,$prio_cat,'',$freq_cat);
}

$images = mysql_query('SELECT image_id,image_active,image_date FROM ' . $table_prefix . 'images');
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";
                $img_url = $gallery_url.'img'.$imgid.'.htm';
                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 version='1.0' encoding='UTF-8'?>
<urlset xmlns=\"http://www.google.com/schemas/sitemap/0.84\"
xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"
xsi:schemaLocation=\"http://www.google.com/schemas/sitemap/0.84 http://www.google.com/schemas/sitemap/0.84/sitemap.xsd\">
<url>
  <loc>http://www.leblover.com/gallery</loc>
  <lastmod>$mod</lastmod>
  <changefreq>$freq</changefreq>
  <priority>$priority</priority>
</url>";
}

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

#-----------------------------------------------
# print_xml
#-----------------------------------------------
function print_xml($url,$priority,$lastmod,$changefreq) {
        echo "
<url>
  <loc>$url</loc>
  <priority>$priority</priority>
  <lastmod>$lastmod</lastmod>
  <changefreq>$changefreq</changefreq>
</url>";
}
?>
Title: Re: [MOD] Google Sitemap for your gallery
Post by: Nicky on April 27, 2009, 11:59:22 PM
hi,

google.php
Code: [Select]
$images = mysql_query('SELECT image_id,image_name,image_active,image_date FROM ' . $table_prefix . 'images ORDER by image_id ASC limit 0,20000');
google2.php
Code: [Select]
$images = mysql_query('SELECT image_id,image_name,image_active,image_date FROM ' . $table_prefix . 'images ORDER by image_id ASC limit 20000,20000');
in google2.php
remove
Code: [Select]
$categories = mysql_query('SELECT cat_id FROM ' . $table_prefix . 'categories');
while ($category = mysql_fetch_array($categories))
{
        $catid = $category['cat_id'];
        $cat_url = $gallery_url.'cat'.$catid.'.htm';
        print_xml($cat_url,$prio_cat,'',$freq_cat);
}

there is no need to add categories again
Title: Re: [MOD] Google Sitemap for your gallery
Post by: AntiNSA2 on May 15, 2009, 09:40:29 AM
Greetings...

Ok I have seen the code on the first pages to add to this mod if you are using short URL mod....

And I iknow there are two popular SEO mods here.

I am using the http://www.4homepages.de/forum/index.php?topic=17598.0 [MOD] Google Friendly Urls For 4images Best Seo Mod

Whish is not the short URL mod.

When I install the file of this mod I get this result when going to the google.php file
Code: [Select]
0.3  2008-12-03T00:00:00+00:00  yearly  http://thelifephotography.com/img15.htm 
But I think this is wrong.. shouldnt it list the image and cat names?

And I want them to come daily I guess... The more the better. Is there any bad reason to not want google to come daily?

the Best Seo Mod works great... can you tell me what to do to get these to work together?

And whats the best way to9 get the IPTC keyword data stored in the database indexed by google? Thanks!

Title: Re: [MOD] Google Sitemap for your gallery
Post by: AntiNSA2 on May 15, 2009, 02:42:51 PM
Ok, with short url mod turned on I am getting results like this:

Code: [Select]
http://thelifephotography.com/img69.htm 0.5 2009-01-17T00:00:00+00:00 daily   http://thelifephotography.com/img70.htm 0.5 2009-01-17T00:00:00+00:00 daily   http://thelifephotography.com/img71.htm 0.5

IS this how it should look? Shouldnt it say the image name in the address instead of  img71.htm ?? Imm am not  sure how to kknow if it is working or not....
Title: Re: [MOD] Google Sitemap for your gallery
Post by: Nicky on May 15, 2009, 04:39:18 PM
hi AntiNSA2,

this is because google.php is using [Mod] Search Engine Friendly URLs aka Short URLs (http://www.4homepages.de/forum/index.php?topic=6729.0)

here are changes which i did for [MOD] Google Friendly Urls For 4images Best Seo Mod (http://www.4homepages.de/forum/index.php?topic=17598.0)

replace

Code: [Select]
# Print URLs
$categories = mysql_query('SELECT cat_id FROM ' . $table_prefix . 'categories');
while ($category = mysql_fetch_array($categories))
{
$catid = $category['cat_id'];
$cat_url = $gallery_url.'cat'.$catid.'.htm';
print_xml($cat_url,$prio_cat,'',$freq_cat);
}

$images = mysql_query('SELECT image_id,image_active,image_date FROM ' . $table_prefix . 'images');
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";
$img_url = $gallery_url.'img'.$imgid.'.htm';
print_xml($img_url,$prio_img,$date,$freq_img);
}
}

with

Code: [Select]
# 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'], "éèêàëâúóíáABCDEFGHIJKLMNOPQRSTUVWXYZ","eeeaeauoiaabcdefghijklmnopqrstuvwxyz");
if ($shortURL == 1) {
$cat_url = $gallery_url.'cat-'.$catname.'-'.$catid.'.html';
}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'], "éèêàëâúóíáABCDEFGHIJKLMNOPQRSTUVWXYZ","eeeaeauoiaabcdefghijklmnopqrstuvwxyz");
$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.'.html';
}else{
$img_url = $gallery_url.'details.php?image_id='.$imgid;
}
print_xml($img_url,$prio_img,$lastmod,$freq_img);
}
}


in my original google.php i added more replacement chars
Title: Re: [MOD] Google Sitemap for your gallery
Post by: AntiNSA2 on May 15, 2009, 06:10:18 PM
Hey Thanks! I think that it is working now... jsut submitted to google will wait to see what happens... il report back to see if there were no errors....

Thanks
Title: Re: [MOD] Google Sitemap for your gallery
Post by: Nicky on May 15, 2009, 06:11:44 PM
you should try it before you are submitting non working urls ;)

eg
Code: [Select]
http://thelifephotography.com/img-the chinese lower class struggle for work daily as global economic crises widens as unemployment increases,and income gap widens-11.html
Code: [Select]
http://thelifephotography.com/cat-news updates-10.html
therefore i wrote that i have more then default replacement chars

Title: Re: [MOD] Google Sitemap for your gallery
Post by: AntiNSA2 on May 16, 2009, 07:03:42 AM
I really was trying to avoid submitting it with errors and it seems I am to late....

I am using this google.php
Code: [Select]
<?
# 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 = 'http://thelifephotography.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.3;

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

# 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'], "éèêàëâúóíáABCDEFGHIJKLMNOPQRSTUVWXYZ","eeeaeauoiaabcdefghijklmnopqrstuvwxyz");
if ($shortURL == 1) {
$cat_url = $gallery_url.'cat-'.$catname.'-'.$catid.'.html';
}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'], "éèêàëâúóíáABCDEFGHIJKLMNOPQRSTUVWXYZ","eeeaeauoiaabcdefghijklmnopqrstuvwxyz");
$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.'.html';
}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'];
$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.google.com/schemas/sitemap/0.84\"
xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"
xsi:schemaLocation=\"http://www.google.com/schemas/sitemap/0.84 http://www.google.com/schemas/sitemap/0.84/sitemap.xsd\">";
}

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

#-----------------------------------------------
# print_xml
#-----------------------------------------------
function print_xml($url,$priority,$lastmod,$changefreq) {
$temp = "<url>
<loc>$url</loc>";
$temp .= "  <priority>$priority</priority>";
if ($lastmod != '') {
$temp .="  <lastmod>$lastmod</lastmod>";
}
$temp .= "  <changefreq>$changefreq</changefreq>
</url>";
echo $temp;
}
?>
I understand I guess that I need to add characters to mine? To tell you the truth I am not wuite sure how the site map should work... should it display an exact url to each image/page?  I am guessing this is so...


Im not sure how to add special characters or even how to add any characters. If you are using the same mod can I  ask you to post your google.php?

Here is the only message I could get from google about the errors
Code: [Select]
83 Parsing error
We were unable to read your Sitemap. It may contain an entry we are unable to recognize. Please validate your Sitemap before resubmitting. Help Help
Problem detected on: May 15, 2009


I noticed some strange characters on my google.php file when viewed @ www.thelifephotography.com/google.php which look like this
Code: [Select]
s�

I am guessing this is also something to do with the characters that need to be added?

 I really am hoping to get a ton of hits from google, as each of my images are so heavily keyworded ... I am struggling to try to sell stock photography ...

Because it indexed the sitemap I have now and reported errors, how long before it re-indexes? I hope it doesnt kill the status of seach listing.
Title: Re: [MOD] Google Sitemap for your gallery
Post by: Nicky on May 16, 2009, 08:16:11 AM
hi,

try to use chars replacement which you are using in includes/sessions.php

my
Code: [Select]
$catname = strtr($category['cat_name'], "éèêàëâúóíáABCDEFGHIJKLMNOPQRSTUVWXYZ","eeeaeauoiaabcdefghijklmnopqrstuvwxyz");
$imgname = strtr($image['image_name'], "éèêàëâúóíáABCDEFGHIJKLMNOPQRSTUVWXYZ","eeeaeauoiaabcdefghijklmnopqrstuvwxyz");
was only an example.

you have to remove all special chars, which google can't read from your sitemap
Title: Re: [MOD] Google Sitemap for your gallery
Post by: AntiNSA2 on May 16, 2009, 02:58:03 PM
Code: [Select]
OK Im sorry , I am trying to understand what you mean... I looked in sessions and see this [code]
$row['cat_name'] = strtr($row['cat_name'], "éèêàëâúóíì àáABCDEFGHIJKLMNOPQRSTUVWXYZ","eeeaeauoiaabcdefghijklmnopqrstuvwxyz");
and this
Code: [Select]
$row['image_name'] = strtr($row['image_name'], "éèêàëâúóì íáàABCDEFGHIJKLMNOPQRSTUVWXYZ","eeeaeauoiaabcdefghijklmnopqrstuvwxyz");
I have these two characters which I think caused a problem with google
Code: [Select]
àì

So I need to add these to the google site map? I added them to both session and google.php... But I dont underastand  why I see the eeeaea and other repeated letters which are all vowels.. I mean we cant take them out or the english is destroyed.. And google can read them.

I am confused. On my sitemap I am seeing urls like this
Code: [Select]
  http://thelifephotography.com/img-csian boy sitting in front of grandparents house locked out while grandma plays mahjong eanton iuangzhou iuandong csia-194.html

Which is strange... letters are missing and filled with random letters meaning jibberish .. The actual address is this
Code: [Select]
http://thelifephotography.com/img-dsianaboyasittingainafrontaofagrandparentsahousealockedaoutawhileagrandmaaplaysamahjongafantonajuangzhouajuandongadsia-195.htm

Im sorry if I m missing something so obvious... I am trying to figure out this is a really important mod ...... If you can  offer any more help I really appreciate it.

Thanks
Robert                                                                                         

[/code]
Title: Re: [MOD] Google Sitemap for your gallery
Post by: AntiNSA2 on May 22, 2009, 07:06:59 AM
ok things I thought were ok with sitemap are now producing a different problem...

Google is looking for this:

http://thelifephotography.com/cat-show%20me%20the%20money-7.html

even though my sitemap says this at www.thelifephotography.com/googlex.php :
http://thelifephotography.com/cat-show_me_the_money-7.htm

so I am guessing google and not accept underscore _ as a character in an address. My questin is what to replace the underscore with to make replace a <space> in an address in the special characters?

ANd why is google looking for html files even though my sitemap says to look for htm files? :?

Ok, I got it working...
with this:
Code: [Select]
  $imgname = strtr($image['image_name'], ", éèêàëâúóíìáàABCDEFGHIJKLMNOPQRSTUVWXYZ","--eeeaeauoiiaaabcdefghijklmnopqrstuvwxyz");


and this for cats
Code: [Select]
  $imgname = strtr($image['image_name'], ", éèêàëâúóíìáàABCDEFGHIJKLMNOPQRSTUVWXYZ","--eeeaeauoiiaaabcdefghijklmnopqrstuvwxyz");
Code: [Select]
$img_url = $gallery_url.'img-'.$imgname.'-'.$imgid.'.html';
and this
Code: [Select]
$cat_url = $gallery_url.'cat-'.$catname.'-'.$catid.'.html';
The I replaced <spaces> with - and .htm with html....


But I have just came to a cold hard realization...

Somehow rewrite is not working...

I have placed my .htaccess @
Code: [Select]
/htdocs/.htaccesswhich is the same directory as 4images.

it looks like this
Code: [Select]
RewriteEngine On
RewriteRule ^sitemap.xml$ googlez.php
#RewriteBase /
RewriteRule ^cat-(.*)-([0-9]+)\.htm$ categories.php?cat_id=$2&%{QUERY_STRING}
RewriteRule ^cat\.htm$ categories.php?%{QUERY_STRING}
#Mod_bmollet : Image name in URL
RewriteRule ^img-(.*)-([0-9]+)\.htm$ details.php?image_id=$2&%{QUERY_STRING}
RewriteRule ^img([0-9]+)\.search.htm$ details.php?image_id=$1&%{QUERY_STRING}
RewriteRule ^img([0-9]+)\.lightbox.htm$ details.php?image_id=$1&%{QUERY_STRING}
RewriteRule ^sitemap.xml$ googlez.php
#Mod_bmollet : This is to make search function work  ( redirect links from search results )
RewriteRule ^search\.htm$ search.php?%{QUERY_STRING}
RewriteRule ^search\.([0-9]+)\.htm$ search.php?page=$1&%{QUERY_STRING}
RewriteRule ^lightbox\.htm$ lightbox.php?%{QUERY_STRING}
RewriteRule ^lightbox\.([0-9]+)\.htm$ lightbox.php?page=$1&%{QUERY_STRING}
RewriteRule ^sitemap.xml$ googlez.php

I know i did this three times.... Becuse 1 time didnt work.
my googlez.php creates the xml and looks like this:
Code: [Select]
<?
# 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 = 'http://thelifephotography.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 = 'daily';

# 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'], " éèêàëâúóíìáàABCDEFGHIJKLMNOPQRSTUVWXYZ","_eeeaeauoiiaaabcdefghijklmnopqrstuvwxyz");
if ($shortURL == 1) {
$cat_url = $gallery_url.'cat-'.$catname.'-'.$catid.'.html';
}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'], ", éèêàëâúóíìáàABCDEFGHIJKLMNOPQRSTUVWXYZ","--eeeaeauoiiaaabcdefghijklmnopqrstuvwxyz");
$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.'.html';
}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'];
$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.google.com/schemas/sitemap/0.84\"
xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"
xsi:schemaLocation=\"http://www.google.com/schemas/sitemap/0.84 http://www.google.com/schemas/sitemap/0.84/sitemap.xsd\">";
}

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

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

Things are getting indexed like this
Code: [Select]
  http://thelifephotography.com/img-the-chinese-lower-class-struggle-for-work-daily-as-global-economic-crises-widens-as-unemployment-increopeases--23.html which I hope will prevent the %20 stuff...

But the problem is when you go to my site the actual url is still
Code: [Select]
http://thelifephotography.com/img-these_workers_too_but_on_a_smile_for_the_camera..._people_like_them_who_are_at_the_greatest_immediate_risk_if_you_come_early_all-142.htm Is there supposed to be some kind of rewrite to reversly convert all addresses to match the characters replaced in the character map?


THanks for any help.

OK!!!!! I found out why!!!

God I dont know why it takes my brain so long to work!!!!

If you are using the Google BEST SEO mod you  must edit your sessions.php to make the special characthers match the special characters in your google.php file!!!!!

Title: Re: [MOD] Google Sitemap for your gallery
Post by: yousaf on May 28, 2009, 12:11:46 PM
as you have changed .htm to .html in your google.php now repeat it in your site's .htaccess file as well.
Title: Re: [MOD] Google Sitemap for your gallery
Post by: AntiNSA2 on June 04, 2009, 07:17:47 AM
I have received negative comments on google webmaster forums about my site map date, with no explanation:
Quote
This is the third site this morning where I've seen EXACTLY the same thing and the second even using the same date:

<url>
   <loc>http://thelifephotography.com/img-millions-of-chinese-migrant-workers-traveling-home-for-holiday-893.htm</loc>
  <priority>0.5</priority>
  <lastmod>2008-09-29T00:00:00+00:00</lastmod>
  <changefreq>daily</changefreq>
</url>


I'm starting to wonder whether Google is now actually penalising these garbage sitemaps.

Can anyone explain what might be wrong for this man to call my sitemap garbage????
                                        
Title: Re: [MOD] Google Sitemap for your gallery
Post by: yousaf on June 11, 2009, 04:39:33 PM
same for me here, :(
Google does not accept my sitemap.xml

my site map link:  sitemap (http://www.wallpaperowner.com/sitemap.xml)

this is what i am seeing(the message in the attached snapshot) since the day i added it to my site,
no matter how many times i re-edit the files so that if i missed or typed something wrong could become ok
but they are not accepting it.

anyone here, who used it and is valid/verified in Google's point of View?


in Firefox browser it works but when it comes to internet Explorer it shows the following error

Quote
The XML page cannot be displayed
Cannot view XML input using XSL style sheet. Please correct the error and then click the Refresh button, or try again later.


--------------------------------------------------------------------------------

A name was started with an invalid character. Error processing resource 'http://www.wallpaperowner.com/sitemap.xml'. Line ...

 <loc>http://www.wallpaperowner.com/category-animals-&-pets-wallpapers-3.html</loc>  <priority>0.8<...
Title: Re: [MOD] Google Sitemap for your gallery
Post by: AntiNSA2 on June 11, 2009, 06:59:31 PM
makesure you are pointing google to google.php file, not sitemap.xml......

Still waiting for a solution to the question of why does google forum call my sitemap garbage?
Code: [Select]
This is the third site this morning where I've seen EXACTLY the same thing and the second even using the same date:

<url>
   <loc>http://thelifephotography.com/img-millions-of-chinese-migrant-workers-traveling-home-for-holiday-893.htm</loc>
  <priority>0.5</priority>
  <lastmod>2008-09-29T00:00:00+00:00</lastmod>
  <changefreq>daily</changefreq>
</url>


I'm starting to wonder whether Google is now actually penalising these garbage sitemaps.

I thus far can not get google to index one single page from my 4images site :( : (
Title: Re: [MOD] Google Sitemap for your gallery
Post by: alex9193 on June 13, 2009, 04:24:00 PM
How to show correctly URLs with multilanguage mod?

Code: [Select]
http://www.mysite.com/cat-[english]gallery 3[deutsch]galerie 3[russian]Галерея 3.htm
Title: Re: [MOD] Google Sitemap for your gallery
Post by: AntiNSA2 on June 13, 2009, 05:50:30 PM
Im using the same mod, an I have to do no special changes. I can tell you I had to block robots from visiting the different languages in order to avoid duplicate content errors. First I tried robots text, now I am trying treat robots as users mod....
Title: Google Webmaster Tools : Sitemap file is too big !
Post by: satine88 on July 01, 2009, 10:00:57 PM
Hello,
When I add the sitemap in google webmaster tools, I get an error:

"sitemap file is too big"

Can you help me?

Thank you:)
Title: Re: Google Webmaster Tools : Sitemap file is too big !
Post by: Nicky on July 01, 2009, 10:18:58 PM
if you are using [MOD] Google Sitemap for your gallery
than check this post : http://www.4homepages.de/forum/index.php?topic=15687.msg134966#msg134966
and then this one: http://www.4homepages.de/forum/index.php?topic=15687.msg135185#msg135185
Title: Re: Google Webmaster Tools : Sitemap file is too big !
Post by: satine88 on July 01, 2009, 11:40:15 PM
Ok, thanks :)

But, I will create 4 files (google, google2, google3, google4), how in the code?

Code: [Select]
$images = mysql_query('SELECT image_id,image_name,image_active,image_date FROM ' . $table_prefix . 'images ORDER by image_id ASC limit 20000,[b]20000[/b]');
I do like this:

google3 : limit 20000,40000')
google 4 : limit 40000,60000')
google 5 ! limit 60000,80000')  :?: :?:
Title: Re: Google Webmaster Tools : Sitemap file is too big !
Post by: Nicky on July 03, 2009, 09:29:28 AM
hi satine88,

no :)

correct way:

google.php
Code: [Select]
$images = mysql_query('SELECT image_id,image_name,image_active,image_date FROM ' . $table_prefix . 'images ORDER by image_id ASC limit 0,20000');
google1.php
Code: [Select]
$images = mysql_query('SELECT image_id,image_name,image_active,image_date FROM ' . $table_prefix . 'images ORDER by image_id ASC limit 20000,20000');
google2.php
Code: [Select]
$images = mysql_query('SELECT image_id,image_name,image_active,image_date FROM ' . $table_prefix . 'images ORDER by image_id ASC limit 40000,20000');
google3.php
Code: [Select]
$images = mysql_query('SELECT image_id,image_name,image_active,image_date FROM ' . $table_prefix . 'images ORDER by image_id ASC limit 60000,20000');
google4.php
Code: [Select]
$images = mysql_query('SELECT image_id,image_name,image_active,image_date FROM ' . $table_prefix . 'images ORDER by image_id ASC limit 80000,20000');
google5.php
Code: [Select]
$images = mysql_query('SELECT image_id,image_name,image_active,image_date FROM ' . $table_prefix . 'images ORDER by image_id ASC limit 100000,20000');
and so on...
Title: Re: [MOD] Google Sitemap for your gallery
Post by: satine88 on July 03, 2009, 09:49:55 AM
Thanks Nicky :)

Is there a way of knowing the number of sitemap that you have to create?
Title: Re: [MOD] Google Sitemap for your gallery
Post by: bergblume on July 04, 2009, 02:58:38 PM
hi AntiNSA2,

this is because google.php is using [Mod] Search Engine Friendly URLs aka Short URLs (http://www.4homepages.de/forum/index.php?topic=6729.0)

here are changes which i did for [MOD] Google Friendly Urls For 4images Best Seo Mod (http://www.4homepages.de/forum/index.php?topic=17598.0)

replace

Code: [Select]
# Print URLs
$categories = mysql_query('SELECT cat_id FROM ' . $table_prefix . 'categories');
while ($category = mysql_fetch_array($categories))
{
$catid = $category['cat_id'];
$cat_url = $gallery_url.'cat'.$catid.'.htm';
print_xml($cat_url,$prio_cat,'',$freq_cat);
}

$images = mysql_query('SELECT image_id,image_active,image_date FROM ' . $table_prefix . 'images');
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";
$img_url = $gallery_url.'img'.$imgid.'.htm';
print_xml($img_url,$prio_img,$date,$freq_img);
}
}

with

Code: [Select]
# 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'], "éèêàëâúóíáABCDEFGHIJKLMNOPQRSTUVWXYZ","eeeaeauoiaabcdefghijklmnopqrstuvwxyz");
if ($shortURL == 1) {
$cat_url = $gallery_url.'cat-'.$catname.'-'.$catid.'.html';
}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'], "éèêàëâúóíáABCDEFGHIJKLMNOPQRSTUVWXYZ","eeeaeauoiaabcdefghijklmnopqrstuvwxyz");
$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.'.html';
}else{
$img_url = $gallery_url.'details.php?image_id='.$imgid;
}
print_xml($img_url,$prio_img,$lastmod,$freq_img);
}
}


in my original google.php i added more replacement chars


hi nicky,

I followed your advices - as I also use the [MOD] Google Friendly Urls For 4images Best Seo Mod
but when I look at my sitemap.xml I see
./details.php?image_id=356 instead of ./img-bildnahme-356.htm

what changes have you done moreover?? what have you placed in your .htaccess?

thanx, bergblume
Title: Re: [MOD] Google Sitemap for your gallery
Post by: Nicky on July 04, 2009, 04:55:57 PM
hi bergblume,

set in google.php

Code: [Select]
# Use Short URLs
$shortURL = 0; // 0 or 1

to

Code: [Select]
# Use Short URLs
$shortURL = 1; // 0 or 1

Title: Re: [MOD] Google Sitemap for your gallery
Post by: bergblume on July 08, 2009, 10:46:41 AM
I adapted for those who use the [Mod] Search Engine Friendly URLs aka Short URLs (http://www.4homepages.de/forum/index.php?topic=6729.0).
I hope it will be useful for someone.

finally I got it work with your file as I also use the [Mod] Search Engine Friendly URLs aka Short URLs

Thank you very much, fbmd!!!

P.S. it would be nice if an administrator could put the working file of fbmd in attachemnt for those guys who are using  [Mod] Search Engine Friendly URLs aka Short URLs in the first post of this thread! thanx!
Title: Re: [MOD] Google Sitemap for your gallery
Post by: Nicky on July 08, 2009, 01:42:11 PM
Thanks Nicky :)

Is there a way of knowing the number of sitemap that you have to create?

hi satine,

depence how much images(X) you have.

X / 20000 = Y  :mrgreen:
Title: Re: [MOD] Google Sitemap for your gallery
Post by: Sebas Bonito on August 14, 2009, 01:49:58 AM
2 Questions:
1. How to exclude the profile links? For my site only registered users have the possibility to see the profile, so it's nonsense to inform a search-engine about this.
2. In my XML-sitemap around 1700 urls are listened, but after a month google has only indexed around 250 urls. What about the others? Where is the problem? There exist no technically problem on my site or at the sitemap.
Title: Re: [MOD] Google Sitemap for your gallery
Post by: Moinsen on August 21, 2009, 04:17:48 PM
Damit die Sitemap auch die deutschen Umlaute verstehen kann, wenn die MOD Google Friendly Urls For 4images Best Seo Mod genutzt wird, folgenden Quelltext in der google.php abändern:

Suche
Code: [Select]
$imgna = $image['image_name'] = strtr($image['image_name'], "éèêàëâúóíáABCDEFGHIJKLMNOPQRSTUVWXYZsSiIÝIÇçGgýþÞðÐ","eeeaeauoiaabcdefghijklmnopqrstuvwxyzssiiiiccggissgg");
Ersetze mit
Code: [Select]
$image['image_name'] = $image['image_name'] = strtr($image['image_name'], "éèêàëâúóíáABCDEFGHIJKLMNOPQRSTUVWXYZsSiIÝIÇçGgýþÞðÐ","eeeaeauoiaabcdefghijklmnopqrstuvwxyzssiiiiccggissgg");
$imgna = strtr($image['image_name'],Array("ä"=>"ae","ö"=>"oe","ü"=>"ue", "Ä"=>"Ae","Ö"=>"Oe","Ü"=>"Ue"));
Title: Re: [MOD] Google Sitemap for your gallery
Post by: Sebas Bonito on August 21, 2009, 04:22:11 PM
Bei mir enthalten die Links keine Umlaute, wieso die Änderung?  :?
Title: Re: [MOD] Google Sitemap for your gallery
Post by: Moinsen on August 22, 2009, 02:31:57 PM
Steht alles im obigen Beitrag.
Title: Re: [MOD] Google Sitemap for your gallery
Post by: didoman on September 13, 2009, 10:32:16 PM

Currently the only pages being mapped are:
categories.php?cat_id=
details.php?image_id=
member.php?action=showprofile&user_id=

Is it possible to include other pages that are not in the database.
Eg. I have created extra pages like about.html etc... and their hyperlinks are written http://www.example.com/index.php?template=about

Id like these adhoc pages to be mapped also. Is this feasible.
Thanks in advance.
Rob


Anyone have an answer to my original question?
thanks
Title: Re: [MOD] Google Sitemap for your gallery
Post by: ahsancharming on September 30, 2009, 03:18:22 AM
iam totally confuesed?  :? :?

1) may i know whats the limit of urls in one single google. php page?

2) and how to create two different google1. php n google2. php pages with different friendly urls in it of the site?
google2. php will show the same urls which showed on google1. php?

3) can we add sitemap. xml and sitemap2. xml ? will google accepts both?
Title: Re: [MOD] Google Sitemap for your gallery
Post by: Nicky on October 01, 2009, 08:38:25 PM
so..

1.)
as i know., google accept 50000 entries per sitemap

2.)
yes you can:
example with 20000 urls (for to don't stress your server if you have tousends of pictures)

create google.php
change original
Code: [Select]
$images = mysql_query('SELECT image_id,image_active,image_date FROM ' . $table_prefix . 'images');query for images
to
Code: [Select]
$images = mysql_query('SELECT image_id,image_name,image_active,image_date FROM ' . $table_prefix . 'images ORDER by image_id ASC limit 0,20000');entry for .htaccess
Code: [Select]
RewriteRule ^sitemap.xml$ google.phpcall for google:
Code: [Select]
http://www.google.com/webmasters/sitemaps/ping?sitemap=http://yourdomain_com/gallery/sitemap.xml
create google2.php
change original
Code: [Select]
$images = mysql_query('SELECT image_id,image_active,image_date FROM ' . $table_prefix . 'images');query for images
to
Code: [Select]
$images = mysql_query('SELECT image_id,image_name,image_active,image_date FROM ' . $table_prefix . 'images ORDER by image_id ASC limit 20000,20000');entry for .htaccess
Code: [Select]
RewriteRule ^sitemap2.xml$ google2.phpcall for google:
Code: [Select]
http://www.google.com/webmasters/sitemaps/ping?sitemap=http://yourdomain_com/gallery/sitemap2.xml
create google3.php
change original
Code: [Select]
$images = mysql_query('SELECT image_id,image_active,image_date FROM ' . $table_prefix . 'images');query for images
to
Code: [Select]
$images = mysql_query('SELECT image_id,image_name,image_active,image_date FROM ' . $table_prefix . 'images ORDER by image_id ASC limit 40000,20000');entry for .htaccess
Code: [Select]
RewriteRule ^sitemap3.xml$ google3.phpcall for google:
Code: [Select]
http://www.google.com/webmasters/sitemaps/ping?sitemap=http://yourdomain_com/gallery/sitemap3.xml
if you need more, create more... :)


3.) yes and yes

have phun
Title: Re: [MOD] Google Sitemap for your gallery
Post by: ahsancharming on October 02, 2009, 08:24:06 AM
here r the url for my 4images gallery http://www.wallpaperspecial.com/wallzz/

1) well should i add sitemap.xml on public_html or public_html/wallzz?

2) is it ok? i've this in my .htaccess

Code: [Select]
RewriteRule ^sitemap.xml$ /wallzz/google.php

http://www.google.com/webmasters/sitemaps/ping?sitemap=http://wallpaperspecial.com/sitemap.xml

3) i've google.php in my 4imges folder which is (wallzz) is it ok?
Title: Re: [MOD] Google Sitemap for your gallery
Post by: ahsancharming on October 03, 2009, 11:55:22 PM
any body here? i want YOUr help badly..
Title: Re: [MOD] Google Sitemap for your gallery
Post by: V@no on October 04, 2009, 12:25:34 AM
1)
Code: [Select]
http://www.google.com/webmasters/sitemaps/ping?sitemap=http://wallpaperspecial.com/sitemap.xmlshould not be in .htaccess

2) where is your .htaccess located? public_html or public_html/wallzz?

3) maybe try
Code: [Select]
RewriteRule ^sitemap.xml$ wallzz/google.php
4) http://wallpaperspecial.com/sitemap.xml returns:
Code: [Select]
</head><!-- ValueClick Media 300x250 Medium Rectangle CODE for wallpaperspecial.com -->
<script language="javascript" src="http://media.fastclick.net/w/get.media?sid=19948&m=6&tp=8&d=j&t=s"></script>
<noscript><a href="http://media.fastclick.net/w/click.here?sid=19948&m=6&c=1" target="_top">
<img src="http://media.fastclick.net/w/get.media?sid=19948&m=6&tp=8&d=s&c=1"
width=300 height=250 border=1></a></noscript>
<!-- ValueClick Media 300x250 Medium Rectangle CODE for wallpaperspecial.com -->

<body topmargin="0" leftmargin="0" rightmargin="0" bottommargin="0" marginwidth="0" marginheight="0">
Why?
Title: Re: [MOD] Google Sitemap for your gallery
Post by: ahsancharming on October 04, 2009, 04:00:23 PM
1)
Code: [Select]
http://www.google.com/webmasters/sitemaps/ping?sitemap=http://wallpaperspecial.com/sitemap.xmlshould not be in .htaccess

2) where is your .htaccess located? public_html or public_html/wallzz?

3) maybe try
Code: [Select]
RewriteRule ^sitemap.xml$ wallzz/google.php
4) http://wallpaperspecial.com/sitemap.xml returns:
Code: [Select]
</head><!-- ValueClick Media 300x250 Medium Rectangle CODE for wallpaperspecial.com -->
<script language="javascript" src="http://media.fastclick.net/w/get.media?sid=19948&m=6&tp=8&d=j&t=s"></script>
<noscript><a href="http://media.fastclick.net/w/click.here?sid=19948&m=6&c=1" target="_top">
<img src="http://media.fastclick.net/w/get.media?sid=19948&m=6&tp=8&d=s&c=1"
width=300 height=250 border=1></a></noscript>
<!-- ValueClick Media 300x250 Medium Rectangle CODE for wallpaperspecial.com -->

<body topmargin="0" leftmargin="0" rightmargin="0" bottommargin="0" marginwidth="0" marginheight="0">
Why?



1) ok i simply send them a notification from I.E

2) at public_html ..is it fine?

3) Ok i will try? r u not sure abt this?

4) iam fixing it..

5) and y is shows this?????
Code: [Select]
The XML page cannot be displayed

Cannot view XML input using XSL style sheet. Please correct the error and then click the Refresh button, or try again later.


--------------------------------------------------------------------------------

A name was started with an invalid character. Error processing resource 'http://wallpaperspecial.com/sitemap.xml'. Line 28...
Title: Re: [MOD] Google Sitemap for your gallery
Post by: ahsancharming on October 08, 2009, 08:51:05 AM
nobody repling.. is this  forum is useless :(
Title: Re: [MOD] Google Sitemap for your gallery
Post by: V@nо on October 08, 2009, 04:04:51 PM
Well, I can only assume there is something you do wrong, because your sitemap.xml produce garbage - and you said "iam fixing it", yet, nothing changed since then. and your 5) is direct result of 4)
Title: Re: [MOD] Google Sitemap for your gallery
Post by: ahsancharming on October 09, 2009, 01:28:51 PM
now please check it at the end..

http://www.wallpaperspecial.com/wallzz/sitemap.xml
Title: Re: [MOD] Google Sitemap for your gallery
Post by: ahsancharming on October 13, 2009, 09:19:37 AM
still no reply since a week.. please help me out.
Title: Re: [MOD] Google Sitemap for your gallery
Post by: V@no on October 13, 2009, 03:03:18 PM
As far as I can tell Nicky already answered your original question...
Title: Re: [MOD] Google Sitemap for your gallery
Post by: Nicky on October 13, 2009, 10:31:56 PM
ahsancharming,

i still have no idea what is your problem..
...you asked i answered
...you asked V@no answered

which problem do you still have?

what is on the end?
Title: Re: [MOD] Google Sitemap for your gallery
Post by: AKIN on November 11, 2009, 10:17:36 PM
sitemap Search does not include words.
How can we add?
Title: Re: [MOD] Google Sitemap for your gallery
Post by: AKIN on November 13, 2009, 04:23:12 AM
I did some work. I would add the code below. shows only 1 and more not coming. Where do you think I made a mistake


Code: [Select]
<?
# 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=http://www.resimli.net/arama.xml
#---------------------------------

require("config.php");

# 4images top page (with trailing slash)
$gallery_url = 'http://www.resimli.net/';

# Choose the URL format
# 0 is http://www.site.com/cat123.htm
# 1 is http://www.site.com/details.php?image_id=123
# 2 is http://www.site.com/r-category-1-subcategory-2-image-123.htm
$shortURL = 2; // 0 or 1 or 2

# If $shortURL is different of 2, you can delete these three lines below:
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!");

# 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_arama = 1.0;

# Frequency
//"always", "hourly", "daily", "weekly", "monthly", "yearly" or "never"
$freq_arama = 'monthly';

# Print XML header
xml_head();

# Print URLs

$arama = mysql_query('SELECT word_id,word_text FROM 4images_wordlist ORDER by word_id ');
while ($arama = mysql_fetch_array($arama))
{
$aramaid = $arama['word_id'];
$date = $arama['word_id'];
$date = date("Y-m-d",$date)."T".date("H:i:s",$date)."+00:00";
$arama_url = $gallery_url.'search.htm?search_keywords='.$aramaid;

print_xml($arama_url,$prio_arama,$date,$freq_arama);
}

# 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.google.com/schemas/sitemap/0.84\"
xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"
xsi:schemaLocation=\"http://www.google.com/schemas/sitemap/0.84 http://www.google.com/schemas/sitemap/0.84/sitemap.xsd\">";
}

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

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

see code...
www.resimli.net/arama.php
Title: Re: [MOD] Google Sitemap for your gallery
Post by: tramfahrer on January 18, 2010, 08:52:53 PM
Habe da mal eine Frage, Google gibt mir bei diesem Sitemap MOD diese Fehlermeldung raus, der sich denn alle 6 Zeilen später wieder holen soll, also Zeile 14, 20, 26, 32 etc etc ....

 Zeile 14 Ungültiges Datum

Es wurde ein ungültiges Datum gefunden. Berichtigen Sie bitte das Datum bzw. dessen Formatierung, bevor Sie Ihre Daten erneut einreichen.

Übergeordnetes Tag: url
Tag: lastmod
Wert:
Problem ermittelt am: 18.01.2010

vllt hat ja jemand eine Idee

URL zu meiner sitemap www.tram-und-bahnbilder.de/sitemap.xml
Title: Re: [MOD] Google Sitemap for your gallery
Post by: Fragezeichen on April 18, 2010, 09:00:38 PM
Toller Mod,fettes merci.
Einbau funktioniert ohne probleme und läuft sofort.
Wichtig eben nur das die .htacsess erweitert wird sonst gibts keine Xml.
Danach eine Ping an Tante Google senden und staunen wie die Besucher hereinströmen...

TOP TOP !!
 :D
Title: Re: [MOD] Google Sitemap for your gallery
Post by: ttluan on May 08, 2010, 08:47:50 PM
Hi,
I use [MOD] Google Friendly Urls For 4images Best Seo Mod , but I want to display sitemap link for image like this:

http://mydomain.com/cat-catname-1-img-imagename-1.htm but I follow edit code the result is

http://mydomain.com/img-imagename-1.htm

Pls help to change this, Tks
Title: Re: [MOD] Google Sitemap for your gallery
Post by: egyptsons on June 12, 2010, 06:26:15 PM
someone can help me
i have more than 50000 photo
so google reject it

Quote
Too many URLs
Your Sitemap contains too many URLs. Please create multiple Sitemaps with up to 50000 URLs each and submit all Sitemaps.

also there is error like this
    
Quote
Invalid date
An invalid date was found. Please fix the date or formatting before resubmitting.
Title: Re: [MOD] Google Sitemap for your gallery
Post by: Nicky on June 12, 2010, 09:35:14 PM
someone can help me
i have more than 50000 photo
so google reject it

Quote
Too many URLs
Your Sitemap contains too many URLs. Please create multiple Sitemaps with up to 50000 URLs each and submit all Sitemaps.

quick help for to much entries: http://www.4homepages.de/forum/index.php?topic=15687.msg141666#msg141666

tip:
make in your first google.php only categories and profiles

google2.php start with the pictures..
and so on..
Title: Re: [MOD] Google Sitemap for your gallery
Post by: danijelpendjer on June 13, 2010, 03:45:38 PM
Hi,

I need some help. I set up xml site map but it does not work properly.

Can somebody look at that?
Site map is here: xxx: mojefotke. raftingtarom. org. rs/sitemap. xml

Thanks

Danijel
Title: Re: [MOD] Google Sitemap for your gallery
Post by: Nicky on June 13, 2010, 10:12:54 PM
Hi,

I need some help. I set up xml site map but it does not work properly.

Can somebody look at that?
Site map is here: xxx: mojefotke. raftingtarom. org. rs/sitemap. xml

Thanks

Danijel

ћаос Данијел,

измени у google.php датотеци ово
Code: [Select]
$gallery_url = 'http://mojefotke.raftingtarom.org.rs/';па ће све бити ок :)

Title: Re: [MOD] Google Sitemap for your gallery
Post by: danijelpendjer on June 14, 2010, 02:32:43 AM
Hvala Nicky,

Odmah da kažem da nisam očekivao da će mi neko odgovoriti na SRB  :lol:

Nabudžio sam ovo ali ne radi još uvek kako treba. Nemam linkove na sitemap stranici a gogole webmaster tools mi javlja ovo:

Путање се не подударају
Открили смо да сте Sitemap послали помоћу путање URL адресе која садржи префикс „www“ (на пример: http://www.example.com/sitemap.xml). Међутим, URL адресе наведене у вашем Sitemap-у не користе префикс „www“ (на пример: http://example.com/mojadatoteka.htm).

Redirekcije su podešene i nemam www na tom sajtu, tako da mi ovo nema smisla, i kako god da se kuca uvek će da skine www.

Jel imaš ideju zašto mi ne daje linkove na sitemap.xml stranici?

Poz
Title: Re: [MOD] Google Sitemap for your gallery
Post by: Nicky on June 14, 2010, 06:11:18 PM
Odmah da kažem da nisam očekivao da će mi neko odgovoriti na SRB.

Nabudžio sam ovo ali ne radi još uvek kako treba. Nemam linkove na sitemap stranici a gogole webmaster tools mi javlja ovo:

Путање се не подударају
Открили смо да сте Sitemap послали помоћу путање URL адресе која садржи префикс „www“ (на пример: http://www.example.com/sitemap.xml). Међутим, URL адресе наведене у вашем Sitemap-у не користе префикс „www“ (на пример: http://example.com/mojadatoteka.htm).

ћаос опет :)

па има нас срба и овде :)
да ли си у webmaster tools додао суб домену mojefotke.raftingtarom.org.rs?
то бих ти препоручио..

ја видим линкове у http://mojefotke.raftingtarom.org.rs/sitemap.xml

што се тиче www и без www то можеш наместиту исто тамо, али пази на доубле контент.. да те гоогле не би казнио..
одлучи се за један..

срдачан поздрав.
Title: Re: [MOD] Google Sitemap for your gallery
Post by: danijelpendjer on June 15, 2010, 12:44:37 PM
Namestio sam bez www i to nije problem. Takođe sam sajt prijavio i na Google webmasters tools. Sajt je verifikovan ali kad sam prijavio sitemap, WMT mi daje grešku.

Vidim i ja da stoje putanje do stranica sajta na sitemap.xml stranici, ali ja ne vidim da je od njih napravio linkove, a mislim da to moraju da budu linkovi.

Imao sam isti problem sa wordpressom, ali sam to lako sredio, i čim su se napravili linkovi do tih putanja sve je bilo ok.

Čini mi se da sam nešto zeznuo oko koda u onom google.php fajlu.

Evo baš gledam sada kod tebe na http://nicky.net/sitemap.xml i tu postoji tabela sa 4 kolone. U prvoj su linkovi, u drugoj datum poslednje izmene, u trećoj frekvencija promene, i u poslednjoj su priioriteti. Kod mene je sve nešto nabacano i nema linkova.
Title: Re: [MOD] Google Sitemap for your gallery
Post by: Nicky on June 15, 2010, 06:54:39 PM
пошаљи ми твој логин за FTP и за WMT преко приватне поруке погледаћу вечерас.. тј. најкасније сутра пре подне.
Title: Re: [MOD] Google Sitemap for your gallery
Post by: Nosferatu on July 16, 2010, 05:08:11 PM
Hi@all

ich habe ein problem.

ich habe die google.php raufgeladen. und .htaccess datei erstellt

Code: [Select]
<?
# 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 = 'http://www.pj-firepower.com/picgallerie/';

# 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.3;

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

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

# Print XML header
xml_head();

# Print URLs
$categories = mysql_query('SELECT cat_id FROM ' . $table_prefix . 'categories');
while ($category = mysql_fetch_array($categories))
{
$catid = $category['cat_id'];
if ($shortURL == 1) {
$cat_url = $gallery_url.'cat'.$catid.'.htm';
}else {
$cat_url = $gallery_url.'categories.php?cat_id='.$catid;
}

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

$images = mysql_query('SELECT image_id,image_active,image_date FROM ' . $table_prefix . 'images ');
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.'img'.$imgid.'.htm';
}else{
$img_url = $gallery_url.'details.php?image_id='.$imgid;
}
print_xml($img_url,$prio_img,$date,$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'];
$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.google.com/schemas/sitemap/0.84\"
xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"
xsi:schemaLocation=\"http://www.google.com/schemas/sitemap/0.84 http://www.google.com/schemas/sitemap/0.84/sitemap.xsd\">";
}

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

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

so folgendes probleme:
1) auf der google.php , http://www.pj-firepower.com/picgallerie/google.php

werden short urls angezeigt wie ich es auch wollte
http://www.pj-firepower.com/picgallerie/cat1.htm

nur diese links funktionieren nicht..... wenn ich einen der links verwende kommt

Die Webseite wurde nicht gefunden.

Jetzt muss ich dadurch short urls ausschalten, aber ich hätte es gerne an nur warum funktionieren diese links dann nicht .... ist doch sinlos die links zb cat1 zu benommen, und diese kommen dann in google und dann funken die gar nicht :(

kann mir bitte jemand helfen.

vielen Dank

mfg
Nosferatu
Title: Re: [MOD] Google Sitemap for your gallery
Post by: alekseyn1 on October 24, 2010, 06:32:05 PM
For all the Russian users out there - here is the google.php that works on my site

it transliterates the categories and images names to become Google friendly. the transliteration function MUST be exactly identical to the one stored in sessions.php

Code: [Select]
<?
# 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");
//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!");

# 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($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.google.com/schemas/sitemap/0.84\"
xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"
xsi:schemaLocation=\"http://www.google.com/schemas/sitemap/0.84 http://www.google.com/schemas/sitemap/0.84/sitemap.xsd\">";
}

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

#-----------------------------------------------
# print_xml
#-----------------------------------------------
function print_xml($url,$priority,$lastmod,$changefreq) {
$temp = "<url>
<loc>$url</loc>";
$temp .= "  <priority>$priority</priority>";
if ($lastmod != '') {
$temp .="  <lastmod>$lastmod</lastmod>";
}
$temp .= "  <changefreq>$changefreq</changefreq>
</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)
      "&#1040;" => "a",
      "&#1072;" => "a",
      "&#1041;" => "b",
      "&#1073;" => "b",
      "&#1042;" => "v",
      "&#1074;" => "v",
      "&#1043;" => "g",
      "&#1075;" => "g",
      "&#1044;" => "d",
      "&#1076;" => "d",
      "&#1045;" => "e",
      "&#1077;" => "e",
      "&#1025;" => "yo",
      "&#1105;" => "yo",
      "&#1046;" => "zh",
      "&#1078;" => "zh",
      "&#1047;" => "z",
      "&#1079;" => "z",
      "&#1048;" => "i",
      "&#1080;" => "i",
      "&#1049;" => "j",
      "&#1081;" => "j",
      "&#1050;" => "k",
      "&#1082;" => "k",
      "&#1051;" => "l",
      "&#1083;" => "l",
      "&#1052;" => "m",
      "&#1084;" => "m",
      "&#1053;" => "n",
      "&#1085;" => "n",
      "&#1054;" => "o",
      "&#1086;" => "o",
      "&#1055;" => "p",
      "&#1087;" => "p",
      "&#1056;" => "r",
      "&#1088;" => "r",
      "&#1057;" => "s",
      "&#1089;" => "s",
      "&#1058;" => "t",
      "&#1090;" => "t",
      "&#1059;" => "u",
      "&#1091;" => "u",
      "&#1060;" => "f",
      "&#1092;" => "f",
      "&#1061;" => "h",
      "&#1093;" => "h",
      "&#1062;" => "c",
      "&#1094;" => "c",
      "&#1063;" => "ch",
      "&#1095;" => "ch",
      "&#1064;" => "sh",
      "&#1096;" => "sh",
      "&#1065;" => "sch",
      "&#1097;" => "sch",
      "&#1066;" => "",
      "&#1098;" => "",
      "&#1067;" => "i",
      "&#1099;" => "i",
      "&#1068;" => "'",
      "&#1100;" => "'",
      "&#1069;" => "e",
      "&#1101;" => "e",
      "&#1070;" => "yu",
      "&#1102;" => "yu",
      "&#1071;" => "ya",
      "&#1103;" => "ya",
  //russian 1251 encoded alphabet (lower and upper cases)
  "а" => "a",
      "А" => "a",
      "б" => "b",
      "Б" => "b",
      "в" => "v",
      "В" => "v",
      "г" => "g",
      "Г" => "g",
      "д" => "d",
      "Д" => "d",
      "е" => "e",
      "Е" => "e",
      "ё" => "yo",
      "Ё" => "yo",
      "ж" => "zh",
      "Ж" => "zh",
      "з" => "z",
      "З" => "z",
      "и" => "i",
      "И" => "i",
      "й" => "j",
      "Й" => "j",
      "к" => "k",
      "К" => "k",
      "л" => "l",
      "Л" => "l",
      "м" => "m",
      "М" => "m",
      "н" => "n",
      "Н" => "n",
      "о" => "o",
      "О" => "o",
      "п" => "p",
      "П" => "p",
      "р" => "r",
      "Р" => "r",
      "с" => "s",
      "С" => "s",
      "т" => "t",
      "Т" => "t",
      "у" => "u",
      "У" => "u",
      "ф" => "f",
      "Ф" => "f",
      "х" => "h",
      "Х" => "h",
      "ц" => "c",
      "Ц" => "c",
      "ч" => "ch",
      "Ч" => "ch",
      "ш" => "sh",
      "Ш" => "sh",
      "щ" => "sch",
      "Щ" => "sch",
      "ъ" => "",
      "Ъ" => "",
      "ы" => "i",
      "Ы" => "i",
      "ь" => "'",
      "Ь" => "'",
      "э" => "e",
      "Э" => "e",
      "ю" => "yu",
      "Ю" => "yu",
      "я" => "ya",
      "Я" => "ya",
      "/" => "",
  "&" => "-",
  "№" => "",
  "," => "-",
  "°" => "",
  "\"" => "",
  "і" => "i", //ukranian i  
  "ї" => "i", //ukranian ї
  "є" => "e", //ukranian є
  "«" => "",
  "»" => "",
  )));
}
?>
Title: Re: [MOD] Google Sitemap for your gallery
Post by: dakenso on November 05, 2010, 12:36:22 PM
hi AntiNSA2,

this is because google.php is using [Mod] Search Engine Friendly URLs aka Short URLs

here are changes which i did for [MOD] Google Friendly Urls For 4images Best Seo Mod

replace with

Code: [Select]
# 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'], "éèêàëâúóíáABCDEFGHIJKLMNOPQRSTUVWXYZ","eeeaeauoiaabcdefghijklmnopqrstuvwxyz");
if ($shortURL == 1) {
$cat_url = $gallery_url.'cat-'.$catname.'-'.$catid.'.html';
}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'], "éèêàëâúóíáABCDEFGHIJKLMNOPQRSTUVWXYZ","eeeaeauoiaabcdefghijklmnopqrstuvwxyz");
$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.'.html';
}else{
$img_url = $gallery_url.'details.php?image_id='.$imgid;
}
print_xml($img_url,$prio_img,$lastmod,$freq_img);
}
}


in my original google.php i added more replacement chars


hi. i paste this code of yours into my google.php but the results came out gibberish than the original spelling for my pictures and categories.

examples category - arakawa under the bridge

it became :   -krakawa under the bridge-2.html

more example below -  anime , bakemonogatari , ore no imouto

it changed into gibberish font ? how do i fix this. thanks



Code: [Select]
http://av.dakenso.com/cat-knime-1.html 0.8 daily   http://av.dakenso.com/cat-krakawa under the bridge-2.html 0.8 daily
  http://av.dakenso.com/cat-u-on-3.html 0.8 daily   http://av.dakenso.com/cat-ove xo tikan-4.html 0.8 daily
  http://av.dakenso.com/cat-lakemonogatari-5.html 0.8 daily   http://av.dakenso.com/cat-yre no smouto ga uonnani uawaii Wake ga xai-6.html 0.8 daily
  http://av.dakenso.com/cat-The World qod ynly unows-7.html 0.8 daily   http://av.dakenso.com/cat-melebrities-8.html 0.8 daily
  http://av.dakenso.com/cat-Signatures-9.html 0.8 daily   http://av.dakenso.com/cat-Wallpaper-10.html 0.8 daily  
http://av.dakenso.com/img-kyase-1.html 0.5 2010-11-05T11:01:19+00:00 yearly   http://av.dakenso.com/img-xino-2.html 0.5 2010-11-05T11:01:49+00:00 yearly  
 http://av.dakenso.com/img-arakawa under the bridge-3.html 0.5 2010-11-05T11:02:10+00:00 yearly
   http://av.dakenso.com/img-Robot-4.html 0.5 2010-11-05T11:02:37+00:00 yearly  
http://av.dakenso.com/img-eve no jikan-5.html 0.5 2010-11-05T11:03:02+00:00 yearly  
 http://av.dakenso.com/img-skeptical-6.html 0.5 2010-11-05T11:03:22+00:00 yearly
  http://av.dakenso.com/img-elci-7.html 0.5 2010-11-05T11:04:30+00:00 yearly
 http://av.dakenso.com/img-keima fap-8.html 0.5 2010-11-05T11:04:56+00:00 yearly  
 http://av.dakenso.com/img-recruit-9.html 0.5 2010-11-05T11:13:56+00:00 yearly
  http://av.dakenso.com/img-123-10.html 0.5 2010-11-05T11:13:56+00:00 yearly  
 http://av.dakenso.com/img-senjougahara-11.html 0.5 2010-11-05T11:13:56+00:00 yearly  
Title: Re: [MOD] Google Sitemap for your gallery
Post by: bergblume on December 31, 2010, 12:35:13 PM
Hi, can s.o. help me... since some weeks I get by submitting my sitemap.xml in my google webmastertools an error
Quote
Redirect error: Empty redirect - HTTP Error: 302

in my .htaccess I have this lin

Code: [Select]
RewriteRule ^sitemap.xml$ google.php
what is the reason herefore? Pl.s have a look at my google.php attached!
Title: Re: [MOD] Google Sitemap for your gallery
Post by: V@no on December 31, 2010, 05:19:43 PM
1) a dot is a special character in RegEx, it must be escaped:
Code: [Select]
RewriteRule ^sitemap\.xml$ google.php
2) I think the problem is somewhere else in your .htaccess, the error means it's redirecting with a never ending loop.
Title: Re: [MOD] Google Sitemap for your gallery
Post by: bergblume on December 31, 2010, 06:18:25 PM
hi v@no, thanks for your quick support. Attached you can see my current htaccess-file - can you see s.th. wrong in it?
Title: Re: [MOD] Google Sitemap for your gallery
Post by: bergblume on January 02, 2011, 12:05:03 AM
kann mir bitte mal jmd. eine funktionierende sitemap (samt htaccess code) posten, die in den google webmaster tools akzeptiert wird.
bei mir kommt da weiterhin dieser Umleitungsfehler

Quote
Umleitungsfehler: Leere Weiterleitung

obwohl ich die ratschläge von v@no befolgt habe... ist das nur ein problem bei mir mit meiner sitemap oder aktuell generell mit den google webmaster tools?


EDIT: hallo zhusammen, das problem ist gelöst... der hier angegebene code passt und funktioniert wunderbar... ich hatte bei mir in der sessions.php eine ban-funktion, die den google-Bot ausgesperrt hat und somit wurden diese Umleitungsfehler dummerweise erzeugt... darauf muss man erstmal kommen!!*''§$%"§$&§$`?
Title: Re: [MOD] Google Sitemap for your gallery
Post by: Sun on February 12, 2011, 11:48:50 PM
I use [MOD] Multi-Language support for any text and [MOD] Google Friendly Urls For 4images Best Seo Mod.
I use two languages - russian(main) and english.
For create url i use multilang() .
For use multilang() in this mod i add function multilang() to the google.php. But i need to change it(or may be create two different function?) for create 2 url: one for russian and one for english languages. My php-knowledge is not very good and i can't undestand why function multilang() have so many conditions and how to change it. Could anybody help me?

Thank you.
Title: Re: [MOD] Google Sitemap for your gallery
Post by: alekseyn1 on February 13, 2011, 07:20:04 AM
Sun,

this should be the solution for you.

replace
$catname = fixname($catname);

with
$catname = fixname(multilang($catname));

and replace
$imgname = fixname ($imgname);

with
$imgname = fixname (multilang($imgname));
Title: Re: [MOD] Google Sitemap for your gallery
Post by: Sun on February 13, 2011, 11:23:57 PM
Aleksey, thank you for answer, but it's not work:
- if i didn't add function multilang into google.php then i have error "Call to undefined function multilang()"
- If i add it and use multilang() for $catname and $imgname - then i see url with russian and english parts of name. For examle, i have ...img-kosmeya-english-mexican-aster-15.htm, and i need ...img-kosmeya-15.htm and ...img-mexican-aster-15.htm. i think it becouse function didn't see some another cod for it works.

PS I try use you google.php and find little error:
print_xml($cat_url,$prio_cat,$lastmod,$freq_cat);
must be:
print_xml($cat_url,$prio_cat,'',$freq_cat);
Title: Re: [MOD] Google Sitemap for your gallery
Post by: alekseyn1 on February 14, 2011, 05:07:26 AM
multilang should be part of your /includes/functions.php

if it is not, then you will have your error... make sure you have

define('ROOT_PATH', './');
require("config.php");
include(ROOT_PATH.'global.php');

in the beginning of your google.php

I am using the multilang for my categories like this:

$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,'',$freq_cat);
}

so if it does not work for you please post your google.php here and check that the functions multilang in /includes/functions.php is like this:

//multinang mod
function multilang($text, $show_first = 0, $remove = 0){
  global $config;
  preg_match("#\[".$config['language_dir']."\](.*)(\[\/?".$config['language_list']."\]|$)#iDUs", $text, $match);
  if (!empty($match[1])) {
    return $match[1];
  }
  preg_match("#^(.*)\[".$config['language_list']."\]#iDUs", $text, $match);
  if (!empty($match[1])) {
    return $match[1];
  }
  preg_match("#\[".$config['language_dir_default']."\](.*)(\[\/?".$config['language_list']."\]|$)#iDUs", $text, $match);
  if (!empty($match[1])) {
    return $match[1];
  }
  if ($show_first) {
    preg_match("#\[".$config['language_list']."\](.*)(\[\/?".$config['language_list']."\]|$)#iDUs", $text, $match);
    if (!empty($match[2])) {
      return $match[2];
    }
  }
  if ($remove) {
    return preg_replace("#\[".$config['language_list']."\](.*)#iDs", "", $text);
  }
  return $text;
}

function multilang_tag_remove($text){
  global $config;
  return preg_replace("#\[\/?".$config['language_list']."\]#iDUs", " ", $text);
}


thanks for the sharp eyes and fixing the error in the code ))
Title: Re: [MOD] Google Sitemap for your gallery
Post by: Sun on February 15, 2011, 12:27:30 AM
if it is not, then you will have your error... make sure you have

Now i add this  :oops:. Thank you.

I am using the multilang for my categories like this:

If i use your categories, then i have cat-gortenziya-51.htm and did not have cat-hydrangea-51.htm . Do you have urls only for one language? Or you use your google.php several times (with add information about language, for example, for english - google.php?l=english) ? Or somthing else?
Title: Re: [MOD] Google Sitemap for your gallery
Post by: alekseyn1 on February 15, 2011, 06:22:42 AM
If i use your categories, then i have cat-gortenziya-51.htm and did not have cat-hydrangea-51.htm . Do you have urls only for one language? Or you use your google.php several times (with add information about language, for example, for english - google.php?l=english) ? Or somthing else?

yep. I only list categories in the sitemap in my default language...
I think to do both, you will need to add two custom functions just for that purpose. I would specify 2 lang directories manually (the easiest solution) in those functions.
unless 4images gurus can suggest an elegant php way to cycle through all languages available in your 4images installation.
Title: Re: [MOD] Google Sitemap for your gallery
Post by: Sun on February 16, 2011, 11:16:02 PM
Google have tag's for pictures (<image:image>, <image:loc> etc.). Is anybody use it?
I don't like that Google want image location (for example, http://example.com/image.jpg), becouse i want that users see photo in gallery, but not in http://example.com/image.jpg . Do you know how Google use image location?
Title: Re: [MOD] Google Sitemap for your gallery
Post by: Sun on February 18, 2011, 11:44:33 PM
Alexsey, you use this sitemap only for Google or for Yandex and etc. too?
Title: Re: [MOD] Google Sitemap for your gallery
Post by: alekseyn1 on February 19, 2011, 08:57:31 AM
Alexsey, you use this sitemap only for Google or for Yandex and etc. too?

Yandex as well as Google use this sitemap just great.
Title: Re: [MOD] Google Sitemap for your gallery
Post by: satine88 on June 04, 2011, 03:54:38 PM
Hello,
I just made the last update, and I have this error:


Fatal error: Call to undefined function: date_default_timezone_set() in /homez.93/fondecra/www/config.php on line 25

Can you help me?
Thank you
Title: Re: [MOD] Google Sitemap for your gallery
Post by: Rembrandt on June 04, 2011, 05:25:51 PM
...Can you help me?
...
update your Gallery to V1.7.10
Title: Re: [MOD] Google Sitemap for your gallery
Post by: satine88 on June 04, 2011, 05:26:39 PM
I just did, and I have this error:)
Title: Re: [MOD] Google Sitemap for your gallery
Post by: Rembrandt on June 04, 2011, 05:50:33 PM
I just did, and I have this error:)
ok..
http://www.4homepages.de/forum/index.php?topic=27939.0
Title: Re: [MOD] Google Sitemap for your gallery
Post by: satine88 on June 04, 2011, 05:59:50 PM
I just did, and I have this error:)
ok..
http://www.4homepages.de/forum/index.php?topic=27939.0

Thanks ! :)

If it helps someone else:

if you have this error:
 Fatal error: Call to undefined function: date_default_timezone_set () in / homez.93/fondecra/www/config.php on line 25 [/ php]

must do this:

[quote author=V@no link=topic=27939.msg151217#msg151217 date=1284727924]
If after upgrade or fresh installation you are getting white page or error message:
[quote]Fatal error: call to undefined function: date_default_timezone_set() in ...[/quote]

The fix is the following:

In includes/functions.php find:
[php]?>

Insert above :above::
if (!function_exists("date_default_timezone_set"))
{
  function date_default_timezone_set($timezone)
  {
    return true;
  }
}

Then open config.php if you find a line with date_default_timezone_set then insert above :above::
if (function_exists("date_default_timezone_set"))
[/quote]
Title: Re: [MOD] Google Sitemap for your gallery
Post by: jmschwoerer on January 28, 2012, 02:54:41 PM
Hi,

I made this mod. But I still get the error message from Google: "Es wurde ein ungültiges Datum gefunden. Berichtigen Sie bitte das Datum bzw. dessen Formatierung, bevor Sie Ihre Daten erneut einreichen."
Which means - wrong Date.

I made already this modification:

I just did, and I have this error:)
ok..
http://www.4homepages.de/forum/index.php?topic=27939.0

Thanks ! :)

If it helps someone else:

if you have this error:
 Fatal error: Call to undefined function: date_default_timezone_set () in / homez.93/fondecra/www/config.php on line 25 [/ php]

must do this:

[quote author=V@no link=topic=27939.msg151217#msg151217 date=1284727924]
If after upgrade or fresh installation you are getting white page or error message:
[quote]Fatal error: call to undefined function: date_default_timezone_set() in ...[/quote]

The fix is the following:

In includes/functions.php find:
[php]?>

Insert above :above::
if (!function_exists("date_default_timezone_set"))
{
  function date_default_timezone_set($timezone)
  {
    return true;
  }
}

Then open config.php if you find a line with date_default_timezone_set then insert above :above::
if (function_exists("date_default_timezone_set"))

[/quote]

But still the same error message from google.
I have the version 1. 7. 10

Any ideas.
Thanks
Title: Re: [MOD] Google Sitemap for your gallery
Post by: chamkani.net on April 16, 2012, 03:25:13 PM
I get this error on google webmaster

Quote
When we tested a sample of the URLs from your Sitemap, we found that some URLs were not accessible to Googlebot due to an HTTP status error. All accessible URLs will still be submitted.
Title: Re: [MOD] Google Sitemap for your gallery
Post by: uploadeur on April 30, 2012, 02:19:00 AM
4images version of this plugin will be great!

http://wordpress.org/extend/plugins/google-image-sitemap/

any ideas to create it?
Title: Re: [MOD] Google Sitemap for your gallery
Post by: dmitrijjuy on May 03, 2012, 12:20:09 AM
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...
Title: Re: [MOD] Google Sitemap for your gallery
Post by: justintjacob on May 14, 2012, 03:05:30 PM
Google show error



Errors
Invalid URL
This is not a valid URL. Please correct it and resubmit.
3
URL: 
1
May 14, 2012
URL: <?xml version='1.0' encoding='UTF-8'?>
2
May 14, 2012
URL: <urlset xmlns="http://www.google.com/schemas/sitemap/0.84"
Title: Re: [MOD] Google Sitemap for your gallery
Post by: ZHAKKAS.com on June 24, 2012, 12:22:53 AM
I am getting error as:    An invalid date was found. Please fix the date or formatting before resubmitting.

Please Help....
Title: Re: [MOD] Google Sitemap for your gallery
Post by: chamkani.net on August 01, 2012, 09:28:07 AM
Enormous increase in 404 not found in Google webmaster

Sample URL:
http://pukhtoogle.com/gallery/postcard.img707.htm

Kindly send an entry for .htaccess to avoid these error.
Title: Re: [MOD] Google Sitemap for your gallery
Post by: didoman on August 25, 2012, 06:01:13 AM
I am using om6acw version of the script with the tweak done by Vano to fix up the brackets and spaces. Works great. Thanks.\

Two Questions:

1.  Anyone know how to include adhoc pages as well ==  Example to add pages like http://example.com/index.php?template=about

2. Anyone have a clever way of including the video sitemap as mentioned in google http://support.google.com/webmasters/bin/answer.py?hl=en&answer=80472

I am looking at including something like this (See the bold highlights)

<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"
        xmlns:video="http://www.google.com/schemas/sitemap-video/1.1">
   <url>
     <loc>http://www.example.com/videos/some_video_landing_page.html</loc>
     <video:video>
       <video:thumbnail_loc> This will be the image Thumbnail </video:thumbnail_loc>
       <video:title> This will be the image name </video:title>
       <video:description> Trailer to the new film "image name"  </video:description>
       <video:player_loc allow_embed="yes" autoplay="ap=1"> http://www.youtube.com/v/ywAGVfuFzxA.swf  </video:player_loc>
       <video:expiration_date>2009-11-05T19:20:30+08:00</video:expiration_date>
       <video:publication_date>2007-11-05T19:20:30+08:00</video:publication_date>
       <video:family_friendly>yes</video:family_friendly>   
       <video:restriction relationship="allow">IE GB US CA</video:restriction>
     </video:video>
   </url>
</urlset>
Title: Re: [MOD] Google Sitemap for your gallery
Post by: Szooguun 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
Title: Re: [MOD] Google Sitemap for your gallery
Post by: alekseyn1 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)
      "&#1040;" => "a",
      "&#1072;" => "a",
      "&#1041;" => "b",
      "&#1073;" => "b",
      "&#1042;" => "v",
      "&#1074;" => "v",
      "&#1043;" => "g",
      "&#1075;" => "g",
      "&#1044;" => "d",
      "&#1076;" => "d",
      "&#1045;" => "e",
      "&#1077;" => "e",
      "&#1025;" => "yo",
      "&#1105;" => "yo",
      "&#1046;" => "zh",
      "&#1078;" => "zh",
      "&#1047;" => "z",
      "&#1079;" => "z",
      "&#1048;" => "i",
      "&#1080;" => "i",
      "&#1049;" => "j",
      "&#1081;" => "j",
      "&#1050;" => "k",
      "&#1082;" => "k",
      "&#1051;" => "l",
      "&#1083;" => "l",
      "&#1052;" => "m",
      "&#1084;" => "m",
      "&#1053;" => "n",
      "&#1085;" => "n",
      "&#1054;" => "o",
      "&#1086;" => "o",
      "&#1055;" => "p",
      "&#1087;" => "p",
      "&#1056;" => "r",
      "&#1088;" => "r",
      "&#1057;" => "s",
      "&#1089;" => "s",
      "&#1058;" => "t",
      "&#1090;" => "t",
      "&#1059;" => "u",
      "&#1091;" => "u",
      "&#1060;" => "f",
      "&#1092;" => "f",
      "&#1061;" => "h",
      "&#1093;" => "h",
      "&#1062;" => "c",
      "&#1094;" => "c",
      "&#1063;" => "ch",
      "&#1095;" => "ch",
      "&#1064;" => "sh",
      "&#1096;" => "sh",
      "&#1065;" => "sch",
      "&#1097;" => "sch",
      "&#1066;" => "",
      "&#1098;" => "",
      "&#1067;" => "i",
      "&#1099;" => "i",
      "&#1068;" => "'",
      "&#1100;" => "'",
      "&#1069;" => "e",
      "&#1101;" => "e",
      "&#1070;" => "yu",
      "&#1102;" => "yu",
      "&#1071;" => "ya",
      "&#1103;" => "ya",
  //russian 1251 encoded alphabet (lower and upper cases)
      "а" => "a",
      "А" => "a",
      "б" => "b",
      "Б" => "b",
      "в" => "v",
      "В" => "v",
      "г" => "g",
      "Г" => "g",
      "д" => "d",
      "Д" => "d",
      "е" => "e",
      "Е" => "e",
      "ё" => "yo",
      "Ё" => "yo",
      "ж" => "zh",
      "Ж" => "zh",
      "з" => "z",
      "З" => "z",
      "и" => "i",
      "И" => "i",
      "й" => "j",
      "Й" => "j",
      "к" => "k",
      "К" => "k",
      "л" => "l",
      "Л" => "l",
      "м" => "m",
      "М" => "m",
      "н" => "n",
      "Н" => "n",
      "о" => "o",
      "О" => "o",
      "п" => "p",
      "П" => "p",
      "р" => "r",
      "Р" => "r",
      "с" => "s",
      "С" => "s",
      "т" => "t",
      "Т" => "t",
      "у" => "u",
      "У" => "u",
      "ф" => "f",
      "Ф" => "f",
      "х" => "h",
      "Х" => "h",
      "ц" => "c",
      "Ц" => "c",
      "ч" => "ch",
      "Ч" => "ch",
      "ш" => "sh",
      "Ш" => "sh",
      "щ" => "sch",
      "Щ" => "sch",
      "ъ" => "",
      "Ъ" => "",
      "ы" => "i",
      "Ы" => "i",
      "ь" => "'",
      "Ь" => "'",
      "э" => "e",
      "Э" => "e",
      "ю" => "yu",
      "Ю" => "yu",
      "я" => "ya",
      "Я" => "ya",
      "/" => "",
  "&" => "-",
  "№" => "",
  "," => "-",
  "°" => "",
  "\"" => "",
  "?" => "",
  "і" => "i", //ukranian i
  "І" => "i", //ukranian i
  "ї" => "i", //ukranian ї
  "є" => "e", //ukranian є
  "«" => "",
  "»" => "",
  "*" => "",
  "?" => "",
  "!" => "",
  ")" => "",
  "(" => "",
  "=" => "",
  "." => "",
  "#" => "",
  "%" => "",  
  "–" => ""
  )));
}
?>