forum.coppermine-gallery.net

Support => cpg1.5 plugins => cpg1.5.x Support => cpg1.5 plugin contributions => Topic started by: gracefulally on August 25, 2011, 07:04:56 am

Title: Sitemap Generator for cpg1.5.x
Post by: gracefulally on August 25, 2011, 07:04:56 am
So, not only is this my first CPG plugin, this is also my first forum post! Be gentle, please.

Sitemap Generator is a plugin that will create sitemaps for your Coppermine gallery with one click. First, a directory 'sitemaps' and a sitemap index file are created and then sitemaps for each category, which include links to each album and album item's page, are created. (Password protected albums are, of course, excluded.) I split up the sitemaps by category because Google accepts a maximum of 50,000 links in one sitemap and I have 60,000+ pictures on the CPG site I originally created this plugin for. Additionally, while looking through the PHP documentation, I noticed mention of users sometimes having trouble with file creation with PHP functions, so I added a panel which allows you to input FTP credentials for your gallery's server. The plugin handles the rest.

This plugin is inspired by Yoast's Wordpress SEO plugin which generates XML sitemaps. I used (and credited!) their stylesheet for the .xml files because 1) I think it's pretty and 2) I'm too lazy to rewrite it.

If you have any questions or run into any issues, please let me know through this topic or via PM. Also, if someone would like to create language files, that would be most awesome of you. :)
Title: Re: Sitemap Generator for cpg1.5.x
Post by: alanz01 on August 27, 2011, 04:00:10 pm
I am having some issues with this; I have a site maps directory at the top level of my site but the map in there is old. I don't see any new site_map being created in either the /photography or top-level directories even though the message "Sitemaps were successfullly created. They are located in the "sitemaps" directory under your root folder." is displayed.

If I use the ftp option I get an error:

Method Not Implemented
GET to /photography/index.php not supported.
Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.

I also use SEF_URL but I get a similar error (index.html instead of index.php) when it is active. Any ideas?

http://www.alanzeleznikar.com/photography (http://www.alanzeleznikar.com/photography)
Title: Re: Sitemap Generator for cpg1.5.x
Post by: gracefulally on August 27, 2011, 05:36:00 pm
With the way the plugin is set up, the sitemaps should be created in your gallery's root folder i.e. the /photography folder.

I don't have time to investigate this completely at the moment, but do you have FTP remote access enabled on your server?

I look at this more when I'm not at work. Sorry that you're having trouble!
Title: Re: Sitemap Generator for cpg1.5.x
Post by: alanz01 on August 27, 2011, 06:56:02 pm
Quote
do you have FTP remote access enabled on your server?

If you mean can I ftp from my home computer to the server that hosts my domain and website, the answer is "Yes."
Title: Re: Sitemap Generator for cpg1.5.x
Post by: gracefulally on August 27, 2011, 07:59:48 pm
Still at work so let me know if I'm not making any sense...

I'm just wondering if your website is able to login to the server. If no files are being created even after you input the FTP information, that might be the case. Also, have you checked the upper levels of the website (say the folder ABOVE the root for the website, i.e. the server's folder) to see if a folder 'sitemaps' has been created there? That's what was happening to me when I was testing the FTP connection before I added the option to input the gallery root folder.

And SEF shouldn't be giving it any trouble as I have it installed on my gallery, too. But if you're saying you're having trouble with SEF, it might be that SEF was unable to create the new .htaccess file? Which means your server configuration might need some tweaking to allow the website to use it properly.
Title: Re: Sitemap Generator for cpg1.5.x
Post by: alanz01 on August 28, 2011, 08:18:52 pm
I have checked again and no, there are no "new" site_map" directories created. I have a site_maps directory at the top level (alanzeleznikar.com) with a date of September 8 2010 (and the same date for all the files in that directory). That directory was created by a site maps tool for my entire site.

There is no "sitemaps" directory in /photography. There are 2 "sitemap" files in /photography dated Jan 2 2011 (sitemap.html and sitemap.php) which were created with another utility.

I didn't mean to imply that SEF_URL was giving me trouble; my comment was that when I use the ftp option in the sitemap plug-in I get an error message and the message is slightly different if SEF-URL is active or not. The .htaccess created by SEF_URL file is present in the /photography directory.

http://www.alanzeleznikar.com/photography (http://www.alanzeleznikar.com/photography)
Title: Re: Sitemap Generator for cpg1.5.x
Post by: gracefulally on August 30, 2011, 01:27:53 am
I just had a thought... Is your /photography directory writable?

If not, this plugin isn't going to work. But SEF wouldn't have worked either so I might just be grasping at straws with that one.

The other thought I had is that you've input the wrong path into the FTP settings. 1) Make sure you've input leading and trailing slashes around the path. 2) Check that FTP login with a FTP client to see where exactly you're logging in. For example, with my FTP settings, I'm logging into the home directory (i.e. home/xxxx/) which is above my gallery directory located at home/xxxx/public_html/ so /public_html/ is the path I input on the settings.

If this doesn't work, I can provide you with a new plugin file with debug statements added so we can figure out where this is going awry. That option is up to you, though.
Title: Re: Sitemap Generator for cpg1.5.x
Post by: alanz01 on August 31, 2011, 05:27:27 am
OK, it looks like this time running the "Generate sitemaps" command actually did work. Very odd.

Side note: when I click on the "ftp settings" button I get teh 404 error message noted above.

So, something is wonky here but for the moment my immediate problem seems to be solved.
Title: Re: Sitemap Generator for cpg1.5.x
Post by: alanz01 on August 31, 2011, 06:01:47 am
PS - I wanted to mark this thread as "resolved" but there is no "Topic Resolved" button on the bar at the left hand side at the bottom of (this) thread.
Title: Re: Sitemap Generator for cpg1.5.x
Post by: gracefulally on September 02, 2011, 06:05:31 pm
Awesome! Glad it was resolved. Did you figure out why it wasn't working? Are you still getting a 404? That's definitely a new one and shouldn't be happening.
Title: Re: Sitemap Generator for cpg1.5.x
Post by: gracefulally on September 02, 2011, 06:22:01 pm
Here's a quick update with v.2

Changes
Title: Re: Sitemap Generator for cpg1.5.x
Post by: lurkalot on September 02, 2011, 07:24:40 pm
PS - I wanted to mark this thread as "resolved" but there is no "Topic Resolved" button on the bar at the left hand side at the bottom of (this) thread.

That's because it's not your thread, you didn't start it. ;)
Title: Re: Sitemap Generator for cpg1.5.x
Post by: TeknoSounds on September 14, 2011, 12:12:22 pm
Thank you for this :)

One note, you may want to include in your instructions to either make the coppermine root directory writable; or more securely, just create the sitemaps folder manually.  This is what I had to do as I was also getting the "site maps created successfully" message, but no sitemap folder was generated nor any sitemaps.  Once I created the folder, it was able to generate the sitemaps correctly.

Am looking into setting this up as a cron job to run once daily.
Title: Re: Sitemap Generator for cpg1.5.x
Post by: gracefulally on September 21, 2011, 03:34:27 am
Updates in v0.3

Planned Updates/Hopes
Title: Re: Sitemap Generator for cpg1.5.x
Post by: TeknoSounds on September 22, 2011, 03:34:07 am
Greetings,

I just installed the new version and noted one thing.  I created an album today but its not showing up in the sitemap regeneration.  Its still stating that the last update/album created was on 9/11 (the last album created before the most recent).
Title: Re: Sitemap Generator for cpg1.5.x
Post by: matrix.1372 on March 11, 2013, 10:12:50 am
i have a problem with this plugin:
here is the generated sitemap:
http://axgir.com/sitemaps/cat2-sitemap.xml (http://axgir.com/sitemaps/cat2-sitemap.xml)
this file contains 1000 links but my gallery (at this time) have 3000 photos!
i think may be from database but after updating database, and generate again that file only have 1000 links :|
what is problem?
Title: Re: Sitemap Generator for cpg1.5.x
Post by: matrix.1372 on March 11, 2013, 10:32:45 am
i have a problem with this plugin:
here is the generated sitemap:
http://axgir.com/sitemaps/cat2-sitemap.xml (http://axgir.com/sitemaps/cat2-sitemap.xml)
this file contains 1000 links but my gallery (at this time) have 3000 photos!
i think may be from database but after updating database, and generate again that file only have 1000 links :|
what is problem?
I committed a big mistake!  :D
an that was the browser cache!! after cleaning cache fixed.
thanks a lot for this excellent plug-in :)
Title: Re: Sitemap Generator for cpg1.5.x
Post by: all-gsm on July 23, 2013, 01:12:31 pm
Made as it is written, but it does not work Sitemap Generator for cpg1.5.x Please help what settings I missed. FTP configured. When you generate a sitemap is generated sitemaps folder with the file sitemap_index.xml but the file does not contain records about the url "This XML Sitemap contains 0 URLs."
Title: Re: Sitemap Generator for cpg1.5.x
Post by: allvip on September 25, 2013, 09:56:25 pm
after the sitemaps were created I'm redirected to:

sitemap index

with error:

Error loading stylesheet: A network error occurred loading an XSLT stylesheet:http://allvip.us/gallery/plugins/sitemap_generator/xml-sitemap.xsl
Title: Re: Sitemap Generator for cpg1.5.x
Post by: flapane on October 24, 2014, 09:38:11 pm
First of all, thanks for your plugin. I see that the thread is way old, but nonetheless it should be put as a sticky thread.
IMHO this feature should be added by default to cpg, together with options to automatically add "noindex" attribute to some part of the websites in order to avoid duplicated content issues, so that one doesn't have to manually edit theme.php.

Still, I noticed that it doesn't create a sitemap for a few albums that are "uncategorized". They're seen by cpg as cat=1, and as "User galleries" by the final user.
Any way to add a new sitemap for those pics?

Also, it would be nice if they could be gzipped on the fly. It would help a lot with large galleries.

Thanks
Title: Re: Sitemap Generator for cpg1.5.x
Post by: bg62 on April 13, 2017, 11:30:31 am
Hello;)
I encounter serious problems with the generation of the sitemap ...
It seems that the updates are not made ...
I put new images, new categories and nothing changes !!!
If someone has a solution = big thank you ... :)

help me ... !!!