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
Posted in Advanced Usage, DM Albums, Latest News & Announcements | 3 Comments »
3 Responses to “DM Albums External Usage Update”