From 751ce52c1377ce7ebd392c13daf66b84d361b04f Mon Sep 17 00:00:00 2001 From: Cameron Date: Thu, 25 Feb 2016 12:29:17 -0800 Subject: [PATCH] Fixes #1372 - Gallery Slideshow with default category. --- e107_plugins/gallery/admin_gallery.php | 9 +++++---- e107_plugins/gallery/e_shortcode.php | 16 ++++++++++------ 2 files changed, 15 insertions(+), 10 deletions(-) diff --git a/e107_plugins/gallery/admin_gallery.php b/e107_plugins/gallery/admin_gallery.php index 70fe9031f..79b37d1b6 100644 --- a/e107_plugins/gallery/admin_gallery.php +++ b/e107_plugins/gallery/admin_gallery.php @@ -114,13 +114,14 @@ class gallery_cat_admin_ui extends e_admin_ui 'checkboxes' => array('title'=> '', 'type' => null, 'width' =>'5%', 'forced'=> TRUE, 'thclass'=>'center', 'class'=>'center'), // 'media_cat_id' => array('title'=> LAN_ID, 'type' => 'number', 'width' =>'5%', 'forced'=> TRUE, 'readonly'=>TRUE), 'media_cat_image' => array('title'=> LAN_IMAGE, 'type' => 'image', 'data' => 'str', 'width' => '100px', 'thclass' => 'center', 'class'=>'center', 'readParms'=>'thumb=60&thumb_urlraw=0&thumb_aw=60','readonly'=>FALSE, 'batch' => FALSE, 'filter'=>FALSE), - 'media_cat_owner' => array('title'=> "Owner", 'type' => 'hidden', 'width' => 'auto', 'thclass' => 'left', 'readonly'=>FALSE, 'writeParms' =>'value=gallery'), - 'media_cat_category' => array('title'=> LAN_CATEGORY, 'type' => 'hidden', 'width' => 'auto', 'thclass' => 'left', 'readonly'=>TRUE), + 'media_cat_owner' => array('title'=> "Owner", 'type' => 'hidden', 'nolist'=>true, 'width' => 'auto', 'thclass' => 'left', 'readonly'=>FALSE, 'writeParms' =>'value=gallery'), + 'media_cat_category' => array('title'=> LAN_CATEGORY, 'type' => 'hidden', 'nolist'=>true, 'width' => 'auto', 'thclass' => 'left', 'readonly'=>TRUE), 'media_cat_title' => array('title'=> LAN_TITLE, 'type' => 'text', 'width' => 'auto', 'thclass' => 'left', 'readonly'=>FALSE), + 'media_cat_sef' => array('title'=> LAN_SEFURL, 'type'=>'text', 'inline'=>true, 'width'=>'auto', 'thclass' => 'left'), 'media_cat_diz' => array('title'=> LAN_DESCRIPTION, 'type' => 'bbarea', 'width' => '30%', 'readParms' => 'expand=...&truncate=150&bb=1','readonly'=>FALSE), // Display name 'media_cat_class' => array('title'=> LAN_VISIBILITY, 'type' => 'userclass', 'width' => 'auto', 'data' => 'int', 'filter'=>TRUE, 'batch'=>TRUE), - 'media_cat_order' => array('title'=> LAN_ORDER, 'type' => 'text', 'width' => '5%', 'thclass' => 'right', 'class'=> 'right' ), - 'options' => array('title'=> LAN_OPTIONS, 'type' => null, 'width' => '10%', 'forced'=>TRUE, 'thclass' => 'center last', 'class' => 'center') + 'media_cat_order' => array('title'=> LAN_ORDER, 'type' => 'text', 'width' => 'auto', 'thclass' => 'center', 'class'=> 'center' ), + 'options' => array('title'=> LAN_OPTIONS, 'type' => null, 'width' => '5%', 'forced'=>TRUE, 'thclass' => 'center last', 'class' => 'right') ); diff --git a/e107_plugins/gallery/e_shortcode.php b/e107_plugins/gallery/e_shortcode.php index 2a06deced..95e25b19c 100644 --- a/e107_plugins/gallery/e_shortcode.php +++ b/e107_plugins/gallery/e_shortcode.php @@ -186,8 +186,8 @@ class gallery_shortcodes extends e_shortcode $tmpl = e107::getTemplate('gallery','gallery'); $limit = vartrue($parm['limit'], 6); - $list = e107::getMedia()->getImages('gallery_'.$cat.'|gallery_image_'.$cat, 0, $limit); - + $list = e107::getMedia()->getImages('gallery_image|gallery_'.$cat.'|gallery_image_'.$cat, 0, $limit); + if(count($list) < 1 && vartrue($parm['placeholder'])) { $list = array(); @@ -198,7 +198,8 @@ class gallery_shortcodes extends e_shortcode } } - //NOTE: Using tablerender() allows the theme developer to set the number of columns etc using col-xx-xx + //NOTE: Using tablerender() allows the theme developer to set the number of columns etc using col-xx-xx + $text = ''; foreach($list as $val) { $this->var = $val; @@ -226,7 +227,7 @@ class gallery_shortcodes extends e_shortcode $amount = $parms[1] ? intval($parms[1]) : 3; // vartrue(e107::getPlugPref('gallery','slideshow_perslide'),3); $parms = $parms[2]; $limit = (integer) vartrue($parms['limit'], 16); - $list = e107::getMedia()->getImages('gallery_'.$this->sliderCat.'|gallery_image_'.$this->sliderCat,0,$limit); + $list = e107::getMedia()->getImages('gallery_image|gallery_'.$this->sliderCat.'|gallery_image_'.$this->sliderCat,0,$limit); $tmpl = e107::getTemplate('gallery','gallery'); $tmpl = array_change_key_case($tmpl); // change template key to lowercase (BC fix) $tmpl_key = vartrue($parms['template'],'slideshow_slide_item'); @@ -235,6 +236,7 @@ class gallery_shortcodes extends e_shortcode $cat = $catList['gallery_'.$this->sliderCat]; $count = 1; + $inner = ''; foreach($list as $row) { $this->setVars($row) @@ -258,11 +260,13 @@ class gallery_shortcodes extends e_shortcode $inner .= ($count != 1) ? "" : ""; return $inner; } - + + + function sc_gallery_jumper($parm) { // echo "SlideCount=".$this->slideCount; - if($this->slideCount ==1 ){ return "gallery-jumper must be loaded after Gallery-Slides"; } + if($this->slideCount ==1 && deftrue('E107_DBG_BASIC')){ return "gallery-jumper must be loaded after Gallery-Slides"; } $text = ''; for($i=1; $i < ($this->slideCount); $i++)