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

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

0 Members and 1 Guest are viewing this topic.

Offline AntiNSA2

  • Hero Member
  • *****
  • Posts: 774
  • As long as I can finish my site before I die.
    • View Profile
    • http://www.thelifephotography.com
Re: [MOD] Google Sitemap for your gallery
« Reply #105 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!!!!!

« Last Edit: May 24, 2009, 07:33:27 AM by AntiNSA2 »
As long as I can finish my site before I die.

Offline yousaf

  • Jr. Member
  • **
  • Posts: 59
    • View Profile
Re: [MOD] Google Sitemap for your gallery
« Reply #106 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.

Offline AntiNSA2

  • Hero Member
  • *****
  • Posts: 774
  • As long as I can finish my site before I die.
    • View Profile
    • http://www.thelifephotography.com
Re: [MOD] Google Sitemap for your gallery
« Reply #107 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????
                                        
« Last Edit: June 08, 2009, 05:02:12 PM by AntiNSA2 »
As long as I can finish my site before I die.

Offline yousaf

  • Jr. Member
  • **
  • Posts: 59
    • View Profile
Re: [MOD] Google Sitemap for your gallery
« Reply #108 on: June 11, 2009, 04:39:33 PM »
same for me here, :(
Google does not accept my sitemap.xml

my site map link:  sitemap

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<...
« Last Edit: June 11, 2009, 04:55:45 PM by yousaf »

Offline AntiNSA2

  • Hero Member
  • *****
  • Posts: 774
  • As long as I can finish my site before I die.
    • View Profile
    • http://www.thelifephotography.com
Re: [MOD] Google Sitemap for your gallery
« Reply #109 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 :( : (
As long as I can finish my site before I die.

Offline alex9193

  • Newbie
  • *
  • Posts: 36
    • View Profile
Re: [MOD] Google Sitemap for your gallery
« Reply #110 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

Offline AntiNSA2

  • Hero Member
  • *****
  • Posts: 774
  • As long as I can finish my site before I die.
    • View Profile
    • http://www.thelifephotography.com
Re: [MOD] Google Sitemap for your gallery
« Reply #111 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....
As long as I can finish my site before I die.

Offline satine88

  • Sr. Member
  • ****
  • Posts: 265
    • View Profile
Google Webmaster Tools : Sitemap file is too big !
« Reply #112 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:)

Offline Nicky

  • Administrator
  • 4images Guru
  • *****
  • Posts: 3.195
    • View Profile
Re: Google Webmaster Tools : Sitemap file is too big !
« Reply #113 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
cheers
Nicky
Your first three "must do" before you ask a question ! (© by V@no)
- please read the Forum Rules ...
- please study the FAQ ...
- please try to Search for your answer ...

nicky.net 4 4images
Signature stolen from mawenzi

Offline satine88

  • Sr. Member
  • ****
  • Posts: 265
    • View Profile
Re: Google Webmaster Tools : Sitemap file is too big !
« Reply #114 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')  :?: :?:

Offline Nicky

  • Administrator
  • 4images Guru
  • *****
  • Posts: 3.195
    • View Profile
Re: Google Webmaster Tools : Sitemap file is too big !
« Reply #115 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...
« Last Edit: October 01, 2009, 02:22:53 PM by Nicky »
cheers
Nicky
Your first three "must do" before you ask a question ! (© by V@no)
- please read the Forum Rules ...
- please study the FAQ ...
- please try to Search for your answer ...

nicky.net 4 4images
Signature stolen from mawenzi

Offline satine88

  • Sr. Member
  • ****
  • Posts: 265
    • View Profile
Re: [MOD] Google Sitemap for your gallery
« Reply #116 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?

Offline bergblume

  • Sr. Member
  • ****
  • Posts: 463
  • on to the top!
    • View Profile
Re: [MOD] Google Sitemap for your gallery
« Reply #117 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

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

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

Offline Nicky

  • Administrator
  • 4images Guru
  • *****
  • Posts: 3.195
    • View Profile
Re: [MOD] Google Sitemap for your gallery
« Reply #118 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

cheers
Nicky
Your first three "must do" before you ask a question ! (© by V@no)
- please read the Forum Rules ...
- please study the FAQ ...
- please try to Search for your answer ...

nicky.net 4 4images
Signature stolen from mawenzi

Offline bergblume

  • Sr. Member
  • ****
  • Posts: 463
  • on to the top!
    • View Profile
Re: [MOD] Google Sitemap for your gallery
« Reply #119 on: July 08, 2009, 10:46:41 AM »
I adapted for those who use the [Mod] Search Engine Friendly URLs aka Short URLs.
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!