• twitter image
  • facebook image
  • youtube image
  • linkedin image
Language: CMS Made Simple Czech CMS Made Simple France CMS Made Simple Spain CMS Made Simple Hungary CMS Made Simple Russia CMS Made Simple Netherlands

All times are UTC




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: Fragen zum Gallery-Modul (Gallery - Image)
PostPosted: Mon May 16, 2011 1:25 pm 
Offline
Forum Members
Forum Members

Joined: Wed Nov 29, 2006 9:56 am
Posts: 26
Hallo,

nachdem ich mit dem Album-Modul gut zurecht komme, es aber nicht mehr weiterentwickelt wird, möchte ich zu Gallery wechseln. Ich habe den Code und die Templates studiert und folgende Fragen:

Wie erhalte ich die Anzahl Bilder einer Galerie in der Übersicht ($imagecount ist 0)?
Code:
foreach from=$images item=image}
   <div class="img">
   {if $image->isdir}
      <a href="{$image->file}" title="{$image->titlename}"><img src="{$image->thumb|escape:'url'|replace:'%2F':'/'}" alt="{$image->titlename}" /></a><br />
      {$image->titlename} - {$imagecount}
   {else}...


Ist es möglich, in der Gallery-Übersicht die Thumbnails der Gallerien anzuzeigen?
Gallery 1 - Thumb-Bild 1 - Thumb-Bild 2 - Thumb-Bild 3 - Thumb-Bild 4
Gallery 2 - Thumb-Bild 1 - Thumb-Bild 2
Ich habe im Code (erfolglos) etwas in diese Richtung probiert:
Code:
{foreach from=$images item=image}
   <div class="img">
   {if $image->isdir}
      <a href="{$image->file}" title="{$image->titlename}"><img src="{$image->thumb|escape:'url'|replace:'%2F':'/'}" alt="{$image->titlename}" /></a><br />
      {$image->titlename}

      {foreach from=$image item=detailimage}   <a class="group" href="   {$detailimage->file|escape:'url'|replace:'%2F':'/'}" title="{$detailimage->titlename}" rel="gallery-{$galleryid}"><img src="{$detailimage->thumb|escape:'url'|replace:'%2F':'/'}" alt="{$detailimage->titlename}" /></a>
      {/foreach}
   {/if}
   </div>
{/foreach}


Im Album-Module habe ich im PHP-Code Album um Images erweitert - hier habe ich den Ansatz nicht gefunden :(

Danke für Euren Input!
michael


Top
 Profile  
 
 Post subject: Re: Fragen zum Gallery-Modul (Gallery - Image)
PostPosted: Mon May 16, 2011 1:50 pm 
Offline
Power Poster
Power Poster
User avatar

Joined: Wed Sep 05, 2007 8:03 pm
Posts: 3653
Location: The Netherlands
micfritschi wrote:
Wie erhalte ich die Anzahl Bilder einer Galerie in der Übersicht ($imagecount ist 0)?

Das ist jetzt mit Gallery noch nicht möglich. Wird im nächsten Release eingebaut.


micfritschi wrote:
Ist es möglich, in der Gallery-Übersicht die Thumbnails der Gallerien anzuzeigen?

Das soll man erreichen können mit ein {Gallery dir='...'} call in ein Gallery-Template zu setzen. Ich hab das selber noch nicht gemacht... ich werde auch mal probieren.

_________________
Get nice guestbook messages from your site visitors with the brand new Gbook module.
Integrate Piwik Web Analytics in your site admin with the Piwik module.
Extend your global site settings with the Custom Global Settings module.
The Fourth Dutch CMS Made Simple Workshop on April 9 2011 was great fun! Read all about it here
Announcement: The Fifth Dutch CMS Made Simple Workshop coming up?


Top
 Profile  
 
 Post subject: Re: Fragen zum Gallery-Modul (Gallery - Image)
PostPosted: Mon May 16, 2011 7:04 pm 
Offline
Dev Team Member
Dev Team Member
User avatar

Joined: Tue Aug 12, 2008 9:30 pm
Posts: 1984
Location: Feldkirchen in Kärnten, Austria
Gerade vor kurzem brauchte ich so eine count Funktion.
Gelöst habe ich es mit einem kleinen plugin, natürlich ist es nicht perfekt da auch deaktivierte Bilder gezählt werden aber falls es dir im Moment hilft sieht es so aus.
Code:
<?php

function smarty_cms_function_count_files($params, &$smarty)
{
global $gCms;
   
$dir = 'uploads/images/'.$params['dir'].'';    //create dir parameter
$filecount = 0;
$prefix = substr_count("thumb_",0);  // dont count thumb_ prefix
$d = dir($dir);
while ($f = $d->read()) {
 if(($f!=$prefix) && ($f!= ".") && ($f!= "..")) {
 if(!is_dir($f)) $filecount++; // count files
 } 
}

$smarty->assign('counted', $filecount);  // assign $counted
}

?>


Speichere die Datei im plugins ordner mit namen function.count_files.php

Danach im Gallery template:
Code:
// template vor foreach!!
{foreach from=$images item=image}
{capture assign="set_dir"}Gallery/{$image->filename}/{/capture}{* welche ordner? *}{count_files dir=$set_dir}{* plugin aufruf *}
   {if $image->isdir}
      <li class="thumb"><a href="{$image->file}" title="{$image->titlename}"><img src="{$image->thumb|escape:'url'|replace:'%2F':'/'}" alt="{$image->titlename}" /></a>
<p class="albumname">{$image->titlename}<br />
<span class="albumpicturecount">{$counted}{* zahl ausgeben *}</span><br />
<span class="albumcomment"></span></p>
</li>
   {else}
<li class="thumb"><a class="group" href="{$image->file|escape:'url'|replace:'%2F':'/'}" title="{$image->titlename}" rel="gallery-{$galleryid}"><img src="{$image->thumb|escape:'url'|replace:'%2F':'/'}" alt="{$image->titlename}" /></a></li>
   {/if}
{/foreach}
Template nach foreach!!

_________________
CMSMS Blog - I do this!
Forge profile
Github profile
Twitter
=============================================
Support CMSMS


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Arvixe - A CMSMS Partner