YAPB Template functions

Obtain full control over the output of your photoblog - With the template functions offered by YAPB. By adapting your theme manually, you may display images, thumbnails, exif data and much more where and when you want.

yapb_is_photoblog_post

Function returns wheter this post is a photoblog post or not.

Parameters

No Parameters

Returns

boolean (true|false) if this post is a YAPB post with attached image.

Sample usage:

<?php if (yapb_is_photoblog_post()): ?>HOHOHO<?php endif ?>

yapb_get_image

Function returns an image tag according to the given parameters

Parameters:

  1. string $before HTML to be rendered before the image
  2. array $parameters Additional IMG Attributes except src, width and height
  3. string $after HTML to be rendered after the image

Returns

a string containing the image tag

Sample Usage:

<?php echo yapb_get_image('<div>', array('alt' => 'This is an image'), '</div>'); ?>

yapb_image

Same as yapb_get_image (See above) - It just prints out the result instead of returning it

Parameters:

Same as yapb_get_image

Sample Usage:

<?php yapb_image('<div>', array('alt' => 'This is an image'), '</div>'); ?>

yapb_get_thumbnail

Function returns an thumbnail image tag according to the given parameters

Parameters:

  1. string $before HTML to be rendered before the thumbnail
  2. array $parameters Additional IMG Attributes except src, width and height
  3. string $after HTML to be rendered after the thumbnail
  4. array $phpThumbConfiguration The phpThumb configuration
  5. string $class Additional CSS Class of the image

Returns

a string containing the image tag

Sample Usage:

 <?php echo yapb_get_thumbnail('<div>', array('alt' => 'This is a thumbnail', 'rel' => 'lightbox'), '</div>', array('w=200', 'q=90'), 'thumbnail'); ?>

As you can see above, this code sample is also an example on how to include the lightbox.js script.

yapb_thumbnail

Same as yapb_get_thumbnail (See above) - It just prints out the result instead of returning it

Parameters:

Same as yapb_get_thumbnail

Sample Usage:

<?php yapb_thumbnail('<div>', array('alt' => 'This is a thumbnail'), '</div>', array('w=200', 'q=90'), 'thumbnail'); ?>

yapb_get_exif

functions returns a list of the exif tokens if available

Parameters:

  1. boolean $flagUnfiltered No EXIF-tag filtering if true - Return all EXIF tokens

Returns

assoziative array containing all (filtered) EXIF tokens

Sample Usage:

<?php $theWonderfulExif = yapb_get_exif() ?>

yapb_exif

literally the same as the function above - It just prints out the exif tags and gives you some parameters so you can customize the output.

Parameters:

  1. string $liClass CSS class of the li tags
  2. string $keyValueSeparator HTML between EXIF key and EXIF value
  3. string $htmlBeforeKey HTML to be rendered before the EXIF key
  4. string $htmlAfterKey HTML to be rendered after the EXIF key
  5. string $htmlBeforeValue HTML to be rendered before the EXIF value
  6. string $htmlAfterValue HTML to be rendered after the EXIF value
  7. boolean $flagUnfiltered No EXIF-tag filtering if true - Return all EXIF tokens

Sample Usage:

<h3>EXIF</h3><ul><?php yapb_exif('exiftag', ':', '<strong>', '</strong>', '<i>', '</i>') ?></ul>

yapb_get_alternative_image_formats

Returns a listitems with links to alternatively provided image sizes. It will only return image sizes lower or equal that the original uploaded file. The array availableSizes contains should contain a list of all sizes to be provided: The number gets mapped to the longer side of the image.

Parameters:

  1. array $availableSizes An array containing all max. sizes to be made available

Returns

string containing some li’s

Sample Usage:

<h3>Alternative Image Formats</h3><ul><?php echo yapb_get_alternative_image_formats(array(1600, 1024, 800, 640, 320)) ?></ul>

yapb_alternative_image_formats

Basicly the same as above - Just prints out the result

Parameters:

Same as above

Sample Usage:

 <h3>Alternative Image Formats</h3><ul><?php yapb_alternative_image_formats(array(1600, 1024, 800, 640, 320)) ?></ul>
This entry was posted in Uncategorized. Bookmark the permalink. Post a comment or leave a trackback: Trackback URL.

One Trackback

  1. [...] Another Photoblog Just another WordPress weblog « Download and Installation YAPB Template functions [...]

Post a Comment

Your email is never published nor shared. Required fields are marked *

*
*

Subscribe without commenting