Was kann ich machen oder besser, wie kann ich den Output bereich umschreiben, dass das funktioniert???
schon mal vorab vielen Dan an alle.
progman
hier der Code vom Ausgabe-output
Ausgabe INPUT<br><p><B>Einträge mit ICONS haben Links auf E-Mail und URL</B></p>
<?php
/***********************************************
* CONTENIDO MODUL - OUTPUT
*
* Modulname : Guestbook Ausgabe v1.1
* Copyright : P.beauvain
* Created : 14-02-2004
* Modified : Feb. 29th 2004 by Lars D. Forseth <lars@forseth.de>
************************************************/
$accessGranted = false;
$permissions = $auth->auth["perm"];
$permissions = explode(',', $permissions);
foreach ($permissions as $perm)
if ($perm == "sysadmin" || $perm == "admin[".$client."]")
$accessGranted = true;
switch ($eintrag) { // das erste mal beim aufruf ist $eintrag undefiniert
case "";
$eintrag = "0"; // deswegen wertzuweisung 0
}
$zps = "CMS_VALUE[4]"; // anzeige der einträge pro Seite
$max = ($eintrag + $zps);
$meineseite=$auth->url();
if (!$accessGranted) { $where = " WHERE active=1 AND client=$client"; }
else { $where = " WHERE client=$client"; }
if($accessGranted) {
$sql = "UPDATE ".$cfgTab_guestbook." SET active=".$active." WHERE id='".$gbid."' LIMIT 1";
$db->query($sql);
}
$a = "view";
// wenn view als aktion übergeben wird bzw. beim erstmaligen Seitenaufruf
if($a == "view")
{
//Zählen der Datensätze
$sql = "SELECT count(*) AS total FROM ".$cfgTab_guestbook.$where;
$db->query($sql);
$db->next_record();
$eintraege = $db->f("total");
echo "<br>";
echo "<table>";
//Unternavigation zusammenbauen
$gbnav = "";
$gbnav .= "<table width=420px cellspacing=0 cellpadding=0><tr>";
if ($max >= $eintraege)
$gbnav .= "<td class=textbold><p> Einträge: ".($eintrag+1)."-".($eintraege)." von ".$eintraege."</p></td>";
else
$gbnav .= "<td class=textbold><p> Einträge: ".($eintrag+1)."-".($max)." von ".$eintraege."</p></td>";
$gbnav .= "<td class=textbold align=right><p>";
$pages = $eintraege / $zps;
if ($pages > 1) {
$gbnav .= "gehe zu Seite ";
for ($ii = 0; $ii < $pages; $ii++) {
if ($ii != ($eintrag / $zps)) {
$gbnav .= "<a href=\"$meineseite&a=view&eintrag=";
$gbnav .= ($ii * $zps);
$gbnav .= "\">[".($ii+1)."]</a> ";
}
}
}
$gbnav .= "</p></td>";
//Ausgabe Navigation
// echo $gbnav;
// Daten aus der Datenbank abfragen mit der Einschränkung $eintrag (d.h. welche ausgegeben werden sollen) und $zps (anzahl der anzuzeigenden elemente)
$sql = "SELECT name, email, url, date, location, comments, id, active FROM $cfgTab_guestbook $where order by date desc LIMIT $eintrag,$zps";
$db->query($sql);
// Auslesen des Ergebnisse pro Reihe und Generierung der Seite
while ($db->next_record()) {
echo "<p><table width=80% border=0 cellpadding=0 cellspacing=0>";
echo "<td class=textbold><span ID=fontCMS_VALUE[1]>".$db->f("name")."</span><br><span ID=fontCMS_VALUE[2]>".$db->f("date")."</span></td>";
echo "<td align=right valign=top>";
if($accessGranted) {
if ($db->f("active") == 0) { $imgsrc = $cfgPathContenido.$cfgPathImg."deactivate.gif"; }
if ($db->f("active") == 1) { $imgsrc = $cfgPathContenido.$cfgPathImg."activ.gif"; }
echo "<a href=$meineseite&active=".(($db->f("active")*-1)+1)."&gbid=".$db->f("id")."&eintrag=".$eintrag."><img src=$imgsrc border=0></a>";
}
if ($db->f("url") != "") { echo "<a href=\"http://".$db->f("url")."\" target=_blank><img src=".$cfgClient[1]["frontendpath"]["img"]."CMS_VALUE[5] border=0 hspace=5></a>"; }
if ($db->f("email") != "") { echo "<a href=\"mailto:".$db->f("email")."\"><img src=".$cfgClient[1]["frontendpath"]["img"]."CMS_VALUE[6] border=0></a></td>"; }
echo "</tr>";
echo "<tr><td class=text ID=fontCMS_VALUE[3] colspan=3 valign=top><p>".stripslashes($db->f("comments"))."</p></td></tr>";
//Eintrag aktivieren/deaktivieren
{
if ($a == "view") { $imgsrc = $cfgPathContenido.$cfgPathImg."line_top.gif"; }
echo "<tr><td colspan=2><a href=\"#top\"><img src=$imgsrc border=0></a></td></tr>";
}
echo "</table></p><br>";
}
//Ausgabe Navigation
echo $gbnav;
}
echo "</table>";
?>
/***********************************************
* CONTENIDO MODUL - INPUT
*
* Modulname : Guestbook Ausgabe v1.1
* Copyright : P.beauvain
* Created : 14-02-2004
* Modified : Feb. 29th 2004 by Lars D. Forseth <lars@forseth.de>
************************************************/
echo "<input type=\"hidden\" name=\"CMS_VAR[0]\" value=\"".$value."\">";
echo "<table align=\"left\" cellpadding=\"0\" cellspacing=\"0\">";
echo "</SELECT></td></tr>";
echo "
<tr>
<td>Anzahl Einträge/Seite: </td>
<td><input type=\"text\" name=\"CMS_VAR[4]\" value=\"CMS_VALUE[4]\"></td></tr>";
$query = "SELECT * FROM ".$cfg["tab"]["upl"]." WHERE filetype = 'gif'";
$db->query($query);
while ($db->next_record()) {
//$bild replaces old $filename
$bild[$db->f("idupl")] = "upload/".$db->f("dirname").$db->f("filename");
} // end while
function d_checked($which) {
if ($which != "") {
return "checked";
}
} // end function
echo "<tr>\n";
echo "<td>WWW-Image</td>\n";
echo "<td><select name=\"CMS_VAR[5]\">\n";
if (is_array($bild)) {
foreach ($bild as $key => $value) {
if ("CMS_VALUE[5]" == $value) {
echo "<option selected=\"selected\" value=\"". $value ."\">". $value ."</option>";
} else {
echo "<option value=\"". $value ."\">". $value ."</option>";
} // end if
} // end foreach
} // end if
echo "</select></td>\n";
echo "</tr>\n";
echo "<tr>\n";
echo "<td>Mail-Image</td>\n";
echo "<td><select name=\"CMS_VAR[6]\">\n";
if (is_array($bild)) {
foreach ($bild as $key => $value) {
if ("CMS_VALUE[6]" == $value) {
echo "<option selected=\"selected\" value=\"". $cfgClient[1]["frontendpath"]["img"].$value ."\">". $value ."</option>";
} else {
echo "<option value=\"". $value ."\">". $value ."</option>";
} // end if
} // end foreach
} // end if
echo "</select></td>\n";
echo "</tr>\n";
echo "</table>";