Gość: okokokok Re: test, a jakze IP: *.internetdsl.tpnet.pl 05.01.04, 19:37 <? require "guest/config.php"; error_reporting(0); if (!isset($action)) { $action="display"; } $base_file="guest/entry.dat"; $title="<p align=center><b>$title</b></center></p>"; switch ($action) { case "display": echo "$title"; $base2=file($base_file); $base=array_reverse($base2); $all=count($base); $str=$all/$show_number; if($all==0) { $str=1; } $str=ceil($str); if(!isset($page)) { $page=1; } if($all==0) { echo "<center>brak wpisów w bazie!<br><br></center>"; echo "[ <a href=$page_name?action=new>dodaj wpis</a> ]<hr size=1 noshade>"; } else { echo "<center>wpisów w bazie: $all<br><br></center>"; echo "<table width=100%><tr><td align=left>strony: "; for ($x=1; $x<=$str; $x++) { if ($x!=$page) { echo "<u><a href=$page_name?action=display&page=$x>$x</a></u> "; } else { echo "$x "; } } echo "</td><td align=right>[ <a href=$page_name?action=new>dodaj wpis</a> ] </td></tr></table>"; if ($page==1) { $ile=0; } else { $ile=$page*$show_number-$show_number; } if($ile+$show_number > $all) { $max=$all; } else { $max=$ile+$show_number; } for ($i=$ile; $i<$max; $i++) { $data=explode("||", $base[$i]); $data[5]=trim($data[5]); echo "<p style=\"color:$head_font; font-weight:bold; background:$head_bg;\">$data[1], $data[2]</p>$data[3]<br><br>dodał: <b>$data[0]</b> | <a href=mailto:$data[4]><img src=guest/img/email.gif border=0 title=\"$data[4]\" align=bottom></a>"; if ($data[5]!="") { echo " | <a href=$data[5] target=_blank><img src=guest/img/www.gif border=0 title=\"$data[5]\" align=bottom></a>"; } else { echo " | brak"; } echo "<br><hr noshade>"; } echo "<table width=100%><tr><td align=left>strony: "; for ($x=1; $x<=$str; $x++) { if ($x!=$page) { echo "<u><a href=$page_name?action=display&page=$x>$x</a></u> "; } else { echo "$x "; } } echo "</td><td align=right>[ <a href=$page_name?action=new>dodaj wpis</a> ] </td></tr></table>"; } break; case "new": echo "<p align=center><b>Dodaj wpis</b></center></p> <hr size=1 noshade> <form action=$page_name?action=add method=post> nick:<br> <input type=text name=author><br> email:<br> <input type=email name=email><br> www:<br> <input type=text name=www><br> wpis (max. $maxlength znaków):<br> <textarea name=body rows=5 cols=30 wrap=virtual></textarea><br> <input type=submit value=dodaj> <input type=reset value=reset><br> </form> <p align=center>[bigsmile] = <img src=guest/img/bigsmile.gif border=0 align=bottom> | [confused] = <img src=guest/img/confused.gif border=0 align=bottom> | [cool] = <img src=guest/img/cool.gif border=0 align=bottom> | [eek] = <img src=guest/img/eek.gif border=0 align=bottom><br>[evil] = <img src=guest/img/evil.gif border=0 align=bottom> | [mad] = <img src=guest/img/mad.gif border=0 align=bottom> | [razz] = <img src=guest/img/razz.gif border=0 align=bottom> | [rolleyes] = <img src=guest/img/rolleyes.gif border=0 align=bottom><br>[rotfl] = <img src=guest/img/rotfl.gif border=0 align=bottom> | [sad] = <img src=guest/img/sad.gif border=0 align=bottom> | [smile] = <img src=guest/img/smile.gif border=0 align=bottom></p> <center>Dozwolone tagi HTML to: <b><a></b>, <b><b></b>, <b><i></b>, <b><u></b>. Pozostałe znaczniki zostan± usunięte! </center> <hr size=1 noshade> <center>[ <a href=javascript:history.go(-1)>anuluj</a> ]</center>"; break; case "add": $date=date("d-m-Y"); $hour=date("H:i"); if ($body=="" || $author=="" || $email=="") { echo "Nie wypełniono wszystkich pól formularza!<br><hr noshade><center>[ <a href=javascript:history.go(-1)>popraw</a> ]</center>"; die(); } if (!eregi("@", $email) || !eregi(".", $email)) { echo "Podano nieprawidłowy adres e-mail!<br><hr noshade><center>[ <a href=javascript:history.go(-1)>popraw</a> ]</center>"; die(); } $www=str_replace("", "", $www); $author=substr($author, 0, 32); $email=substr($email, 0, 64); $www=substr($www, 0, 100); if ($body!="") { $body=substr($body, 0, $maxlength); $body=strip_tags($body, '<a><b><i><u>'); $body=stripslashes($body); $body=str_replace("\n", "<br>", $body); $body=str_replace("", " <img src=guest/img/smile.gif border=0 align=bottom>", $body); $body=str_replace("", " <img src=guest/img/smile.gif border=0 align=bottom>", $body); $body=str_replace("[smile]", "<img src=guest/img/smile.gif border=0 align=bottom>", $body); $body=str_replace("", " <img src=guest/img/wink.gif border=0 align=bottom>", $body); $body=str_replace("", " <img src=guest/img/wink.gif border=0 align=bottom>", $body); $body=str_replace("[wink]", "<img src=guest/img/wink.gif border=0 align=bottom>", $body); $body=str_replace("[rolleyes]", "<img src=guest/img/rolleyes.gif border=0 align=bottom>", $body); $body=str_replace("[razz]", "<img src=guest/img/razz.gif border=0 align=bottom>", $body); $body=str_replace("[mad]", "<img src=guest/img/mad.gif border=0 align=bottom>", $body); $body=str_replace("[rotfl]", "<img src=guest/img/rotfl.gif border=0 align=bottom>", $body); $body=str_replace("[sad]", "<img src=guest/img/sad.gif border=0 align=bottom>", $body); $body=str_replace("[evil]", "<img src=guest/img/evil.gif border=0 align=bottom>", $body); $body=str_replace("[eek]", "<img src=guest/img/eek.gif border=0 align=bottom>", $body); $body=str_replace("[cool]", "<img src=guest/img/cool.gif border=0 align=bottom>", $body); $body=str_replace("[confused]", "<img src=guest/img/confused.gif border=0 align=bottom>", $body); $body=str_replace("[bigsmile]", "<img src=guest/img/bigsmile.gif border=0 align=bottom>", $body); $f=fopen($base_file, "a"); flock($f, 2); $write_str="$author||$date||$hour||$body||$email||$www\n"; fputs($f, $write_str); flock($f, 3); fclose($f); echo "<p align=center><b>Dodano wpis</b></center></p>"; echo "$confirm_msg<br><hr size=1 noshade><center>[ <a href=$page_name? action=display>pokaż wpisy</a> ]</center>"; } if($mailinfo==1) { $mailbody="autor: $author,\n www: $www,\n e-mail: $email,\n wpis:\n $body\n dodano: $date, o godz. $hour,\n"; mail("$admin_mail", "Dodano nowy wpis do Księgi", $mailbody, "From: $admin_mail"); } break; } echo "<p align=center>Powered by <a href=www.phpflash.w.pl target=_blank>PHPFlash</a></p>"; Odpowiedz Link Zgłoś