Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //----Gallery Page Short Code-----------
- public static function Gallery($atts){
- if (!function_exists('getfilters')){
- function getfilters($gal){
- $filters = array();
- foreach($gal as $item){
- $filters = array_merge($filters,wp_get_object_terms($item->pid, 'ngg_tag', 'fields=names'));
- }
- $filters = array_unique($filters);
- foreach($filters as $filter){
- $html .= '<li><a id="'.$filter.'"><span>'.$filter.'</span></a></li>';
- }
- return $html;
- }
- }
- if (!function_exists('toHTML')){
- function toHTML($gal){
- global $nggdb;
- $html = '';
- $html .= ' <div class="smaller-title border">
- <h2 class="category-title">'.gettitle($gal).'</h2>
- </div>';
- $html .= '<div class="gal-wrapper">
- <ul class="images-gallery" id="all">';
- $elid = 0;
- foreach($gal as $item){
- $elid++;
- $picture = nggdb::find_image($item->pid);
- $html .= '
- <li class="'.implode(' ', wp_get_object_terms($item->pid, 'ngg_tag', 'fields=names')).'" data-id="'.$elid.'">
- <div class="ic_container"><a title="'.stripslashes(nggGallery::i18n($item->alttext)).'" rel="group" href="'.$picture->imageURL.'"><img src="'.$picture->thumbURL.'" alt="Hello World" /></a>
- <div class="ic_caption">
- <h3>'.stripslashes(nggGallery::i18n($item->alttext)).'</h3>
- <p class="ic_text">'.$item->description.'</p>
- <p>'.nggcf_get_field($item->pid, 'YOUR CUSTOM FIELD NAME HERE').'</p>
- </div>
- </div></li>';
- }
- $html .= ' </ul><div class="clear"></div>
- </div>';
- return $html;
- }
- }
- //----we have to check if there is a nextGenGalleryPlugin
- if (class_exists('nggLoader')){
- extract( shortcode_atts( array(
- 'id' => 0,
- ), $atts ) );
- $gallery = getGallery($id);
- return toHTML($gallery);
- //if there is no nextGenGallery tell to get one
- }
- else {
- TiAdminPanel::AlertNow('error','NextGen Gallery plugin is not installed. I can not show you the gallery');
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement