This plugin constructs an image slideshow, with start/stop/next/previous buttons and numbered image buttons. I wanted to use nucleus blogs to display photos, to use the flexibility and structure of nucleus, rather than an extra-nucleus script. Now each item in our images blog is a separate 'slideshow'. To add a mnew set of images, I just add an image directory and a quick blog item to reference the directory's name.
| General Plugin info | |
|---|---|
| Author: | David Reese |
| Current Version: | 0.1 |
| Download: | NP_photolog.zip |
| Code: | np_photolog_code |
| Demo: | - |
| Forum Thread: | here |
Its installation isn't completely straightforward but don't panic, it's easy. Here's the drill:
include this in your header (change the directory to suit your installation):
<script type="text/javascript" src="/nucleus/javascript/photolog.js"></script>
include a reference to the slide item (in its special template), wherever on the skin you want the slide:
<%item(slideshow)%>
and include this javascript in the body, somewhere AFTER the call to the item call <%item(mytemplate)%>:
<SCRIPT type="text/javascript"> <!-- if (document.images) { // Tell the slideshow which image to update SLIDES.set_image(document.images.SLIDESIMG); // Uncomment the following line if you want the slideshow to start automatically // SLIDES.play(); } //--> </SCRIPT>
NOTE: the plugin outputs DIVs for only four parts of the show: .slide (the actual image) .controltext (the box where the controls go) .controlleft (the start stop prev next controls) .controlright (the 1.2.3... numbers (or images) to select individual images these two are optional, can be included in your skin .phototitle (a title of the photo: actually, the 'body' text of your blog .pleasewait (a little note to appear underneath the photos until the first loads)
Called from the template, the plugin decends into /photologdir/itemtitle/ (photolog is set in the plugin settings). It counts the number of files (all must be images, at this point), and outputs two things:
<!-- ==== the slideshow control box ==== -->
<div class="controltext">
<span class="controlleft">
<A HREF="javascript:SLIDES.next();SLIDES.play()"
TITLE="$startphrase">$startword</A>$betweencontrol
<A HREF="javascript:SLIDES.pause()"
TITLE="$stopphrase">
$stopword</A>$betweencontrol
<A HREF="javascript:SLIDES.previous()"
TITLE="$prevphrase">
$prevword</A>$betweencontrol
<A HREF="javascript:SLIDES.next()"
TITLE="$nextphrase">
$nextword</A></span>
<span class="controlright">
<a href=\"javascript:SLIDES.goto_slide(1)" $prenum1$postnum </a>$betweennum </a>
<a href=\"javascript:SLIDES.goto_slide(2)" $prenum2$postnum </a>$betweennum </a>
<a href=\"javascript:SLIDES.goto_slide(3)" $prenum3$postnum </a>$betweennum </a>
[...and so on with the numbers]
</span>
</div>
To see an example (dated and now without a good CSS file, but you see the numbers and colons), go to Unglued-photolog. NOTE THAT on my current web page's new skin. I've altered the script and taken out the individual slide links.
let me know at unglued if you have any problems!
What you're doing with the options is “skinning” the plugin. (I bet there's an easier way. Please tell me.)
With the code example above, you can see where the options appear in the final HTML. The default options work fine, start from there.
On the example site, I use text exclusively, but you could just as easily use images in place of “start” “stop”, etc., and in place of the numbers. Just include '<img src=“controls/img' for the prenumber setting, '.jpg”>' for the postnumber string, and the plugin will insert a number between them.
This is my first php, first plugin, all that. It's clearly hacked, and there are certainly improvements to be made. Thanks to Barelyfitz for the javascript. It's GNU licensed, so I guess my plugin is too :)
TrenT placed a detailed description in the support forum detailing his installation, step by step.
:: Plugins ::