NP_PopupImageGD2

PopupImageGD2 is a Nucleus plugin that automatically generates popup thumbnails using the GD Image Library which is installed on nearly every account with PHP support.

Based on Till Gerken's NP_PopupImage plugin, Roberto Bolli's NetPBM hack of same, and Christian Heilmann's thumbnail generator from "How to create thumbnails with PHP and gd".

This plugin works like the original PopupImage plugin: it creates inline images with an automatically generated thumbnail and a popup link to the full version. Thumbnails will automatically be stored in the media directory of your blog. If deleted, they will be regenerated the next time somebody tries to look at an item containing an image. You can force an update of your thumbnails simply deleting them.

General Plugin info
Author: Eoin Dubsky
Current Version: 0.40
Download: np_popupimagegd2_v040.zip
Code: code
Demo: -
Forum Thread: Forum Thread

Requirements

Requires the GD library. It will automatically work with GD version 2 or better.

If you have an older version of GD (like one which still creates GIFs), you'll need to change “ImageCreateTrueColor” to “ImageCreate” and “ImageCopyResampled” to “ImageCopyResized”.

Download & Installation

You have two posiibilities:

  • Download the zip file and extract it.
  • Copy the code for this plugin and save it to NP_PopupImageGD2.php. Take care that there is no redundant white space at the beginning or end of the file!

Then upload the file to yoursite.com/nucleus/plugins. Go to the plugin overview page from the admin area and edit the plugin options. Finally, edit your templates as described under 'How it works'.

How it works

Upload the file in the normal way. Before you choose the file entry for the image you should switch from inline to popup. Otherwise you have to change the tag <%image()%> to <%popup()%> manually.

Add an alignment as shown beneath.

Available SkinVars and/or TemplateVars

  • <%popup (filename|width|hight|caption)%>
  • <%popup (filename|width|hight|caption|alignment)%> with alignment=left, center oder right

Examples:

  • <%popup(20060402-picture.jpg|600|400|A nice picture)%>
  • <%popup(20060402-picture.jpg|600|400|A nice picture|left)%>
  • <%popup(20060402-picture.jpg|600|400|A nice picture|center)%>
  • <%popup(20060402-picture.jpg|600|400|A nice picture|right)%>

Options

You can configure this plugin from the Nucleus plugin page. The automatically created thumbnails will be stored in the media directory of the blog and will be regenerated if they don't exist. So you can force them to be updated by simply deleting all thumbnails.

  • Maximum thumbnails width in pixel (default: 160)
  • Maximum thumbnails height in pixel (default: 160)
  • Maintain aspect ratio (yes/no)
  • Prefix for thumbnails (if blank it will be set to 'thumb_')
  • Style for left alignment (default: 'float: left; margin: 0 1em 1em 0;')
  • Style for center alignment (default: 'width: 100%; text-align: center;')
  • Style for right alignment (default: 'float: right; margin: 0 0 1em 1em;')
  • Apply popup behaviour also to <%image()%> tags (yes/no) (default:no)

History

  • v0.30:
    • larger default size
    • support for fancy urls
    • option: show caption (yes/no)
    • parameter for thumbnail alignment added
  • v0.40:
    • option: Apply popup behaviour also to <%image()%> tags (yes/no)

Terms

Released under the terms of the GPL. © 2004 by Eoin Dubsky eoin@free.fr

Based on:

  1. PopupImageNetPBM © 2003 by Roberto Bolli http://www.rbnet.it/
  2. PopupImage © 2003 by Till Gerken http://www.tillgerken.de/

:: Back to Plugins Overview ::

popupimagegd.txt · Last modified: 2006/07/05 13:03 (external edit)
 
Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Noncommercial-Share Alike 3.0 Unported
Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki