Google Sitemaps (NOT Nibbler's) - no CPG editing required Google Sitemaps (NOT Nibbler's) - no CPG editing required
 

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Main Menu

Google Sitemaps (NOT Nibbler's) - no CPG editing required

Started by thejake420, July 13, 2007, 08:26:30 AM

Previous topic - Next topic

0 Members and 2 Guests are viewing this topic.

thejake420

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

thejake420

#1
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

nbakewell


Ludo

Mod installed and working fine, except for a timeout error while reading the "main category" sitemap: could it be a mod bug or rather some mistake in the configuration?
TIA

Ludo

P.S. I found a bug in line 5 of file gallery_sitemap_xml.php: should be
require("sitemap.class.php");
instead of
require("sitemap1.class.php");

Willow69

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

Willow69

Hi there,

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

THX,
Willow

toykilla

Sitemap just yields a blank page. This work for 1.4.13?

sirshurf

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...

thejake420


LGLDSR

Quote from: thejake420 on December 14, 2007, 11:51:15 PM
GPL hereby bestowed. Have at it guys.
Is there a current working version available?

Thanks,

Lyman

thejake420

Quote from: LGLDSR on December 19, 2007, 11:40:30 PM
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

LGLDSR


Bazzah

When I goto my 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

Kapsel

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! ;)

Joachim Müller

It's attached to the very first posting in this thread!

Kapsel

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

KeithG

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

aftab1003

Quote from: Bazzah on January 09, 2008, 12:21:09 PM
When I goto my 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