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 »
DutchMonkey Development Blog
November 3rd, 2009
Productions has launched the Development Blog. This blog is intended to serve as a central location for general support for products. We’ll be posting news and support information here, so check back regularly.
We would also like to thank the community for the wonderful feedback on the latest release of DM Albums. Community involvement and collaboration is what makes the open-source movement a rewarding and productive forum for development.
Posted in Latest News & Announcements | No Comments »
Using DM Albums Outside Your Blog
November 3rd, 2009
Several users have asked how to add DM Albums outside their blogs. Since DM Albums is plugged into your blog by making a reference to an HTML IFRAME that points to your DM Albums app and photo album, this is quite a simple thing.
There are two ways to embed DM Albums into your website outside of WordPress: The WordPress Way (recommended) and the Do-It-Yourself Way.
The WordPress Way
Either way is fine, but lets start with the WordPress way. Suppose your blog is located at http://mydomain.com/blog/ and the website your want to show the DM Album on is located at http://mydomain.com/. Lets also say the page you want to show your album in is called http://mydomain.com/myalbums.php.
First, you’ll have to include the stuff from WordPress that makes WordPress work. That’s pretty easy, since WordPress supplies a file just for this kind of thing. It’s called wp-load.php and all you have to do is include it and your script will know everything there is to know about your blog. The only tricky bit is to figure out where this file lives, relative to your script. For our example, this would be dirname(dirname(__FILE__)) . "/blog/wp-load.php".
Next, we need to know what album it is that we want to show, set through the currdir parameter. DM Albums are really just directories with photos in them (and a file that stores information about your album like captions and an album name). That means we need to know the directory, relative to the Home Directory setting set up in the DM Albums Options panel and set currdir equal to that. Lets use the DM Albums preview album for this purpose, which is located in your DM Albums preview folder here: /wp-content/plugins/dm-albums/preview/. If your Home Directory is set to the default, your currdir would be /blog/wp-content/plugins/dm-albums/preview/.
Finally, all we need to do is call the dm_getalbum with the query string to tell it which album we’re talking about. The complete code looks something like this:
<?php
require_once(dirname(dirname(__FILE__)) . "/blog/wp-load.php");
$currdir = "/wp-content/plugins/dm-albums/preview/";
print(dm_getalbum("?currdir=$currdir"));
?>
This will look exactly like it does in your blog, including all the custom settings you set up in the DM Albums Options panel:
Do-It-Yourself Way
The Do-It-Yourself Way way involves less of the PHP programming, but you still need to know what the currdir should be. (It’s the same as above, except with HTML you can’t use a variable.) The, you just paste some HTML for an IFRAME and you should be all set:
The results should look something like this:
Posted in Advanced Usage, DM Albums | 1 Comment »
DM Albums™ Version 2.3.1 Released
October 29th, 2009
Update October 31, 2009: Productions has released a hardening release 2.3.1 of DM Albums which resolves several minor formatting problems.
Productions has relesed version 2.3 of DM Albums™. This version contains many of the feature requests that came out of the release of DM Albums™ v2.0:
- Album Detail Manager added to allow adding captions and deleting individual photos out of albums.
- Add support for external CSS style sheet for overriding default styles. Place this stylesheet outside the dm-albums plugin directory to ensure WordPress does not delete your stylesheet during automatic updates.
- Continued hardnening of upload/delete security. Thanks to safety of nDarkness.com for continuing to assist in tightening things up.
- Continued expansion of WPMU support and multi-user security. Special thanks to Adam of nDarkness.com for his tireless testing, coding, and recommendations.
- Path mapping and upload permissions updates for more reliable file uploading and album management. If you are having difficulty uploading and seeing your albums, use the recommended default settings as found in the DM Albums Options (Admin) panel.
- PHP EXIF bug fix (for users without EXIF support on their systems.) This most often manifests itself in showing a blank DM Albums Options (Admin) panel.
- Misc PHP Bug fixes
- Misc CSS Bug fixes
Thanks to everyone in the WordPress community for their continued feedback and suggestions.
Posted in Latest News & Announcements | No Comments »
DM Albums™ Version 2.1.1 Released
October 22nd, 2009
Productions has relesed version 2.1.1 of DM Albums™. Hopefully this will be the last of the security updates; we appologize to our user community for the frequent updates while we work to ensure our plugin is as secure as possible. This includes security enhancements and all users are strongly encouraged to upgrade. Version 2.1.1 also includes a minor bug fix.
Posted in Latest News & Announcements | No Comments »