forum.coppermine-gallery.net

No Support => Modifications/Add-Ons/Hacks => Mods: Miscellaneous => Topic started by: thejake420 on July 13, 2007, 08:26:30 am

Title: Google Sitemaps (NOT Nibbler's) - no CPG editing required
Post by: thejake420 on July 13, 2007, 08:26:30 am
Tested on CPG 1.4.x
(Though it should work on any other versions that have the same basic table structure as the current pictures and albums tables)

I'm calling this one JAKE_CPG_SITEMAP to distinguish it from Nibbler's Google sitemap mod.

This will produce Google-friendly sitemap info in valid XML format for all of your categories and individual pages (Permanent URLs, of course). No CPG files need to be modified whatsoever - this is a completely standalone script I developed (with paid professional assistance) for another site, and then modified for use in my Coppermine galleries.

This script produces sitemaps that are paginated automatically (Page 1, page 2, etc.). Google can handle sitemaps with up to 50,000 URL's in them, but it prefers (ie - responds much better to) smaller sitemaps with an "Index of indexes" setup.

Install once, submit the main page to Google and forget about it. When you make a change, the sitemap is automatically updated. No need to rebuild it... ever.

I've got a decent amount of money invested in this because I needed the SEO value of having all of my gallery pages spidered by Google, but I'm willing to share it with the Coppermine community to give back, so to speak. All I ask in return is a link (see the readme.txt). (The link isn't mandatory, but you'll be a better person for it.)

You'll need to edit 2 files with your own website information. One is the connection script (I don't use Coppermine's include/config.inc.php for technical reasons), and the other is the main script where you'll have to change things like:

YOUR_URL_HERE (etc.)

All really basic stuff, and it's extremely well documented, so you shouldn't have any trouble at all.

Here is a working example:

"Index of indexes":
http://www.freeclipartfree.com/gallery_sitemap_xml.php

"Regular index"
http://www.freeclipartfree.com/gallery_sitemap_xml.php?category=13&page=3


Jake
Title: Re: Google Sitemaps (NOT Nibbler's) - no CPG editing required
Post by: thejake420 on July 15, 2007, 11:27:13 am
Two things to mention...

1. Just caught a minor bug with galleries that live in a subfolder of the site's domain.

I'll get on it as soon as I have a moment. Shouldn't be anything too difficult to track down.
UPDATE: That little sucker is more elusive than I thought. (It does, however, still work perfectly for sites using CPG at the top of their domain...)

2. You need to make sure that gallery_sitemap_xml.php is writeable
Solution: chmod the file to 777 or 766, depending on your host


Jake
Title: Re: Google Sitemaps (NOT Nibbler's) - no CPG editing required
Post by: nbakewell on August 01, 2007, 03:06:22 am
Nice, thanks!  This will definitely be a help.
Title: Re: Google Sitemaps (NOT Nibbler's) - no CPG editing required
Post by: Ludo on August 22, 2007, 03:51:43 pm
Mod installed and working fine, except for a timeout error while reading the "main category" sitemap (http://vanrokken.altervista.org/gallery_sitemap_xml.php?category=index): could it be a mod bug or rather some mistake in the configuration?
TIA
Title: Re: Google Sitemaps (NOT Nibbler's) - no CPG editing required
Post by: Ludo on August 22, 2007, 04:05:20 pm
P.S. I found a bug in line 5 of file gallery_sitemap_xml.php: should be
Code: [Select]
require("sitemap.class.php");instead of
Code: [Select]
require("sitemap1.class.php");
Title: Re: Google Sitemaps (NOT Nibbler's) - no CPG editing required
Post by: Willow69 on September 03, 2007, 07:36:13 pm
Hello everybody,

I tried out this plugin but it seem, that I messed it up somehow. Even so that there doesn't seem to be much possibilities to make a mistake I think I do not get the expetced result.

When I call the URL: http://87.106.18.130/gallery_sitemap_xml.php

I receive only one entry in the sitemap.

The gallery should be at root level and I believe that the database is almost default (I applied Stramms Mod Pack).

Any clues?

Cheers,
Willow
Title: Re: Google Sitemaps (NOT Nibbler's) - no CPG editing required
Post by: Willow69 on September 04, 2007, 10:51:51 am
Hi there,

I found it myself. The cpgdb_prefix for my tables is "cpg149_"  instead of "cpg140_"  :)
Now everything works fine.

THX,
Willow
Title: Re: Google Sitemaps (NOT Nibbler's) - no CPG editing required
Post by: toykilla on November 01, 2007, 08:17:12 am
Sitemap just yields a blank page. This work for 1.4.13?
Title: Re: Google Sitemaps (NOT Nibbler's) - no CPG editing required
Post by: sirshurf on December 14, 2007, 10:24:10 pm
Looks like a dead mod...

But Since the creator has not given it as GPL nobody cannt take it from here...

too bad... it was a good one...
Title: Re: Google Sitemaps (NOT Nibbler's) - no CPG editing required
Post by: thejake420 on December 14, 2007, 11:51:15 pm
GPL hereby bestowed. Have at it guys.
Title: Re: Google Sitemaps (NOT Nibbler's) - no CPG editing required
Post by: LGLDSR on December 19, 2007, 11:40:30 pm
GPL hereby bestowed. Have at it guys.
Is there a current working version available?

Thanks,

Lyman
Title: Re: Google Sitemaps (NOT Nibbler's) - no CPG editing required
Post by: thejake420 on December 20, 2007, 09:01:23 am
Is there a current working version available?
What you see is what you get. It has not been updated since around the time of the original post, as it has not needed updating. Coppermine database structure has not changed, and the XML standard used will not change regardless of what CPG does in the future.


Jake
Title: Re: Google Sitemaps (NOT Nibbler's) - no CPG editing required
Post by: LGLDSR on December 20, 2007, 03:40:08 pm
Thank Jake.

Lyman
Title: Re: Google Sitemaps (NOT Nibbler's) - no CPG editing required
Post by: Bazzah on January 09, 2008, 12:21:09 pm
When I goto my sitemap_xml.php (http://www.hirescovers.net/gallery/gallery_sitemap_xml.php) I get the following error

Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in /home/hiresco1/public_html/gallery/gallery_sitemap_xml.php on line 136

Warning: Cannot modify header information - headers already sent by (output started at /home/hiresco1/public_html/gallery/gallery_sitemap_xml.php:136) in /home/hiresco1/public_html/gallery/sitemap.class.php on line 125
http://www.hirescovers.net/gallery/gallery_sitemap_xml.php?category=index
Title: Re: Google Sitemaps (NOT Nibbler's) - no CPG editing required
Post by: Kapsel on May 20, 2008, 03:52:29 pm
Hello!
Maybe I'm blind or something, but I don't see where can I download Your script. I made my sitemap once with sitemap builder but it's not good thing for coppermine... so, could You give me a link to the script?

Greetings from Poland! ;)
Title: Re: Google Sitemaps (NOT Nibbler's) - no CPG editing required
Post by: Joachim Müller on May 20, 2008, 04:59:38 pm
It's attached to the very first posting in this thread!
Title: Re: Google Sitemaps (NOT Nibbler's) - no CPG editing required
Post by: Kapsel on May 20, 2008, 08:42:12 pm
Oops, I aways where reading forum without having my own account in the forum... and now I see, that if I'm not logged in then I can't see attachements :]
I didn't knew that, but I registered exactly for ask about script, and now - of course I could download it :) Sorry for fuss  :-X
Title: Re: Google Sitemaps (NOT Nibbler's) - no CPG editing required
Post by: KeithG on July 12, 2008, 10:16:03 pm
Thank you Jake.

I successfully installed the script, corrected the class file reference {require("sitemap1.class.php"); 1, too many}, and configured for my not-at-the-root gallery.

The script creates valid sitemaps for all but gallery_sitemap_xml.php?category=index. This sitemap has a flaw that prompts the Google error message, "URL not allowed
This url is not allowed for a Sitemap at this location."

The problem is that the URL path omits the cpg installation subdirectory, using the document root instead.

Has anyone solved this issue? If not, any sage advice provided will be appreciated.

Thanks.

  - Keith

PS Jake-> Your link is on my todo list...in fact, it's next, right after o Get cpg sitemap created. ;)   kg
Title: Re: Google Sitemaps (NOT Nibbler's) - no CPG editing required
Post by: aftab1003 on August 19, 2008, 03:43:32 pm
When I goto my sitemap_xml.php (http://www.hirescovers.net/gallery/gallery_sitemap_xml.php) I get the following error

Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in /home/hiresco1/public_html/gallery/gallery_sitemap_xml.php on line 136

Warning: Cannot modify header information - headers already sent by (output started at /home/hiresco1/public_html/gallery/gallery_sitemap_xml.php:136) in /home/hiresco1/public_html/gallery/sitemap.class.php on line 125
http://www.hirescovers.net/gallery/gallery_sitemap_xml.php?category=index




me too facing the same problem
any suggestion