|
|
This page lists some of the functions that you can use in you FAlbum-enabled website. The first two are particularly helpful in setting up sidebar photo groups, while another use is to place a group of tagged photos in a single post (using the help of a plugin like PHP Exec).
In order to use FAlbum calls within other pages, the 'Enable globally' option must be set to 'true'. This will setup the $falbum object and include the FAlbum style information on every call.
Then for each page that you want to use a FAlbum method, add the following line before the first call:
<?php require_once(ABSPATH.'/wp-content/plugins/falbum/falbum.php'); global $falbum; ?>
$falbum→create_url($parms)
parameters:
The parameter list is a slash-separated list with the names and values of the required UQL querystring. For example, the string “A/B/C/D” will produce A=B&C=D. The supported parameters are:
Example: Will display a linked 'title' to the most recent photos.
<h2><a href="<?php echo $falbum->create_url('show/recent'); ?>" title="View all recent photos">Recent Photos</a></h2>
Example: Will display a single photo.
<h2><a href="<?php echo $falbum->create_url('show/recent/photo/34509222'); ?>" title="View my photo">Picture of mine</a></h2>
$falbum→get_page_title($sep)
parameters:
Example:
<?php if ($falbum->is_album_page()) { ?> <title><?php echo $falbum->get_page_title(); ?></title> <?php } else { ?> <title><?php wp_title(''); ?> <?php if (is_author()) { echo $author_name; } ?> <?php if ( !(is_404()) && (is_single()) or (is_page()) or (is_archive()) ) { ?> at <? } ?> <?php bloginfo('name'); ?></title> <?php } ?>
$falbum→show_random($num, $tags, $style, $size)
parameters:
*[edited by d.casey] errata to above: use lowercase letter for size params. Using uppercase will cause flickr to say “size is currently unavailable”. The letters are: s = square (75×75) t = thumbnail (100×75) m =small (240×180) [- = medium 500×375, though I cannot get this to work at all] b = large (1024x?) o = original (whatever you uploaded)
see documentation here: http://www.flickr.com/services/api/misc.urls.html
Example: Will display 2 random photos with the two tags.
<?php echo $falbum->show_random($num=2, $tags='tag1','tag2'); ?>
Example: Will display 4 random thumbnails.
<?php echo $falbum->show_random(4); ?>
Example by italo: Will display 4 random photos with 1 tag, using the style as set in the Falbum control panel and the small size.
<?php echo $falbum->show_random(4,'tag1',1,'s');?>
explanation: 4 is the number of random photos, tag1 is te name of the tag,1 is the style, and “s” is the small size. Note: in this format, 1 tag is the only correct, 2 tags and more is incorrect.
Example by italo: Will display a random photos with the same tags.
<?php echo $falbum->show_random(4,'tag1,tag2,tag3',1,'s');?>
$falbum→show_recent($num, $style, $size)
parameters:
Example: Will display 3 photos on one line.
<?php echo $falbum->show_recent(3, 1); ?>
Example: Will display 5 photos (using the album settings as set in the Falbum control panel).
<?php echo $falbum->show_recent(5); ?>
Example: Will display 4 thumbnails using the style as set in the Falbum control panel.
<?php echo $falbum->show_recent($num = 4, $style = 1); ?>