Hi together,
is there a way to get the number of images of albums in a subfolder?
Theres allready a feature request postet some time ago: http://dev.cmsmadesimple.org/feature_request/view/5400
Anybody an idea how to solve this problem?
[semi-solved]Gallery: number of images in folders
-
- Forum Members
- Posts: 137
- Joined: Thu Oct 26, 2006 9:20 am
- Location: Dresden - Saxony - Germany
[semi-solved]Gallery: number of images in folders
Last edited by konsument on Wed Jan 26, 2011 2:16 pm, edited 1 time in total.
Re: Gallery: number of images in folders
The page where you edit a Gallery-template contains an icon which shows you all the template variables you can use with Gallery. You can find it right underneath the first template field.
The same list with variables is also available in the Gallery documentation: http://wiki.cmsmadesimple.org/index.php ... _variables
At this time the number of images is only available in the subgallery itself.
The same list with variables is also available in the Gallery documentation: http://wiki.cmsmadesimple.org/index.php ... _variables
At this time the number of images is only available in the subgallery itself.
-
- Forum Members
- Posts: 137
- Joined: Thu Oct 26, 2006 9:20 am
- Location: Dresden - Saxony - Germany
Re: Gallery: number of images in folders
ok thanks for the info.
Anyway, Ive build my own quick and dirty udt to solve this problem:
The call in the Gallery template is:
This works fine for me, because Ive only one level galleries
Im no programmer at all - Im just happy to solve it for me with this
Anyway, Ive build my own quick and dirty udt to solve this problem:
Code: Select all
global $gCms;
$dir = $gCms->config['root_path'] . DIRECTORY_SEPARATOR .'uploads/images/Gallery/';
$albumdir = $params['gallerydir'];
$d = opendir($dir . $albumdir);
$count = 0;
while(($f = readdir($d)) !== false)
if(ereg('.jpg$', $f))
++$count;
closedir($d);
$finalamount = $count/2;
echo "$finalamount";
Code: Select all
{foreach from=$images item=image}
{if $image->isdir}
{tagname gallerydir=$image->filename} images
{/if}
{/foreach}
Im no programmer at all - Im just happy to solve it for me with this
