Alright...;-) The code for the button on admin overview is already there (commented out currently) but I could not get it to display on that page and currently don't know why that is so. Well, even developers missed something sometimes..;-)
Btw, you/we could think about changing the plugin to use the object model framework later.
@tenzer: I am working on some more changes. I just noticed that I completly overlooked that it had a password breach (subalbums inherit from parents!). Sadly this required to split the plugin into two files: The plugin file and a sidemap.php file that works like the rss files. Will shortly post it for you to look at.
@acrylian Hmm, I haven't had a use for Zenpage yet, and hence I haven't played with it, so I'm not really sure what that means? Does the plugin breach the security of Zenphoto/Zenpage?
I would really like to keep the plugin in one file in order to keep it simple to use. Simply drop it into the correct folder, activate the plugin and it should work. Why would there be a need for two files?
No, as written the password breach is for the albums. It is not enough to check for password = '' in a query as it will be empty for an subalbum whose parent is protected. But the subalbum in Zenphoto inherits the protection from the parent, thus an extra check is needed.
The split into two files is necessary because somehow one internal function for this check does not work with the single file solution as it is not available and caused a fatal error.
Of course if you don't use album passwords/album user assignments you don't need that but we want to have a general plugin, don't we?
The usage is still very easy, drop the zenphoto-sitemap.php plugin into the plugins folder and then drop the sitemap.php file into the root. Done. Not really that complicated. If the plugin is disabled sitemap.php returns a 404 not found.
Okay, I get you now. Thank you for clarifying. I don't think the check would be that hard to do inside the plugin. It's probably a matter of first getting all 'root level' albums without passwords, then get their sub-albums without passwords, and so on. It will require a SQL query for each level of albums there is, but I don't think that is that bad.
If there is already functions inside Zenphoto to do this check, then it would of course be better to use those.
Well, those function inside Zenphoto are the problem. You can see within the image_album_statistics plugin how this check should be done using checkAlbumPassword(). But somehow the zp_loggedin() function that is used within that causes said fatal error.
I am actually wondering about that. I will have to consult sbillard on that next week.
I have uploaded my changes: http://zenphoto.maltem.de/uploaded/zenphoto-sitemap-extended2.zip
Now there is also support for the and (the latter manually only). Also I cleaned up the code to use some function you did manually originally although we have functions for it and additonally there is now finally a "sitemap clear button" on the admin overview page. Because of the strangely not defined zp_loggedin() function anyone with overview rights can clear the cache.
Please take a look if you have the time! It's also running on that demo site (called as said via /sitemap.php).
@Tenzer: I wanted to let you know that I have decided to make my sitemap plugin extension an official plugin. It is named "zenphoto-sizemap-extended" so it is not confused with yours (of course it is noted that it's based on your plugin). It's in tonight's nightly.
Hello,
I have been using the site map plugin 2.0 with Zenphoto version 1.2.8 and easily installed it by placing the sitemap.php file in my plugins folder.
I would like to try your new zenphoto-sitemap-extended. I downloaded the nightly (4-5-2010) as suggested and put that sitemap.php file in the plugins folder (also enabled sitemap in admin), but when I tried to access my site it returned errors. Also in the admin plugins "sitemap" simply shows up as "sitemap" it isn't bold followed by a version number like the other plugins. Do I need other updated files besides the sitemap.php?
Thank-you
Yes, the new plugin consists of two files
sitemap.php -> root of Zenphoto were rss.php is for example. This is the actual sitemap file that is called via /sitemap.php and generates it.
sitemap-extended.php -> put into zp-core/zp-extensions (since it is offficial). These is the actual plugin that provides the functions for sitemap generation.
As mentioned above the split was necessary because of an internal check for album password protection that otherwise does not work.
Note it has only been tested with the nightly and for Zenpage support it requires the nightly because of a change. It is never recommended to mix files from releases.
Thank-you acrylian. My sitemap is generated when I use myurl/sitemap.php. So then I submit myurl/sitemap.php to the search engines instead of myurl/?sitemap. ?
It looks like there's been a lot of development on this in the last couple weeks, so I'm a little late to the game. I wrote a revision to the original plugin to implement page, news, album, and image support and have the lastmod report the last updated change or the latest comment. Here's what I have:
http://t413.com/news/zenphoto-site-map-seo
I hope it's still somewhat relevant, and I'd be happy to help with improving it more. I've debugged it with google's sitemap evaluation tool.
Well, especially as my version will be official now...;-) Anyway, there is room enough. Of course I am also open for feedback on my version. Joing forces to make the ultimate general Zenphoto sitemap plugin is also an option of course.
I have rougly looked at it:
You might want to look at my version as you do some stuff like the path encoding for slashes or rewrite/none rewrite link we have already convenient functions for.
Using lastchange for pages/articles is a good idea. I forgot about thattotally, I will add that to mine, too.
Update: You might want to note that your plugin is PHP 5.1.1+ only because of the date constant DATE_W3C.