Betreff: Aw: wgGallery Unterkategorien anzeigen von WDC am 16.09.2020 19:33:35
Zitat:
Goffy schrieb:
von der index.php kannst aber den Teil von der tpl auch gleich dazugeben
Im Endeffekt hatte ich das gemacht, was Du in Post 10 geschrieben hast
index.php
unset($albumsAll);
unset($crAlbums);
$catsCount = count($permAlbView);
if ($catsCount > 0) {
$crAlbums = new CriteriaCompo();
$crAlbums->add(new Criteria('alb_id', '(' . implode(',', $permAlbView) . ')', 'IN'));
$crAlbums->setSort('alb_weight ASC, alb_date');
$crAlbums->setOrder('DESC');
$crAlbums->setStart($start);
$crAlbums->setLimit($limit);
$albumsAll = $albumsHandler->getAll($crAlbums);
unset($permAlbView);
if ($catsCount > 0) {
$categories = [];
$counter = 0;
// Get All Albums
foreach (array_keys($albumsAll) as $i) {
$categories[$i] = $albumsAll[$i]->getValuesAlbums();
// count albums
$crSubAlbums = new CriteriaCompo();
$crSubAlbums->add(new Criteria('alb_pid', $categories[$i]['alb_id']));
$nbAlbums = $albumsHandler->getCount($crSubAlbums);
$categories[$i]['nb_albums'] = $nbAlbums;
//check permissions
//$categories[$i]['edit'] = $permissionsHandler->permAlbumEdit($albumsAll[$i]->getVar('alb_id'), $albumsAll[$i]->getVar('alb_submitter'));
//set indicator for line break
$counter++;
if (1 === $counter) {
$categories[$i]['newrow'] = true;
}
if ($number_cols_cat == $counter) {
$categories[$i]['linebreak'] = true;
$counter = 0;
}
$keywords[] = $albumsAll[$i]->getVar('alb_name');
$alTarget = WGGALLERY_URL . '/images.php?op=list';
$alThumb = (2 === $idxAlblist);
if ($gallery) {
$target = WGGALLERY_URL . '/gallery.php?op=show';
}
$albumlist = '<ol class="wgg-alblist-ol">';
$albumlist .= $albumsHandler->getListChildsOfCollectionIndex($categories[$i]['alb_id'], $alTarget, $alThumb);
$albumlist .= '</ol>';
$GLOBALS['xoopsTpl']->assign('albumlist', $albumlist);
}
wggallery_categoryitem_simple.tpl
<a class='' href='index.php?op=list&alb_pid=<{$category.id}>' title='<{$smarty.const._CO_WGGALLERY_COLL_ALBUMS}>'>
<{if $category.image}>
<div class="simpleContainer center">
<img class="img-responsive" src="<{$category.image}>" alt="<{$category.name}>" title="<{$category.name}>">
<div class="simpleContent">
<{if $showTitle}><p><{$category.name}></p><{/if}>
<{if $showDesc}><p><{$category.desc}></p><{/if}>
<!-- <p class="center"><a class='btn btn-primary wg-color1' href='index.php?op=list&alb_pid=<{$category.id}>' title='<{$smarty.const._CO_WGGALLERY_COLL_ALBUMS}>'><{$smarty.const._CO_WGGALLERY_COLL_ALBUMS}></a></p> -->
</div>
</div>
<{/if}>
</a>
<{if $albumlist}>
<div class='wgg-alblist'><{$albumlist}></div>
<{/if}>
|