forum.coppermine-gallery.net
No Support => Modifications/Add-Ons/Hacks => Mods: Miscellaneous => Topic started 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
-
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
-
Nice, thanks! This will definitely be a help.
-
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
-
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");
-
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
-
Hi there,
I found it myself. The cpgdb_prefix for my tables is "cpg149_" instead of "cpg140_" :)
Now everything works fine.
THX,
Willow
-
Sitemap just yields a blank page. This work for 1.4.13?
-
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...
-
GPL hereby bestowed. Have at it guys.
-
GPL hereby bestowed. Have at it guys.
Is there a current working version available?
Thanks,
Lyman
-
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
-
Thank Jake.
Lyman
-
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
-
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! ;)
-
It's attached to the very first posting in this thread!
-
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
-
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
-
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