DM Albums™ External Usage Update November 4th, 2009

In order to make it easier to use DM Albums™ outside your WordPress blog, the Productions has released a new file to the DM Albums™ project called dm-albums-external.php which does all the setup discussed in the article about using DM Albums™ outside your blog.  This file will be available as part of the DM Albums™ distribution starting with v2.3.2 (not yet released as of this writing), but for those of you who want to start using this file now, you can download it and copy it into your dm-albums plugin folder.

dm-albums-external.php does all the setup required for connecting to WordPress and provides a functions called printalbum which makes the call to the plugin function to display the album.   The function definition is:

function dm_printalbum($directory)

The only parameter is $directory which is the filesystem path to your album, relative to your Home Folder setting.  (If you use the absolute path, that’s OK because the printalbum function will fix that for you.)

All you have to do is to include the dm-albums-external.php file into your php script, and call dm_printalbum whereever you’d like to show the album.

Your code should look something like this (you would have to modify your include path to point at the dm-albums-external file correctly):

<?php

include($_SERVER["DOCUMENT_ROOT"] . “/wp-content/plugins/dm-albums/dm-albums-external.php”);

dm_printalbum(“/wp-content/plugins/dm-albums/preview/”);

?>

» View the Demo.

dm-albums-external.php

3 Responses to “DM Albums™ External Usage Update”

  1. Tim Furnish says:

    Hello. So far, I like what I see with the DM albums 2.4.4 plugin for wordpress. I’d like to try out the dm-albums-external.php, but I cannot join the service to download, due to an error with your system. Will this code allow me to make the dm album I create appear within other locations vs. the post feed? I basically want to place it in a div within my template. Is that possible?

    Any help is appreciated.

    Thank you,
    Tim

  2. sotnas says:

    I can’t see my DM Albums Options panel!!!

  3. [...] Added php include for including DM Albums outside your WordPress installation. More information: http://blog.dutchmonkey.com/product-release/dm-albums-external-demo/ [...]

Leave a Comment