nggShowImageBrowser

Show an image browser.

Description

nggShowImageBrowser( (int|string) $galleryID, (string) $template = '' ); 

Parameters (2)

0. $galleryid (int|string)
Or gallery name
1. $template — Optional. (string) => ''
name for a template file, look for imagebrowser-$template

Usage

  1. if ( !function_exists( 'nggShowImageBrowser' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'nextcellent-gallery/nggfunctions.php'; 
  3.  
  4. // or gallery name 
  5. $galleryid = null; 
  6.  
  7. // (optional) name for a template file, look for imagebrowser-$template 
  8. $template = ''; 
  9.  
  10. // NOTICE! Understand what this does before running. 
  11. $result = nggShowImageBrowser($galleryid, $template); 
  12.  

Defined (1)

The function is defined in the following location(s).

/nggfunctions.php  
  1. function nggShowImageBrowser($galleryID, $template = '') { 
  2.  
  3. global $wpdb, $nggdb; 
  4.  
  5. $ngg_options = nggGallery::get_option(ngg_options); 
  6.  
  7. //Set sort order value, if not used (upgrade issue) 
  8. $ngg_options['galSort'] = ($ngg_options['galSort']) ? $ngg_options['galSort'] : 'pid'; 
  9. $ngg_options['galSortDir'] = ($ngg_options['galSortDir'] == 'DESC') ? 'DESC' : 'ASC'; 
  10.  
  11. // get the pictures 
  12. //20140106:shouldn't call it statically if is not... 
  13. //$picturelist = nggdb::get_gallery($galleryID, $ngg_options['galSort'], $ngg_options['galSortDir']); 
  14. //return array of nggImages 
  15. $picturelist = $nggdb->get_gallery($galleryID, $ngg_options['galSort'], $ngg_options['galSortDir']); 
  16.  
  17. if ( is_array($picturelist) ) 
  18. $out = nggCreateImageBrowser($picturelist, $template); 
  19. else 
  20. $out = __('[Gallery not found]', 'nggallery'); 
  21.  
  22. $out = apply_filters('ngg_show_imagebrowser_content', $out, $galleryID); 
  23.  
  24. return $out; 
  25.