Sitemap Generator for cpg1.5.x Sitemap Generator for cpg1.5.x
 

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Main Menu

Sitemap Generator for cpg1.5.x

Started by gracefulally, August 25, 2011, 07:04:56 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

gracefulally

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. :)
Gallery: CPG 1.5.16 | Curve Dark (customized)
Host: PHP 5.2.14 | Apache 1.3.42 | TMDHosting
Plugins: Add Pic Download Link, Lightbox NotesFor.net, Keyboard Navigation, Keywords Add, File Replacer, External Tracker, Sitemap Generator, Minify, XFeeds, SEF URLs, more...

alanz01

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
CPG 1.5.12 / Curve Theme / modified color scheme
Plugins (in order):
- External Tracker 2.6
- Social Sharing 1.5
- First Visit Hint 1.0
- Add Meta Description 1.5
- SEF URLs
- Image Preloader 1.4

gracefulally

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!
Gallery: CPG 1.5.16 | Curve Dark (customized)
Host: PHP 5.2.14 | Apache 1.3.42 | TMDHosting
Plugins: Add Pic Download Link, Lightbox NotesFor.net, Keyboard Navigation, Keywords Add, File Replacer, External Tracker, Sitemap Generator, Minify, XFeeds, SEF URLs, more...

alanz01

Quotedo 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."
CPG 1.5.12 / Curve Theme / modified color scheme
Plugins (in order):
- External Tracker 2.6
- Social Sharing 1.5
- First Visit Hint 1.0
- Add Meta Description 1.5
- SEF URLs
- Image Preloader 1.4

gracefulally

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.
Gallery: CPG 1.5.16 | Curve Dark (customized)
Host: PHP 5.2.14 | Apache 1.3.42 | TMDHosting
Plugins: Add Pic Download Link, Lightbox NotesFor.net, Keyboard Navigation, Keywords Add, File Replacer, External Tracker, Sitemap Generator, Minify, XFeeds, SEF URLs, more...

alanz01

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
CPG 1.5.12 / Curve Theme / modified color scheme
Plugins (in order):
- External Tracker 2.6
- Social Sharing 1.5
- First Visit Hint 1.0
- Add Meta Description 1.5
- SEF URLs
- Image Preloader 1.4

gracefulally

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.
Gallery: CPG 1.5.16 | Curve Dark (customized)
Host: PHP 5.2.14 | Apache 1.3.42 | TMDHosting
Plugins: Add Pic Download Link, Lightbox NotesFor.net, Keyboard Navigation, Keywords Add, File Replacer, External Tracker, Sitemap Generator, Minify, XFeeds, SEF URLs, more...

alanz01

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.
CPG 1.5.12 / Curve Theme / modified color scheme
Plugins (in order):
- External Tracker 2.6
- Social Sharing 1.5
- First Visit Hint 1.0
- Add Meta Description 1.5
- SEF URLs
- Image Preloader 1.4

alanz01

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.
CPG 1.5.12 / Curve Theme / modified color scheme
Plugins (in order):
- External Tracker 2.6
- Social Sharing 1.5
- First Visit Hint 1.0
- Add Meta Description 1.5
- SEF URLs
- Image Preloader 1.4

gracefulally

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.
Gallery: CPG 1.5.16 | Curve Dark (customized)
Host: PHP 5.2.14 | Apache 1.3.42 | TMDHosting
Plugins: Add Pic Download Link, Lightbox NotesFor.net, Keyboard Navigation, Keywords Add, File Replacer, External Tracker, Sitemap Generator, Minify, XFeeds, SEF URLs, more...

gracefulally

Here's a quick update with v.2

Changes

  • Added announcement thread's url to configuration info and to the sitemap stylesheet
  • Added IN_COPPERMINE checks to all files (I only had it in the language file previously)
Gallery: CPG 1.5.16 | Curve Dark (customized)
Host: PHP 5.2.14 | Apache 1.3.42 | TMDHosting
Plugins: Add Pic Download Link, Lightbox NotesFor.net, Keyboard Navigation, Keywords Add, File Replacer, External Tracker, Sitemap Generator, Minify, XFeeds, SEF URLs, more...

lurkalot

Quote from: 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.

That's because it's not your thread, you didn't start it. ;)
Running SMF 2.1.4  / Tinyportal 3.0.1, bridged with Coppermine 1.6.25, plus cpmfetch 2.0.0

TeknoSounds

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.

gracefulally

Updates in v0.3

  • Separated FTP file creation and deletion functions from main code for use in multiple scripts
  • New error checking and messages for file and directory creation
  • Generator now deletes old files before creating new ones
  • Generator now redirects to Sitemap Index file after successfully creating sitemaps
  • Replaced code for FTP file creation
  • Lengthened detail of messages to user
  • Added change log
  • Plugin now requires PHP5
  • Complete overhaul of XML structure creation; now uses DOM and SimpleXML elements rather than content strings
  • Plugin adds information for image and video sitemaps as needed

Planned Updates/Hopes

  • Adding a button to (re)generate sitemaps to admin menu
  • Adding an options page with different configurations, e.g. an option to automate the (re)generation of sitemaps after files are altered in gallery and an option to ping sitemap crawlers such as Google
Gallery: CPG 1.5.16 | Curve Dark (customized)
Host: PHP 5.2.14 | Apache 1.3.42 | TMDHosting
Plugins: Add Pic Download Link, Lightbox NotesFor.net, Keyboard Navigation, Keywords Add, File Replacer, External Tracker, Sitemap Generator, Minify, XFeeds, SEF URLs, more...

TeknoSounds

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

matrix.1372

i have a problem with this plugin:
here is the generated sitemap:
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?

matrix.1372

Quote from: 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
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 :)

all-gsm

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

allvip

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

flapane

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
Flapane
www.flapane.com

Gallery
www.gallery.flapane.com