ich bekomme es einfach nicht hin -.-!
Hier der Code:
Mfg Markus
Hier der Code:
PHP-Code:
<?
$Anzahl ="1";
$table="news";
$result = mysql_query("select * from $table");
$menge = @mysql_numrows($result);
$seiten = ceil($menge / $Anzahl);
if ( !$z )
$z = 1;
$maximum = $z * $Anzahl;
$minimum = $maximum - $Anzahl;
If ($menge > 0) {
// Ausgabe der Datensätze, wenn vorhanden
for($i=$minimum;$i < $maximum; $i++) {
$id = mysql_result($result,$i,"id");
$nick = mysql_result($result,$i,"nick");
$datum= mysql_result ($result,$i,"datum");
$text = mysql_result($result,$i,"text");
$Zeit = mysql_result($result,$i,"Zeit");
$topic= mysql_result ($result,$i,"topic");
$newsmore = mysql_result($result,$i,"newsmore");
if ($action == "newsmore") {
echo "<br>";
echo "<table width=\"609\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">";
echo "<tr height=\"35\">";
echo "<td width=\"609\" height=\"35\" background=\"Layout/conent_o.png\"> $topic <i>verfasst von $nick am $datum</i></td>";
echo "</tr>";
echo "<tr>";
echo "<td align=\"center\" valign=\"top\" width=\"609\" background=\"Layout/conent_m.png\">";
echo "<table width=\"98%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">";
echo "<tr>";
echo "<td>$text</td>";
echo "</tr>";
echo "</table>";
echo "</td>";
echo "</tr>";
echo "<tr height=\"6\">";
echo "<td width=\"609\" height=\"6\" background=\"Layout/conent_u.png\"></td>";
echo "</tr>";
echo "<tr>";
echo "<td align=\"center\" valign=\"top\" width=\"609\" background=\"Layout/conent_m.png\">";
echo "<table width=\"98%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">";
echo "<tr>";
echo "<td>more:<br>$newsmore</td>";
echo "</tr>";
echo "</table>";
echo "</td>";
echo "</tr>";
echo "<tr height=\"6\">";
echo "<td width=\"609\" height=\"6\" background=\"Layout/conent_u.png\"></td>";
echo "</tr>";
echo "</table>";
}
else {
echo "<br>";
echo "<table width=\"609\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">";
echo "<tr background=\"Layout/conent_o.png\" height=\"35\">";
echo "<td width=\"500\" height=\"35\" background=\"Layout/conent_o.png\"> $topic <i>verfasst von $nick am $datum</i></td>";
echo "</tr>";
echo "<tr>";
echo "<td align=\"center\" valign=\"top\" width=\"609\" background=\"Layout/conent_m.png\">";
echo "<table width=\"98%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">";
echo "<tr>";
echo "<td>$text</td>";
echo "</tr>";
echo "</table>";
echo "</td>";
echo "</tr>";
echo "<tr>";
echo "<td width=\"609\" height=\"6\" background=\"Layout/conent_m.png\"><a href=\"index.php?action=newsmore&id=$id\"> more</a></td>";
echo "</tr>";
echo "<tr height=\"6\">";
echo "<td width=\"609\" height=\"6\" background=\"Layout/conent_u.png\"></td>";
echo "</tr>";
echo "</table>";
}
} // Ende der Zählschleife
} // Ende ob $menge > 0 wenn nicht dann gleich Alternative Else Ausgabe
else {
echo "<b><div class=\"headline\">Aktuelles aus der Spieleschmiede:</div></b><br><br>";
echo "<li>Der Webmaster hat noch keine News geupped!<p>";
} //ende von else
If ($menge > $Anzahl){
echo "<b><center>";
$vor = $z - 1; // Gibt einen Statuswert ab der sagt ob es noch ältere Einträge gibt.
$next = $z + 1; // Gibt einen Statuswert ab ob es noch weitere gibt.
If ($vor != 0 ) echo "<a href=\"News.php?z=$vor\">";
If ($vor == 0) { echo "<span class=\"links_inaktiv\"><strike>Neuere</strike></span>";
} else {echo "<span class=\"links_normal\">Neuere</span>"; }
If ($vor !=0) echo "</a>";
echo " | ";
If ($next <= $seiten) echo "<a href=\"News.php?z=$next\">";
If ($next > $seiten) { echo "<span class=\"links_inaktiv\"><strike>Ältere</strike></span>";
} else {echo "<span class=\"links_normal\">Ältere</span>"; }
If ($next <=$seiten) echo "</a>";
echo"</b></center><P>";
}
?>
Kommentar