1
0
mirror of https://github.com/e107inc/e107.git synced 2025-01-17 20:58:30 +01:00

Gallery - more template slideshow control

This commit is contained in:
secretr 2012-08-30 13:41:04 +00:00
parent f39f7fe936
commit c90b8aee4b
2 changed files with 21 additions and 9 deletions

View File

@ -141,22 +141,32 @@ class gallery_shortcodes extends e_shortcode
function sc_gallery_slideshow($parm='')
{
$this->sliderCat = ($parm) ? intval($parm) : vartrue(e107::getPlugPref('gallery','slideshow_category'),1);
$this->sliderCat = ($parm) ? $parm : vartrue(e107::getPlugPref('gallery','slideshow_category'),1);
$template = e107::getTemplate('gallery','gallery','SLIDESHOW_WRAPPER');
return e107::getParser()->parseTemplate($template);
}
/**
* All possible parameters
* {GALLERY_SLIDES=4|limit=16&template=MY_SLIDESHOW_SLIDE_ITEM}
* first parameter is always number of slides, default is 3
* limit - (optional) total limit of pcitures to be shown
* template - (optional) template - name of template to be used for parsing the slideshow item
*/
function sc_gallery_slides($parm)
{
$this->slideMode = TRUE;
$amount = ($parm) ? intval($parm) : 3; // vartrue(e107::getPlugPref('gallery','slideshow_perslide'),3);
$tp = e107::getParser();
$limit = varset($gp['slideshow_limit'],16);
$list = e107::getMedia()->getImages('gallery_'.$this->sliderCat,0,$limit);
$item_template = e107::getTemplate('gallery','gallery','SLIDESHOW_SLIDE_ITEM');
$catList = e107::getMedia()->getCategories('gallery');
$cat = $catList['gallery_'.$this->sliderCat];
$tp = e107::getParser();
$this->slideMode = TRUE;
$parms = eHelper::scDualParams($parm);
$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,0,$limit);
$item_template = e107::getTemplate('gallery','gallery', vartrue($parms['template'], 'SLIDESHOW_SLIDE_ITEM'));
$catList = e107::getMedia()->getCategories('gallery');
$cat = $catList['gallery_'.$this->sliderCat];
$count = 1;
foreach($list as $row)

View File

@ -7,6 +7,8 @@
*/
if (!defined('e107_INIT')) { exit; }
e107::plugLan('gallery', 'front');
$text = e107::getParser()->parseTemplate("{GALLERY_SLIDESHOW}");
e107::getRender()->tablerender("Gallery",$text,'gallery_slideshow');
unset($text);