Strict Standards: Declaration of action_plugin_dlcount::register() should be compatible with DokuWiki_Action_Plugin::register($controller) in /home/www/wiki/lib/plugins/dlcount/action.php on line 14

Strict Standards: Declaration of action_plugin_indexmenu::register() should be compatible with DokuWiki_Action_Plugin::register($controller) in /home/www/wiki/lib/plugins/indexmenu/action.php on line 169

Strict Standards: Declaration of action_plugin_ipban::register() should be compatible with DokuWiki_Action_Plugin::register($controller) in /home/www/wiki/lib/plugins/ipban/action.php on line 67

Strict Standards: Declaration of action_plugin_loglog::register() should be compatible with DokuWiki_Action_Plugin::register($controller) in /home/www/wiki/lib/plugins/loglog/action.php on line 82

Strict Standards: Declaration of action_plugin_navi::register() should be compatible with DokuWiki_Action_Plugin::register($controller) in /home/www/wiki/lib/plugins/navi/action.php on line 46

Strict Standards: Declaration of action_plugin_uparrow::register() should be compatible with DokuWiki_Action_Plugin::register($controller) in /home/www/wiki/lib/plugins/uparrow/action.php on line 69

Strict Standards: Declaration of action_plugin_userspagecreate::register() should be compatible with DokuWiki_Action_Plugin::register($controller) in /home/www/wiki/lib/plugins/userspagecreate/action.php on line 97

Strict Standards: Declaration of cache_instructions::retrieveCache() should be compatible with cache::retrieveCache($clean = true) in /home/www/wiki/inc/cache.php on line 289

Warning: Cannot modify header information - headers already sent by (output started at /home/www/wiki/lib/plugins/dlcount/action.php:14) in /home/www/wiki/inc/auth.php on line 312

Strict Standards: Only variables should be passed by reference in /home/www/wiki/doku.php on line 71

Warning: Cannot modify header information - headers already sent by (output started at /home/www/wiki/lib/plugins/dlcount/action.php:14) in /home/www/wiki/inc/actions.php on line 154
Zufallsbilder (Template) [phpwcms-HowTo:wiki]

Strict Standards: Declaration of syntax_plugin_code::render() should be compatible with DokuWiki_Syntax_Plugin::render($format, &$renderer, $data) in /home/www/wiki/lib/plugins/code/syntax.php on line 41

Strict Standards: Declaration of syntax_plugin_tip::render() should be compatible with DokuWiki_Syntax_Plugin::render($format, &$renderer, $data) in /home/www/wiki/lib/plugins/tip/syntax.php on line 38

Zufallsbilder (Template)

Zeigt die Bilder zufällig neu sortiert aus einem Bilderset der CPs Bilder <div>/spezial

Die Anzahl der Bilder kann eingestellt werden.


Docu: –
Forum: Display random image from filemanager

Autor: K.Heermann (flip-flop) http://planmatrix.de 2012/03/23
CMS Version: >= V1.39
Version: V1.0
Update:

Tag:

Dateiname: random_images.tmpl
Verzeichnis: /template/inc_cntpart/images/

Bedingung: $phpwcms['allow_cntPHP_rt'] = 1;/config/phpwcms/conf.inc.php




Inspiriert durch den Beitrag vom User “breitsch” zu diesem Thema stelle ich hier eine andere generelle Lösung vor, die auf den Templates für “Bilder <div>” oder “Bilder spezial” aufbaut.

Dieses Template kann das vorher gezeigte Zufallsbild (Template) ersetzen.

Es ist eine etwas flexiblerer Ansatz:

  • Liste der Bilder aus dem CP
  • width/heigth Parameter aus dem CP
  • Lightbox (zoom allein funktioniert nicht!!!).
  • alt/title Tag aus dem CP
  • Bilde eigene CSS classes/IDs
  • Anzahl der auszugebenden Bilder wählbar
  • Rückfallbild (Bitte trage dein eigenes Bild am Ende des Prgrammierschnipsels ein.)
  • Benutze {SHOW_CONTENT:....} um die Ausgabe in der Seitenvorlage zu platzieren, wenn notwendig.


Script:

  • Im Bereich “CUSTOM Input ====” kann die Anzahl der auszugebenden Bilder eingestellt werden. 0 = alle.
  • Die Verwendung von Anzahl der Zeilen und Spalten ist nicht möglich.

random_images.tmpl

<!--IMAGE_SETTINGS_START//-->
; this is formatted like WIN.INI
; please: do not use comments for value lines
; settings will overwrite CP settings
;width            = 100
;height            = 100
;col            = 1
;zoom            = 1
;crop            = 0
;space            = 10
;lightbox        = 1
;nocaption        = 0
; 0 = no center, 1 = horizontal/vertical, 2 = horizontal, 3 = vertical
;center_image    = 0
<!--IMAGE_SETTINGS_END//-->
 
 
<!--IMAGES_HEADER_START//-->
<div style="clear:both;"></div>
 
[TITLE]<h3>{TITLE}</h3>[/TITLE]
[SUBTITLE]<h4>{SUBTITLE}</h4>[/SUBTITLE]
[TEXT]{TEXT}[/TEXT]
 
<div class="images" id="images{ID}">
 
[PHP]
// CUSTOM Input ================
    $my_max_count     = 0;        // Max count of images for output, 0 = all
// =============================
 
 
    $my_images         = array();
    $my_counter     = -1;
 
<!--IMAGES_HEADER_END//-->
 
 
<!--IMAGES_ENTRY_START//-->
 
    $my_counter++;
    $my_images[$my_counter][0] = '{IMAGE}';  // complete html string with image
    $my_images[$my_counter][1] = '{IMGID}';  // image-id
 
<!--IMAGES_ENTRY_END//-->
 
<!--IMAGES_ENTRY_SPACER_START//--><!--IMAGES_ENTRY_SPACER_END//-->
<!--IMAGES_ROW_SPACER_START//--><!--IMAGES_ROW_SPACER_END//-->
 
 
<!--IMAGES_FOOTER_START//-->
 
echo '<div class="imageEntryRandom">'.LF;
 
if (!empty($my_images) ) {
 
    shuffle($my_images);  // new sort
 
    if ($my_max_count) {  // Max count available?
        if ($my_max_count <= count($my_images)) {
            $temp_array = $my_images;
            $my_images = array_slice($temp_array, 0, $my_max_count);  // new random sort order
            unset ($temp_array);
        }
    }
 
    foreach ($my_images as $key=>$value) {
        echo '<div class="imageEntry" id="img'.$my_images[$key][1].'">'.LF;  // ID
        echo '  '.$my_images[$key][0].LF;   // thumb and zoom images
        echo '</div>'.LF;  // End imageEntry and ID
    }
}
else
{ // ************* Please insert your fallback image *************
    echo '<img src="content/images/my_fallback_image.jpg" width="200" height="150" alt="My alt" title="My title" border="0" />';
}
 
echo '</div>'.LF;  // End imageEntryRandom
 
unset ($my_images);
unset ($my_counter);
unset ($my_max_count);
 
[/PHP]
 
</div>
<!--IMAGES_FOOTER_END//-->


deutsch/phpwcms-system/artikel/contentparts/bilder-div/template-random-images.txt · Last modified: 2012/03/23 10:21 by Knut Heermann (flip-flop)
www.planmatrix.de www.chimeric.de Creative Commons License Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0

Strict Standards: Only variables should be passed by reference in /home/www/wiki/doku.php on line 79