Mann kann die Breite/Höhe in der Kategorienkonfig eingeben, ist nichts eingegeben kann man im Output Vorgabewerte eintragen.
Es wird geprüft ob die Datei vorhanden ist, NUR dann wird die Anzeige erzeugt. Es ist eine Prüfung vorhanden, in der die Extension von Dateiname entfernt wird.
Zudem kann man natürlich den Folder auswählen
Input:
Code: Alles auswählen
?><?php
/***********************************************
* SWF abspielen
*
* Author : Karsten Klopmann
* Copyright : idea-tec GmbH
* Created : 07-03-2009
************************************************/?>
<table>
<tr>
<td><?php echo mi18n("Breite");?></td>
<td><input type="text" name="<?php echo "CMS_VAR[0]"; ?>" value="<?php echo "CMS_VALUE[0]"; ?>"></td>
</tr>
<tr>
<td><?php echo mi18n("Höhe");?></td>
<td><input type="text" name="<?php echo "CMS_VAR[1]"; ?>" value="<?php echo "CMS_VALUE[1]"; ?>"></td>
</tr>
<tr>
<td><?php echo mi18n("Dateiname (ohne Endung)");?></td>
<td><input type="text" name="<?php echo "CMS_VAR[2]"; ?>" value="<?php echo "CMS_VALUE[2]"; ?>"></td>
</tr>
<?php
$sql = "SELECT DISTINCT dirname FROM ".$cfg['tab']['upl']." ORDER BY dirname";
$db->query($sql);
echo '<tr><td>'.mi18n("Verzeichnis auswählen").'</td><td>
<select name="CMS_VAR[3]" size="1" style="width: 320px">
<option value="">'.mi18n("Nichts ausgewählt").'</option>';
while ($db->next_record()) {
if ( stristr($db->f("dirname"),'CVS/') === FALSE ) {
if ($db->f("dirname")=="CMS_VALUE[3]") {
echo '<option value="'.$db->f("dirname").'" selected="selected">'.$db->f("dirname").'</option>';
} else {
echo '<option value="'.$db->f("dirname").'">'.$db->f("dirname").'</option>';
}
}
}
echo '</select></td></tr>';?>
</table>
<?php
Code: Alles auswählen
<?php
/***********************************************
* SWF abspielen
*
* Author : Karsten Klopmann
* Copyright : idea-tec GmbH
* Created : 07-03-2009
* Modified : ----------
************************************************/
$filmBreite= "CMS_VALUE[0]";
if (trim($filmBreite)<'1') { $filmBreite = 400; }
$filmHoehe= "CMS_VALUE[1]";
if (trim($filmHoehe)<'1') { $filmBreite = 250; }
$filmName= "CMS_VALUE[2]";
$filmName = str_replace(".swf","",trim($filmName));
$filmPath= "CMS_VALUE[3]";
if (trim($filmPath)=='') {
$sPath= $cfgClient[$client]["path"]["frontend"] . $cfgClient[$client]["upl"]["frontendpath"] . "swf/";
} else {
$sPath= $cfgClient[$client]["path"]["frontend"] . $cfgClient[$client]["upl"]["frontendpath"] . trim($filmPath);
}
$filmDatei = $sPath.trim($filmName).".swf";
if (file_exists($filmDatei)) {
?>
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="<?php echo $filmBreite; ?>" height="<?php echo $filmHoehe; ?>" id="<?php echo $filmName; ?>" align="middle">
<param name="allowScriptAccess" value="always" />
<param name="movie" value="upload/<?php echo $filmPath; ?>/<?php echo $filmName; ?>.swf" />
<param name="quality" value="high" />
<param name="bgcolor" value="#fff" />
<param name="allowFullScreen" value="true" />
<embed src="upload/<?php echo $filmPath; ?>/<?php echo $filmName; ?>.swf" quality="high" bgcolor="#fff" width="<?php echo $filmBreite; ?>" height="<?php echo $filmHoehe; ?>" name="<?php echo $filmName; ?>" align="middle" allowFullScreen="true" allowScriptAccess="always" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer"></embed>
</object>
<?php } else {} ?>