ZENpressed

ZENpressed is a ZENphoto-integration-plugin for WordPress based on ZenShow by Rui Cruz and my old ZENphoto-insert-plugin. I also got inspired by the simple mp3 player plugin on how to do the Quicktag.

contact

If you have any comments or suggestions just leave a message here.

download

change log

0.8

  • functions now support multiple albums as array - see examples below (description for mulitple albums is omitted)

0.7

  • included new option to control the image size in lightbox (global, per function, with the tag and option in widget)
  • included new functions for showing most viewed and least viewed photos (select = mostviewd or leastviewed - both need a hack to your zenphoto installation - more about it here)

0.6

  • included a maybe-fix for people getting their main wpdb changed after zenpressed calls

0.5

  • wp_lightbox2 support (needs wp_lightbox2 plugin...)
  • a simple widget for adding photos to the sidebar without the need for execphp-widget
  • fixed a bug that prevented photo title and description from showing up
  • the random and latest options/attributes are now the values of the new option/attribute select

0.4

  • renamed to ZENpressed (all variables and functions too)
  • added zenpressed_photos to show a bunch of photos or a whole album (also an abstraction to latestphotos and ramdomphotos)
  • show whole or partial albums unordert, random ordered or ordered by latest in your posts (just leave out the image attribute in the zen tag)
  • leave out the album and the image attribute in your zen tag and it will select the photos from the whole gallery
  • fixed a bug in the output code that applied the class parameter to the title of the photo not the img-tag
  • the output of multiple photos is now wrapped in a div with class “zp_photos”
  • the output of an album may now include the albumt title and description (showalbumtitle, showalbumdescription)
  • some more error handling (it still lets you shoot yourself in your foot)
  • insert photos by id into your posts
  • append additional css-class to image
  • added link to this wiki in the admin-panel
  • tested with ZENphoto 1.0.1 Beta and 1.0.3 Beta

0.3

  • fixed a typo which prevented zenpress from working without niceurls on

0.2

  • speed-up insertion of one photo (through function or post-filter) with given image name and album name and without showing title and description by only constructing urls and omitting the sql-query.
  • some error handling (zenpress_photo and zenpress_photobyid)

features

  • supports zenphoto in the same or another db (or even server)
  • latest photos, random photos and photo insert functions for use in tempaltes and widgets (get execphp widget)
  • custom tag (<zen>) for inserting photos and albums into posts
  • a quick-tag to simplify adding fotos to your posts
  • customize every parameter (per call or tag)
  • wp_lightbox2 support (needs wp_lightbox2 plugin...)
  • sidebar widget
  • easy-to-hack™

roadmap

  • handydany ajax editor insert support (like flickr post) - in the meantime use the zenpress plugin if the quicktag is not your taste

install

Just copy zenpressed.php to your plugin directory, activate it and visit the options dialog (options→zenpressed) and save your options at least once (also after upgrade). If you also wanna use the ZENpressed widget copy zenpressedwidget.php to your plugin directory, activate it and add the widget to your sidebar (presentation→sidebar widgets).

overriding the default parameters

Every of ZENpressed functions takes as last parameter an associative array in which you may override as many default parameters as u like. You may also use any of this as attributes of the zen-tag in your posts to override parameters.

  • otherdb is zenphoto in another db (on/off)
  • server hostname of the db server (localhost)
  • db db name
  • username db username
  • password db password
  • prefix table prefix (zen_)
  • url zenphoto base url
  • niceurls use nice urls
  • size size of the inserted images (in pixel or thumb)
  • showtitle print image title (on/off)
  • showdescription print image description (on/off)
  • class css-class of an image (→ zp_image.classname)
  • count how many images should be displayed
  • select select the images order (latest,random,’‘)
  • showalbumtitle print album title (on/off)
  • showalbumdescription print album description (on/off)
  • lightbox use lightbox links (on/off) (requires wp_lightbox2)
  • lightbox_size size of the linked images when using lightbox

functions

All these functions are great for your sidebar.

photos

show a whole album with its description

zenpressed_photos( "albumname", array( "count" => "all", "showalbumdescription" => "on" ) );

show the whole gallery

zenpressed_photos( null, array( "count" => "all" ) );

show multiple albums

zenpressed_photos( array( "albumname1", "albumname2" ), array( "count" => "all" ) );

latest photos

show latest photos from all albums

zenpressed_latestphotos( );

show latest photos from album

zenpressed_latestphotos( "albumname" );

show the 8 most recent photos in album with size 320

zenpressed_latestphotos( "albumname", array( "count" => "8", "size" => "320" ) );

show 10 most recent photos from multiple albums

zenpressed_latestphotos( array( "albumname1", "albumname2" ), array( "count" => "10" ) );

random photos

show random photos from all albums

zenpressed_randomphotos( );

show random photos from album

zenpressed_randomphotos( "albumname" );

show 16 random photos from all albums without title

zenpressed_randomphotos( null, array( "count" => "16", "showtitle" => "off" ) );

show 4 random photos from multiple albums

zenpressed_randomphotos( array( "albumname1", "albumname2" ), array( "count" => "4" ) );

photo

show photo

zenpressed_photo( "jada.jpg", "albumname" );

if the imagename is unique you even can forget about the album

zenpressed_photo( "jada666.jpg" );

show photo by id

zenpressed_photobyid( 11 )

the zen-tag

to insert a image into a post with class “photo” (→ zp_image.photo)

<zen image="jada.jpg" album="albumname" class="photo" />

like with the functions you can override any default parameter with the appropriate attribute.

<zen image="jada666.jpg" size="512" showdescription="on" />

you also can just copy the album/image part of the zenphoto url you wanna show

<zen url="albumname/jada333.jpg" />

insert a whole album into a post

<zen album="albumname" count="all" size="thumb" />

insert 8 random photos from an album and show the albums title and description

<zen album="albumname" count="8" select="random" showalbumtitle="on" showalbumdescription="on" />

insert the 3 most recent (by id) photos from the whole gallery with title

<zen count="3" select="latest" showtitle="on" />

style

the HTML output for every image looks like this:

<div class="zp_photo">
   <a href="url" title="title" class="zp_link">
      <img src="source" alt="title" class="zp_image classname" />
      <div class="zp_title">title</div>
   </a>
   <div class="zp_description">description</div>
</div>

if there is more than one photo to show all photo blocks (see above) are wrapped with this:

<div class="zp_photos">
   <div class="zp_albumtitle">albumtitle</div>
   <div class="zp_albumdescription">albumdescription</div>
   
   {zp_photo}
 
</div>
 
wordpress/zenpressed.txt · Zuletzt geändert: 2008/03/14 00:56 von n00bian
 
Recent changes RSS feed Creative Commons License Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki