Advanced search  

News:

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

Pages: [1] 2   Go Down

Author Topic: Sitemap Generator for cpg1.5.x  (Read 17336 times)

0 Members and 1 Guest are viewing this topic.

gracefulally

  • Contributor
  • Coppermine newbie
  • ***
  • Country: us
  • Offline Offline
  • Gender: Female
  • Posts: 8
    • Kris Allen Gallery
Sitemap Generator for cpg1.5.x
« 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. :)
Logged
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

  • Coppermine novice
  • *
  • Offline Offline
  • Gender: Male
  • Posts: 20
  • http://www.alanzeleznikar.com/photography
    • Alan R Zeleznikar Photography
Re: Sitemap Generator for cpg1.5.x
« Reply #1 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
Logged
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

  • Contributor
  • Coppermine newbie
  • ***
  • Country: us
  • Offline Offline
  • Gender: Female
  • Posts: 8
    • Kris Allen Gallery
Re: Sitemap Generator for cpg1.5.x
« Reply #2 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!
Logged
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

  • Coppermine novice
  • *
  • Offline Offline
  • Gender: Male
  • Posts: 20
  • http://www.alanzeleznikar.com/photography
    • Alan R Zeleznikar Photography
Re: Sitemap Generator for cpg1.5.x
« Reply #3 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."
Logged
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

  • Contributor
  • Coppermine newbie
  • ***
  • Country: us
  • Offline Offline
  • Gender: Female
  • Posts: 8
    • Kris Allen Gallery
Re: Sitemap Generator for cpg1.5.x
« Reply #4 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.
Logged
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

  • Coppermine novice
  • *
  • Offline Offline
  • Gender: Male
  • Posts: 20
  • http://www.alanzeleznikar.com/photography
    • Alan R Zeleznikar Photography
Re: Sitemap Generator for cpg1.5.x
« Reply #5 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
Logged
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

  • Contributor
  • Coppermine newbie
  • ***
  • Country: us
  • Offline Offline
  • Gender: Female
  • Posts: 8
    • Kris Allen Gallery
Re: Sitemap Generator for cpg1.5.x
« Reply #6 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.
Logged
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

  • Coppermine novice
  • *
  • Offline Offline
  • Gender: Male
  • Posts: 20
  • http://www.alanzeleznikar.com/photography
    • Alan R Zeleznikar Photography
Re: Sitemap Generator for cpg1.5.x
« Reply #7 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.
Logged
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

  • Coppermine novice
  • *
  • Offline Offline
  • Gender: Male
  • Posts: 20
  • http://www.alanzeleznikar.com/photography
    • Alan R Zeleznikar Photography
Re: Sitemap Generator for cpg1.5.x
« Reply #8 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.
Logged
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

  • Contributor
  • Coppermine newbie
  • ***
  • Country: us
  • Offline Offline
  • Gender: Female
  • Posts: 8
    • Kris Allen Gallery
Re: Sitemap Generator for cpg1.5.x
« Reply #9 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.
Logged
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

  • Contributor
  • Coppermine newbie
  • ***
  • Country: us
  • Offline Offline
  • Gender: Female
  • Posts: 8
    • Kris Allen Gallery
Re: Sitemap Generator for cpg1.5.x
« Reply #10 on: September 02, 2011, 06:22:01 pm »

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

  • Administrator
  • Coppermine addict
  • *****
  • Country: gb
  • Offline Offline
  • Gender: Male
  • Posts: 824
  • +Tinyportal Support team.
Re: Sitemap Generator for cpg1.5.x
« Reply #11 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. ;)
Logged
Running SMF 2.0.13  / Tinyportal 1.2, bridged with Coppermine 1.5.34, plus cpmfetch 2.0.0

TeknoSounds

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Gender: Male
  • Posts: 83
    • TeknoSounds
Re: Sitemap Generator for cpg1.5.x
« Reply #12 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.

gracefulally

  • Contributor
  • Coppermine newbie
  • ***
  • Country: us
  • Offline Offline
  • Gender: Female
  • Posts: 8
    • Kris Allen Gallery
Re: Sitemap Generator for cpg1.5.x
« Reply #13 on: September 21, 2011, 03:34:27 am »

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

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Gender: Male
  • Posts: 83
    • TeknoSounds
Re: Sitemap Generator for cpg1.5.x
« Reply #14 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).

matrix.1372

  • Coppermine newbie
  • Offline Offline
  • Posts: 10
Re: Sitemap Generator for cpg1.5.x
« Reply #15 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?
Logged

matrix.1372

  • Coppermine newbie
  • Offline Offline
  • Posts: 10
Re: Sitemap Generator for cpg1.5.x
« Reply #16 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
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 :)
Logged

all-gsm

  • Coppermine newbie
  • Offline Offline
  • Posts: 17
Re: Sitemap Generator for cpg1.5.x
« Reply #17 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."
Logged

allvip

  • Global Moderator
  • Coppermine addict
  • *****
  • Country: 00
  • Offline Offline
  • Posts: 1290
Re: Sitemap Generator for cpg1.5.x
« Reply #18 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
Logged

flapane

  • Contributor
  • Coppermine frequent poster
  • ***
  • Country: it
  • Offline Offline
  • Gender: Male
  • Posts: 249
    • Flavio's page
Re: Sitemap Generator for cpg1.5.x
« Reply #19 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
Pages: [1] 2   Go Up
 

Page created in 0.03 seconds with 22 queries.