RonneldMcDonald
Mitglied
Hier der aktuelle Stand der shoutshow.php
PHP:
<?
include"config.php";
if(!mysql_table_exist($dbname,$tblshoutbox))
{
die("Please run installer.php to setup table '$tblshoutbox' in your '$dbname' name");
}
?>
<html>
<head>
<title>Guggemal ShoutBox</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link rel="stylesheet" href="style.css" type="text/css">
</head>
<body scroll="auto">
<table align="right" width="100%" border="0" cellspacing="0" cellpadding="0" id="table_frame">
<?
$query=mysql_db_query($dbname,"SELECT * FROM $tblshoutbox ORDER BY id DESC",$connection);
$total=mysql_num_rows($query);
$max = "3";
$total = "27";
if (! $page > 0) {
$page = 1;
}
if (intval($total/$max)+1 < $page) {
$page=1;
}
if ($total >= $page*$max) {
$lastrec = $page*$max;
}
else {
$lastrec = (($page-1)*$max) + ($total % $max);
}
echo "<tr><td class=\"navitext\">";
echo "<b>goto:</b> ";
////-------- Zurück- und Vorblättern Neu Anfang
if($page -1 > 0){
echo "<a href=\"$PHP_SELF?page=".($page-1)."\"><<<</a>";
}
for ($i=1; $i<=intval($total/$max)+1; $i++) {
if ($i != $page) {
echo "<a href=\"$PHP_SELF?page=$i\">$i</a>";
}
else {
echo "<span class=\"navizahl\">$i</span>";
}
print " ";
}
if ($page < intval($total/$max)){
echo "<a href=\"$PHP_SELF?page=".($page+1)."\">>>></a>";
}
////-------- Zurück- und Vorblättern Neu Ende
////-------- Zurück- und Vorblättern ALT Anfang
// for ($i=1; $i<=intval($total/$max)+1; $i++) {
// if ($i != $page) {
// echo "<a href=\"$PHP_SELF?page=$i\">$i</a>";
// }
// else {
// echo "<span class=\"navizahl\">$i</span>";
// }
// print " ";
// }
////-------- Zurück- und Vorblättern ALT Ende
echo "</td></tr>";
echo "<tr><td><hr align=\"center\"></td></tr>";
for ($j=($page-1)*$max; $j<$lastrec; $j++):
$p_usr=mysql_result($query,$j,"name");
$p_email=mysql_result($query,$j,"email");
$p_url=mysql_result($query,$j,"url");
$p_say=mysql_result($query,$j,"yousay");
$p_date=mysql_result($query,$j,"insecond");
$date = strftime("%d.%m.%y",$p_date);
$time = strftime("%H:%M",$p_date);
$div_p_say = explode(" ",$p_say);
$count_p_say = count($div_p_say);
for($i=0;$i<=$count_p_say;$i++):
if (ereg("^.+@.+\\..+$", $div_p_say[$i])):
$div_p_say[$i] = "[<a href=\"mailto:$div_p_say[$i]\">e-mail</a>]";
$check = true;
elseif ((eregi("^[http://].+www.+\\..",$div_p_say[$i])) || (eregi("www.+\\..",$div_p_say[$i]))):
$div_p_say[$i] = str_replace("http://","",$div_p_say[$i]);
$div_p_say[$i] = "[<a href=\"http://$div_p_say[$i]\" target=\"_blank\">homepage</a>]";
$check = true;
else:
$check = false;
endif;
if((strlen($div_p_say[$i])>20) && ($check==false)):
$div_p_say[$i] = wordwrap($div_p_say[$i],24," ",1);
if(!eregi("^[_\.0-9a-z-]",$div_p_say[$i])):
$newtext .= "{f} ";
else:
$newtext .= $div_p_say[$i].' ';
endif;
else:
$newtext .= $div_p_say[$i].' ';
endif;
endfor;
?>
<tr>
<td class="message"><b><?=$p_usr?></b> am:<br><span style="color:#8B8B7A;font-family:arial;font-size:7pt">[<?=$date?> | <?=$time?>]</span></td>
</tr>
<tr>
<td class="message"><?=$newtext?></td>
</tr>
<tr>
<td><hr align="center"></td>
</tr>
<?
unset($newtext);
endfor;
echo "<tr><td class=\"navitext\">";
echo "<b>goto:</b> ";
////-------- Zurück- und Vorblättern Neu Anfang
if($page -1 > 0){
echo "<a href=\"$PHP_SELF?page=".($page-1)."\"><<<</a>";
}
for ($i=1; $i<=intval($total/$max)+1; $i++) {
if ($i != $page) {
echo "<a href=\"$PHP_SELF?page=$i\">$i</a>";
}
else {
echo "<span class=\"navizahl\">$i</span>";
}
print " ";
}
if ($page < intval($total/$max)){
echo "<a href=\"$PHP_SELF?page=".($page+1)."\">>>></a>";
}
////-------- Zurück- und Vorblättern Neu Ende
////-------- Zurück- und Vorblättern ALT Anfang
// for ($i=1; $i<=intval($total/$max)+1; $i++) {
// if ($i != $page) {
// echo "<a href=\"$PHP_SELF?page=$i\">$i</a>";
// }
// else {
// echo "<span class=\"navizahl\">$i</span>";
// }
// print " ";
// }
////-------- Zurück- und Vorblättern ALT Ende
echo "</td></tr>";
?>
</table>
</body>
</html>