1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
61:
62:
63:
64:
65:
66:
67:
68:
69:
70:
71:
72:
73:
74:
75:
76:
77:
78:
79:
80:
81:
82:
83:
84:
85:
86:
87:
88:
89:
90:
91:
92:
93:
94:
95:
96:
97:
98:
99:
100:
101:
102:
103:
104:
105:
106:
107:
108:
109:
110:
111:
112:
113:
114:
115:
116:
117:
118:
119:
|
<html>
<head>
<title>Shoutbox powered by theHarlekin.de</title>
<style type="text/css">
a:link,a:visited,a:hover,a:active {
color:#000000;
text-decoration:none;
}
body,table,input {
margin:0px;
color:#000000;
background-color:#000000;
font-family:Tahoma;
font-size:9px;
}
td { background-color:#ffffff; }
input {
border-width:1px;
background-color:#ffffff;
}
body { background-color:#ffffff; }
.font_small {
font-size:8px;
}
</style>
<script type="text/javascript">
<!--
function RemoveValueNick() {
if (document.eingabe.nick.value == "nick") {
document.eingabe.nick.value = "";
}
}
function RemoveValueShout() {
if (document.eingabe.shout.value == "nachricht") {
document.eingabe.shout.value = "";
}
}
function RemoveValueAll() {
document.eingabe.nick.value = "";
document.eingabe.shout.value = "";
}
function initBlink() {
if(document.all) {
setInterval("doBlink()",550);
}
}
//-->
</script>
</head>
<body OnLoad="initBlink();window.scrollTo(0,99999);">
<?php
if ($action == 'show') {
$shouts = file('shouts.txt'); //'Shouts' in Variable Speichern
if (!isset($view) OR $view > count($shouts)) $view = count($shouts); //Wenn $view nicht per URL gesetzt ist, oder zu groß ist, wird er auf count($shouts) gesetzt
echo '<div align="center"><table border="0" cellpadding="0" cellspacing="1" width="100%">'; //Tabellenkopf wird geschrieben
$i = count($shouts) - $view + 1; //Variable für die Schleife
while ($i < count($shouts)) { //Solange $i kleiner als die anzuzeigenden Beiträge ist...
echo '<tr><td>'.stripslashes($shouts[$i]).'</td></tr>'; //...werden neue Zeilen mit dem richtigen Inhalt hinzugefügt
$i++;
}
echo '</table><br>'; //Tabellenende wird geschrieben
//Es folgt der Abschnitt indem man ein neuen 'Shout' verfassen kann
?>
<form name="eingabe" action="?action=post" method="post">
<input type="text" name="nick" size="15" maxlength="15" value="nick" OnClick="RemoveValueNick();">
<input type="text" name="shout" size="50" value="nachricht" OnClick="RemoveValueShout();">
<input type="submit" name="submit" value="shout!">
<input type="button" name="reset" value="reset" OnClick="RemoveValueAll();">
</form>
<a href="?action=show"><font class="font_small">show all</font></a>
</div>
<?php
}
elseif ($action == 'post') {
//Spam-Schutz
$ip_file = fopen('ip.txt','r');
$oldip = fgets($ip_file,99);
fclose($ip_file);
$ip = $REMOTE_ADDR;
if ($ip != $oldip) {
//Neue Ip schreiben
$ip_file = fopen('ip.txt','w');
fwrite($ip_file,$ip);
fclose($ip_file);
$nick = $_POST['nick']; //Nick wird in $nick gespeichert...
$shout = $_POST['shout']; //...und Shout in $shout
if ($nick != 'nick' and $shout != 'nachricht') {
if (strlen($nick) AND strlen($shout) > 0) { //Prüfen ob etwas eingegeben wurde (ja: Speicherung; nein: nichts)
$file = fopen('shouts.txt','a'); //Datei 'shouts.txt' zum Schreiben öffnen //Zeigern auf's Ende setzen
fwrite($file,"\r\n<b>".$nick.":</b> ".$shout); //Schreiben
fclose($file); //Datei wieder schließen
}
}
}
echo '<meta http-equiv="refresh" content="0; URL=?action=show&view=20">'; //Weiterleitung auf $action='show'
}
?>
</body>
</html>
|