Serendipity ImageSelectorPlus Plugin Beschreibung

Allgemeine Beschreibung

ImageSelectorPlus Plugin wird verwendet, um Änderungen mit Bildern zu erleichtern, insbesondere bei der Einbindung in Artikel.

QuickBlog

Beim Hochladen eines Bildes können Sie es direkt veröffentlichen. Befolgen Sie die Anweisungen über dem QuickBlog Eingabefeld.

Ändern des Aussehens des QuickBlog Eingabefeldes

Das Plugin verwendet eine Template-Datei "plugin_quickblog.tpl", um die eingefügten Bilder anzuzeigen. Indem Sie diese Datei bearbeiten, können Sie das Design der angezeigten Bilder ändern.

Informationen zu Bildern werden in einem Array {$quickblog} gehalten, welches aus mehreren Teilen besteht, die Sie in Ihrer Vorlage verwenden können:

Mehrfaches einbinden von Bildern

Another functionality of this plugin is multiple image insertion. If you write an xml structure in your entry, this plugin then replaces this xml structure by pictures from your media library.

When is it useful?

When you write a blog, where you want to include many pictures in your entries. When you have fifty images and these images numbered in an ascending row, it is lengthy to insert them one by one through the images selector. With this plugin, you can insert all of them using on a single line.

Examples

Example 1 - including parts of gallery

        <mediainsert>
            <gallery name="MyHolidays/" />
            <media type="single" name="pict0034" />
            <media type="single" name="pict0032" />
            <media type="range" prefix="pict00" start="35" stop="52" />
        </mediainsert>
    

This example inserts from the directory "MyHolidays" picture "pict0034", then picture "pict0032" and then all pictures from "pict0035" to "pict0052".

Example 2 - including whole gallery at once

        <mediainsert>
            <gallery name="MyHolidays/" />
            <media type="gallery" />
        </mediainsert>
    

Beispiel 3 - Versteckt Vorschaubilder nach einer bestimmten Bildnummer

        <mediainsert>
            <gallery name="MyHolidays/" />
            <media type="gallery" />
            <media type="hideafter" nr="2" />
        </mediainsert>
    

In diesem Beispiel werden alle Bilder aus dem Verzeichnis "MyHolidays" angezeigt, aber ab dem 3. Bild werden alle folgenden versteckt.

Beispiel 4 - Erzeugt einen Zeilenumbruch nach einer bestimmten Bildnummer

        <mediainsert>
            <gallery name="MyHolidays/" />
            <media type="gallery" />
            <media type="hideafter" nr="15" />
            <media type="picperrow" pr="3" />
        </mediainsert>
    

In diesem Beispiel werden alle Bilder aus dem Verzeichnis "MyHolidays" angezeigt, ab dem 15. Bild werden alle folgenden versteckt. Außerdem erfolgt eine Anordnung in 5 Reihen (15 / 3 = 5), es sind also 3 Bilder pro Reihe sichtbar in 5 Spalten.

Important

The plugin is sensitive to bad xml syntax. So if it is not perfect, for example if you ommit ending backslash in the media tag, it can cause fail to your whole blog!!!

Review of xml tags

<mediainsert>
general container of media insertion
<gallery>
from which gallery to choose the images, attribute name gives the path (prom the directory uploads/ - without the first backslash and WITH the final backslash - "MyHolidays" or "/MyHolidays/" is false. Right is "MyHolidays/".)
<media>
Defines which media to insert, first attribute is "type" and it can have next values:

Modifying the design of inserted galleries

Plugin uses template file "plugin_mediainsert.tpl" to display the inserted pictures. So by modifying it, you can change the design of displayed images.

Information about pictures is stored in an array {$plugin_mediainsert_media} which has these parts you can use in your template:

Unzipping ZIP archives

What it is good for

Typically when you want to upload many pictures at once. You need not to select every image discinctly. Just pack them in the ZIP archive, upload this archive and it will be unzipped on your blog.

Features of unzipping

Auto Resizing of Images

This feature will automatically search through your blog post for images in the form:

<img src="/uploads/myimage.jpg" width="100" height="150" />

When it finds an image tag in this form it will replace the value of 'src' attribute with the path to the image resizing script, serendipity_admin_image_selector.php. The end result would be something like this:

<img src="http://domain.com/serendipity_admin_image_selector.php?serendipity[image]=1&serendipity[disposition]=inline&serendipity[step]=showItem&serendipity[resizeWidth]=100&serendipity[resizeHeight]=150" width="100" height="150" />

This saves you time if you need to use images at multiple resolutions, and can also reduce download times for users. The performance hit is minimal as the image resize is only done once, as is the parsing of img tags.

Notes

  1. Image aspect ratios are maintained.
  2. Only the width or height attribute needs to be specified. If neither is specified then the image tag is ignored
  3. If both the width and height attributes are specified the image will be scaled to fit within this area while maintaining the aspect ratio

Authors

Garvin Hicking, Germany
Vladimir Ajgl (vlada [at] ajgl [dot] cz), Czech Republic, 2007-11-19
User "nogad", http://board.s9y.org/viewtopic.php?f=4&t=20058, 2014-08-22
Ian, 2014-09-04