I think people might be talking about different things. Are you talking about an HTML links site map, or a Google format sitemap.xml?
sitemap.xml generation is on my to-do list for my own site's gallery, hopefully I can have something soon. The print_album_menu looks like a very good starting point for it.
# v0.1 # very minimal and initial version of a Sitemap XML generator for ZenPhoto # by Alex Wilson -- http:///alexwilsonphoto.com/ # # usage: # - Set the ZENFOLDER and WEBPATH variable below to match your installation # - Place this file in the root of your website # # Note: # - This currently only creates entries for the root gallery and albums/subalbums, but not images # - Unpublished albums will not be listed # - Password protected albums currently *will* be listed
<?php # v0.1 # very minimal and initial version of a Sitemap XML generator for ZenPhoto # by Alex Wilson -- http:///alexwilsonphoto.com/ # # usage: # - Set the ZENFOLDER and WEBPATH variable below to match your installation # - Place this file in the root of your website # # Note: # - This currently only creates entries for the root gallery and albums/subalbums, but not images # - Unpublished albums will not be listed # - Password protected albums currently *will* be listed
error on line 2 at column 1: Extra content at the end of the document
Below is a rendering of the page up to the first error.`
is the error I got when I copied in the code to "sitemap.php" and put in my root directory. For ZENFOLDER, I left as is. For WEBPATH I entered my domain of my ZP installation.
Comments
I'm also interested to generate sitemap.
thanks.
sitemap.xml generation is on my to-do list for my own site's gallery, hopefully I can have something soon. The print_album_menu looks like a very good starting point for it.
# v0.1
# very minimal and initial version of a Sitemap XML generator for ZenPhoto
# by Alex Wilson -- http:///alexwilsonphoto.com/
#
# usage:
# - Set the ZENFOLDER and WEBPATH variable below to match your installation
# - Place this file in the root of your website
#
# Note:
# - This currently only creates entries for the root gallery and albums/subalbums, but not images
# - Unpublished albums will not be listed
# - Password protected albums currently *will* be listed
This is what i need. This is very good start. Thanks for your hard work.
which lines to be modified pls?
<?php
# v0.1
# very minimal and initial version of a Sitemap XML generator for ZenPhoto
# by Alex Wilson -- http:///alexwilsonphoto.com/
#
# usage:
# - Set the ZENFOLDER and WEBPATH variable below to match your installation
# - Place this file in the root of your website
#
# Note:
# - This currently only creates entries for the root gallery and albums/subalbums, but not images
# - Unpublished albums will not be listed
# - Password protected albums currently *will* be listed
define('ZENFOLDER', 'zp-core');
define('WEBPATH', 'gallery');
header('Content-Type: application/xml');
require_once(WEBPATH . "/" . ZENFOLDER . "/template-functions.php");
$host = htmlentities($_SERVER["HTTP_HOST"], ENT_QUOTES, 'UTF-8');
$base = "http://".$_SERVER['HTTP_HOST']."/".WEBPATH."/";
echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>";
?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<url>
<loc><?php echo $base;?></loc></url><?php
db_connect();
$result = query_full_array("SELECT folder, title, `desc` FROM " . prefix('albums') . " WHERE `show`=1 ORDER BY folder");
foreach ($result as $albums) {
$albumpathnames = explode('/', $albums['folder']);
foreach ($albumpathnames as $key=>$name) {
$albumpathnames[$key] = rawurlencode($name);
}
$albums['folder'] = implode('/', $albumpathnames)."/";
echo " <url>";
echo " <loc>".$base.$albums['folder']."</loc>";
echo " </url>";
}
?>
</urlset>
thanks
error on line 2 at column 1: Extra content at the end of the document
Below is a rendering of the page up to the first error.`
is the error I got when I copied in the code to "sitemap.php" and put in my root directory. For ZENFOLDER, I left as is. For WEBPATH I entered my domain of my ZP installation.