NewsFeaturesDownloadsDevelopmentSupportAbout Us
Plugin randomimage

Plugin randomimage

From LifeType Wiki


Name: Random Image

Latest version: 1.0

Download link: http://prdownloads.sourceforge.net/lifetype/1.0randomimage.zip?download

License: GPL

Author: Jon Daley (http://limedaley.com)

[edit] Description

This plugin generates a URL to a random image selected from a given album.

[edit] Configuration

There isn't any configuration necessary except for the template code.

Basic code: <img src="{$randomimage->getImage("PUT_ALBUMNAME_HERE", "IMAGE_TYPE")}" />

PUT_ALBUMNAME_HERE should be the "mangled" name of the album, ie, a name that looks like "this_is_my__album" rather than "This is my $$ album".

IMAGE_TYPE should be one of the following: "PREVIEW", "MEDIUM" or "FULL".


Add the following code to your blog:

{if $randomimage}
  <li>
    <a title="Eden (2006)" href="http://groshlink.net/album/eden_06">
      <img src="{$randomimage->getImage("eden_06", "PREVIEW")}" border="0" />
    </a>
  </li>
  <li>
    <a title="Graduate & Faculty Ministry" href="http://groshlink.net/album/grad
uate__faculty_ministry">
      <img src="{$randomimage->getImage("graduate__faculty_ministry", "PREVIEW")
}" border="0" />
    </a>
  </li>
  <li>
    <a title="Pittsburgh" href="http://groshlink.net/album/pittsburgh">
      <img src="{$randomimage->getImage("pittsburgh", "PREVIEW")}" border="0" />
    </a>
  </li>
{/if}

[edit] Notes

You need to hard-code more code than you should, ie. if I was more diligent in writing a good plugin, but this works for now.