ich benutze das folgende Banner-Rotation-Modul:
INPUT
Code: Alles auswählen
$seldir = "CMS_VALUE[1]";
echo "<table><tr>
<td width=\"120\">Banner Ordner</td>
<td>Bitte wählen:<br><select name=\"CMS_VAR[1]\" size=\"1\">";
echo "<option value=\"kein\">-- kein --</option>";
$db = new DB_Contenido;
$query = "SELECT DISTINCT dirname FROM ".$cfg["tab"]["upl"]." ORDER BY dirname ASC";
$db->query($query);
while ($db->next_record()) {
?>
<option value="<?php echo $db->f("dirname") ?>"
<?php if ($seldir == $db->f("dirname")) echo " selected" ?>><?php echo $db->f("dirname") ?></option>
<?php
}
echo "</select></td>
</tr></table>";
Code: Alles auswählen
<?php
//Frontendpfad ermitteln
$query = "SELECT frontendpath FROM ".$cfg["tab"]["clients"]." WHERE idclient='".$client."'";
$db->query($query);
$db->next_record();
$frontendpath = $db->f("frontendpath");
//Upload Dir
$webdir='upload/';
//Thumbnail Dir
$thumbdir = "CMS_VALUE[1]";
$picfolder=opendir($frontendpath.$webdir.$thumbdir."/");
$i=1;
while(($pic[$i]=readdir($picfolder))!=false) {
if (eregi("(jpg|jpeg|gif|png)$",$pic[$i])){
$i++;
}
}
closedir($picfolder);
// Max. Anzahl von Bildern auslesen
$maxRandomNumber = count($pic)-1;
// Bild festlegen
$outputPic = rand(1, $maxRandomNumber);
//-------------Output
echo "<table width=\"468\" height=\"60\" cellspacing=\"0\" cellpadding=\"0\" border=\"0\">
<tr><td><img src=".$webdir.$thumbdir.$pic[$outputPic]." width=\"468\" height=\"60\"></td></tr></table>";
//-------------------//
?>
Meine Seite läuft mit 4.6.2
Eure Hilfe wäre einfach super