die bildeingabe lässt sich, will mann auf verlinkte bilder verzichten, auch vereinfachen. mit dem folgenden modul können alle bilder in einem block eingesetzt werden.
eingabe:
Code: Alles auswählen
<?php
/**
* --------------------------------------------------------------------
*
* Modul-Input: monoslideshow
* Grundlage: Beispielmodul f�r Addon jQueryLightbox
*
* Autor: Andreas Eberhard, andreas.eberhard@gmail.com
* http://rex.andreaseberhard.de
* mod von tizian@ansichtsache.com
* --------------------------------------------------------------------
*/
?>
<table width="98%" border="0" cellpadding="0" cellspacing="3">
<tr>
<td valign="top">
<strong style="display:block;width:185px;">Bild(er) auswählen ...</strong>
</td>
<td valign="top">
REX_MEDIALIST_BUTTON[1]
<div id="REX_MEDIALIST_PREVIEWC" style="display:none;margin-bottom:25px;">Vorschau:<br /><img id="REX_MEDIALIST_PREVIEW" src="../files/clear.gif" style="cursor:pointer;border:solid 1px #999;" alt="Vorschau" title="Vorschau" /></div>
<div style="display:block;width:370px;"></div>
</td>
</tr>
</table>
<script type="text/javascript">
function addEvent( obj, type, fn )
{
if (obj.addEventListener) {
obj.addEventListener( type, fn, false );
} else if (obj.attachEvent) {
obj["e"+type+fn] = fn;
obj[type+fn] = function() { obj["e"+type+fn]( window.event ); }
obj.attachEvent( "on"+type, obj[type+fn] );
}
}
function rex_media_preview(){
var strFileName = document.getElementById("REX_MEDIALIST_SELECT_1").value;
if ( (strFileName.lastIndexOf(".jpg")>0) || (strFileName.lastIndexOf(".jpeg")>0) || (strFileName.lastIndexOf(".gif")>0) || (strFileName.lastIndexOf(".png")>0) || (strFileName.lastIndexOf(".bmp")>0) ) {
newImage = new Image();
newImage.onload = function() {
document.getElementById("REX_MEDIALIST_PREVIEW").src = newImage.src;
document.getElementById("REX_MEDIALIST_PREVIEWC").style.display = "block";
}
newImage.src = "../index.php?rex_resize=196a__"+document.getElementById("REX_MEDIALIST_SELECT_1").value;
} else {
document.getElementById("REX_MEDIALIST_PREVIEWC").style.display = "none";
}
}
function rex_media_hidepreview(){
document.getElementById("REX_MEDIALIST_PREVIEWC").style.display = "none";
}
function rex_toggle_plusoptions(){
if ( document.getElementById("moduleplusoptions").style.display == "none" ) {
document.getElementById("moduleplusoptions").style.display = "block";
} else {
document.getElementById("moduleplusoptions").style.display = "none";
}
}
addEvent(document.getElementById("REX_MEDIALIST_SELECT_1"), "change", rex_media_preview);
addEvent(document.getElementById("REX_MEDIALIST_SELECT_1"), "click", rex_media_preview);
addEvent(document.getElementById("REX_MEDIALIST_PREVIEW"), "click", rex_media_hidepreview);
</script>
ausgabe:
Code: Alles auswählen
<?php
/**
* --------------------------------------------------------------------
*
* Modul-Output: monoslideshow
* Grundlage: Beispielmodul f�r Addon jQueryLightbox von Andreas Eberhard, andreas.eberhard@gmail.com
* http://rex.andreaseberhard.de
* mod von tizian@ansichtsache.com
* --------------------------------------------------------------------
*/
unset($rxmodule);
// REDAXO-Version
$rxmodule['rexversion'] = isset($REX['VERSION']) ? $REX['VERSION'] . $REX['SUBVERSION'] : $REX['version'] . $REX['subversion'];
// Bilddateien aus Medialist
$rxmodule['imagelist'] = explode(',', trim("REX_MEDIALIST[1]"));
// maximale Bildgr��e
$rxmodule['imgsize'] = trim("REX_VALUE[1]");
if ($rxmodule['imgsize']=='')
{
$rxmodule['imgsize'] = '100c__100h';
}
// Links f�r die Bilder ausgeben
foreach ($rxmodule['imagelist'] as $rxmodule['file']) {
$rxmodule['media'] = OOMedia::getMediaByName($rxmodule['file']);
if ($rxmodule['media']) {
if ( in_array($rxmodule['rexversion'], array('3.01', '3.11', '32')) ) { // REDAXO 3.2, REDAXO 3.01, REDAXO 3.11
$rxmodule['mediatitle'] = str_replace(array("\r\n", "\n", "\r"), ' ', $rxmodule['media']->getTitle());
}
if ( in_array($rxmodule['rexversion'], array('40', '41', '42')) ) { // REDAXO 4.0.x, 4.1.x, 4.2.x
$rxmodule['mediatitle'] = str_replace(array("\r\n", "\n", "\r"), ' ', $rxmodule['media']->getValue('title'));
}
if (trim($rxmodule['mediatitle']=='') or !$rxmodule['mediatitle']) {
$rxmodule['mediatitle'] = $rxmodule['file'];
}
echo '<image source="' . $REX['HTDOCS_PATH'] . 'files/' . $rxmodule['file'] . '" description="' . $rxmodule['mediatitle'] . '" />';
echo '' . "\n" ;
}
}
?>