sitemap

Hello,
how add a sitemap to zenphoto?
Does this function exist yet?

Thanks

Comments

  • acrylian Administrator, Developer
    No, we don't have a site map, but you could use the print_album_menu which is located in zp-core/plug-ins. For usage please see the functions guide.
  • Hello,
    I'm also interested to generate sitemap.

    thanks.
  • 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.
  • http://alexwilson.dyndns.org/filez/sitemap_gallery01.zip

    # 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
  • acrylian Administrator, Developer
    If you develop that further, maybe you could set up a page for it, so that we can link from our extensions page to it?
  • Hello AlexWilson,

    This is what i need. This is very good start. Thanks for your hard work.
  • bill61 Member
    hi AlexWilson

    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
  • `This page contains the following errors:

    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.
Sign In or Register to comment.