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:
- string $before HTML to be rendered before the image
- array $parameters Additional IMG Attributes except src, width and height
- 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:
- string $before HTML to be rendered before the thumbnail
- array $parameters Additional IMG Attributes except src, width and height
- string $after HTML to be rendered after the thumbnail
- array $phpThumbConfiguration The phpThumb configuration
- 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:
- 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:
- string $liClass CSS class of the li tags
- string $keyValueSeparator HTML between EXIF key and EXIF value
- string $htmlBeforeKey HTML to be rendered before the EXIF key
- string $htmlAfterKey HTML to be rendered after the EXIF key
- string $htmlBeforeValue HTML to be rendered before the EXIF value
- string $htmlAfterValue HTML to be rendered after the EXIF value
- 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:
- 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>
One Trackback
[...] Another Photoblog Just another WordPress weblog « Download and Installation YAPB Template functions [...]