This a complete listing of official View Functions that can be used in your Gallery templates. Note that a parameter wrapped in square brackets ([]) is optional.
bam
bam( "gallery", [settings] )
Places Gallery content on the page, customized with the
settings variable. Separate each setting with a comma.
settings
- template template name
- category comma separated list of categories
- order_by
- date default
- title
- simple_title
- id
- user_id
- order_how
- ASC Natural order (for example, alphabetical A-Z, numerical 1-10)
- DESC Default. Reverse order (for example, alphabetical Z-A, numerical 100-1)
- limit maximum number of sets to show
- mode force a View Mode
- list default
- preview
- fullview
- force_display Use this to force displaying of content even if the current View Mode is different.
- library URL location to the View Library, if you have moved it from its default location. Default is [your secretary installation]/library
- clean_urls Any links outputted will be in clean format
- urls_module Text to identify "module" in the URL. For example, www.mypage.com/?module=gallery can be changed to www.mypage.com/?m=gallery
- urls_mode Text to identify "mode" in the URL.
- urls_gallery Text to identify "gallery" in the URL.
- urls_list Text to use for the "list" view. For example, www.mypage.com/?module=gallery&mode=list can be changed to www.mypage.com/?module=gallery&mode=listing
- urls_preview Text to use for the "preview" view.
- urls_fullview Text to use for the "fullview" view.
- urls_id The "id" variable in the URL. For example, www.mypage.com/?module=gallery&mode=fullview&id=my-masterpiece or www.mypage.com/?module=gallery&mode=fullview&id=23.
bam( "gallery", "template= Sommerfugle, category= Dansk Design, Fun, library= http://www.staer.ca/library, urls_module= type, urls_gallery= folio, urls_fullview= view, order_by= title, order_how= ASC" );
ID
set_id()
Prints out (automatically displays) the database ID number of the current set. Useful for creating numbered or anchored links or anything that needs a unique identifier.
get_set_id();
Returns (does not show anything, instead stores the value in computer memory) the database ID number. Useful for use in other functions where a specific set ID needs to be specified.
Selected Set
selected_set()
Prints out the selected set's ID number. The selected set is the one currently being viewed by the user, for example, after he/she clicks on a link to view the full size image.
get_selected_set()
Returns the selected set's ID number.
Title
set_title()
Prints out the set's title.
Simple Title
set_simpletitle()
Prints out the set's simple title, which is the title without spaces, underscores or any non-alphabetical, non-numerical characters. This is also the name of the folder where the set's images are held.
make_simpletitle( text )
Will generate a simple title out of any text. This function removes any whitespace and non-alphanumeric characters. Spaces are converted to dashes.
Author/User
set_author( [info] )
Prints out the requested piece of information about the author/user who created the set.
info
- id
- username default
- display_name
- email
- level_id user level id #
- level user level name
// arne
<?php set_author( "username" ); ?>
// arne
<?php set_author(); ?>
// Arne Jacobsen
<?php set_author( "display_name" ); ?>
// arne@moebler.dk
<?php set_author( "email" ); ?>
// Master
<?php set_author( "level" ); ?>
Date
set_date( [format] )
Prints out the date the set was created.
format
- d - Day of the month, 2 digits with leading zeros
- D - A textual representation of a day, three letters
- j - Day of the month without leading zeros
- l - A full textual representation of the day of the week
- S - English ordinal suffix for the day of the month, 2 characters (st, nd, th). Works well with 'j'.
- F - A full textual representation of a month, such as January or March
- m - Numeric representation of a month, with leading zeros
- M - A short textual representation of a month, three letters
- Y - A full numeric representation of a year, 4 digits
- y - A two digit representation of a year
- Take a look at www.php.net for more
// 23. Mar 1987
<?php set_date(); ?>
// March 23 1987
<?php set_date( "F d Y"); ?>
Description
set_description()
Prints out the set's description.
Related Link Title
Related Link URL
Type
set_type()
Prints out the type.
Cover Image
set_cover_image( [info], [set_id] )
Prints out the requested information about the cover image.
info
- title
- caption
- file - will print out an HTML <img> tag.
- thumbnail - will print out an HTML <img> tag.
set_id
Use this to specify which set's cover image you want to display. If omitted, the currently selected set will be used. Also omit if you want to use the function in a template.
List Thumbnails
set_list_thumbnails( [list_wrapper], [thumb_wrapper], [id] )
Lists all the thumbnails in the given set. Using the "wrappers" you can wrap your thumbnails in any HTML code to create totally custom layouts. Style with your own CSS.
list_wrapper
HTML code to wrap the list in. For example, a <ul> tag.
thumb_wrapper
HTML code to wrap the each thumbnail in. For example, a <li> tag.
id
Use this to specify which set's cover image you want to display. If omitted, the currently selected set will be used.
<?php set_list_thumbnails( '<ul></ul>', '<li></li>' ); ?>
List Images
set_list_images( [list_wrapper], [thumb_wrapper], [id] )
Exactly the same as
List Thumbnails but displays the full-size images instead.
Set Image
set_image( number, [set_id], [number_is_id], [return] )
Displays the image in a set specified by
number. If
set_id is omitted then the currently selected set will be used.
number
The number of the image in the set you would like to display. Note that the image displayed may not always be the same, if you change the order of the images.
set_id
Set ID number. Will access that set's images.
number_is_id true or false
Use this if you know the specific database ID number of the image. Set to
true if
number is the database ID.
return true or false
Set to true to have the function
return an array with all image data - pair with
Set Image Info to retrieve specific information.
Set Image Information
set_image_info( info, number, [set_id], [image] )
Displays the requested requested piece of information about the specified image.
info
- id
- title
- caption
- image displays only the filename
- thumbnail displays only the filename
-
- cover returns either 1 (is the set cover) or 0 (is NOT the set cover)
number
The number of the image in the set you would like to display. Note that the image displayed may not always be the same, if you change the order of the images.
set_id
Set ID number. Will access that set's images.
image
This function can be used to get information about an image, by sending this parameter the result of
Set Image (if
return is set to true).
View Modes
gallery_is_mode( mode )
Returns true or false.
gallery_mode_is_list()
gallery_mode_is_preview()
gallery_mode_is_fullview()
Returns true or false.
gallery_mode()
Returns the current view mode (list, preview or fullview).
Title Link (View Mode)
title_linkToList()
title_linkToPreview()
title_linkToFullview()
Creates a link to the desired View Mode, using the set title as the link text.
View Mode Link
gallery_mode_link( mode )
Generates a link for use in HTML link tags.
<a href="<?php gallery_mode_link( "fullview" ); ?>"><?php set_title(); ?></a>
If Set Is Last
if_this_set_is_last()
Returns true or false. Lets you know if the current set is the last one listed. Useful for adding stylistic markup or showing/hiding certain content depending on the "position" of a set.
If Set Is NOT Last
if_this_set_is_not_last()
Same as
If Set Is Last but returns true if the set is NOT the last one listed.
Category Dropdown Menu
gallery_category_dropdown( [auto switch] )
Generates a dropdown menu of categories. Note that it is automatically given a CSS class named
category_dropdown.
auto switch true or false
Default is true. This will make the dropdown automatically submit the users selection so that they do not need to click a submit button.
Get Categories
gallery_get_categories()
Returns a PHP multi-dimensional array for use in custom formatting of category lists. The array indices are the database ID number of each category, and each sub-array contains a
name and
children key. The children key contains a sub-array of any sub-categories.
Varal ImageSwitcher
gallery_varal_imageswitcher( [set_id] )
Applies the
Varal ImageSwitcher for the specified set. There are many options available to customize how the ImageSwitcher behaves, so make sure to read the documentation. Note that this function automatically includes the ImageSwitcher config file from the Library, so any custom configuration options should made to that file ([your secretary installation]/library/js/varal_imageswitcher/).
set_id
Use this to specify which set's cover image you want to display. If omitted, the currently selected set will be used.
jQuery Cycle
gallery_jquerycycle( [cycle options], [options], [set id]" )
Auto-magically implements the
jQuery Cycle plugin. There are a ton of options to customize the Cycle plugin so do make sure to read the documentation. Options for the plugin itself can be adjusted directly in this function, in the
cycle options parameter.
cycle options
Take a look at the
offical options page.
options
- nav true or false - whether or not to include a navigation section (next/prev links and/or pager)
- pager true or false - whether or not to include numbered links
- nav_pos before or after - where to place the nav in relation to the images
- nextprev true or false - whether or not to include next and previous links
- next_text - whatever text you want used for the next link
- prev_text - whatever text you want used for the previous link
- nextprev_pos apart or together - how the next and previous links should be displayed, next to eachother or separately (apart will put them on opposite sides of the pager)
set_id
Use this to specify which set to display. If omitted, the currently selected set will be used.
<?php gallery_jquerycycle( "fx: 'shuffle', speed: 500", "pager= true", get_set_id() ); ?>
jQuery Lightbox
gallery_jquerylightbox( [lightbox options], [options], [set id] )
Auto-magically implements the
jQuery Lightbox plugin. There are a ton of options to customize the Lightbox plugin so do make sure to read the documentation. Options for the plugin itself can be adjusted directly in this function, in the
lightbox options parameter.
lightbox options
Take a look at the
offical page.
options
-
display
- id
- title
- simple_title
- description
- file_title
- file_caption
- nav_pos before or after - where to place the nav in relation to the images
- nextprev true or false - whether or not to include next and previous links
- next_text - whatever text you want used for the next link
- prev_text - whatever text you want used for the previous link
- nextprev_pos apart or together - how the next and previous links should be displayed, next to eachother or separately (apart will put them on opposite sides of the pager)
set_id
Use this to specify which set's cover image you want to display. If omitted, the currently selected set will be used.
<?php gallery_jquerycycle( "fx: 'shuffle', speed: 500", "pager= true", get_set_id() ); ?>