1:
<?php
2:
include "conn.php";
3:
4:
5:
?>
6:
7:
<html>
8:
<head>
9:
<title>Klotterplank</title>
10:
<style type="text/css">
11:
<!--
12:
body {
13:
font-family: Arial;
14:
font-size: 11px;
15:
background: #FFFFFF;
16:
}
17:
18:
form {
19:
width: 50%;
20:
align: center;
21:
background: #F5F5F5;
22:
border: 1px solid #E4E4E4;
23:
}
24:
25:
#form {
26:
width: 50%;
27:
align: center;
28:
background: #F5F5F5;
29:
border: 1px solid #E4E4E4;
30:
padding: 5px;
31:
}
32:
33:
.padding {
34:
padding: 5px;
35:
}
36:
37:
-->
38:
</style>
39:
40:
<script>
41:
42:
// Amazing Frameless Popup Window - Version I
43:
// (C) 2000 www.CodeLifter.com
44:
// Free for all users, but leave in this header
45:
46:
// set the popup window width and height
47:
48:
var windowW=214 // wide
49:
var windowH=350 // high
50:
51:
// set the screen position where the popup should appear
52:
53:
var windowX = 260 // from left
54:
var windowY = 100 // from top
55:
56:
// set the url of the page to show in the popup
57:
58:
var urlPop = "smilies.html"
59:
60:
// set the title of the page
61:
62:
var title = "Smilies"
63:
64:
// set this to true if the popup should close
65:
// upon leaving the launching page; else, false
66:
67:
var autoclose = true
68:
69:
// ============================
70:
// do not edit below this line
71:
// ============================
72:
73:
s = "width="+windowW+",height="+windowH;
74:
var beIE = document.all?true:false
75:
76:
function openFrameless(){
77:
if (beIE){
78:
NFW = window.open("","popFrameless","fullscreen,"+s)
79:
NFW.blur()
80:
window.focus()
81:
NFW.resizeTo(windowW,windowH)
82:
NFW.moveTo(windowX,windowY)
83:
var frameString=""+
84:
"<html>"+
85:
"<head>"+
86:
"<title>"+title+"</title>"+
87:
"</head>"+
88:
"<frameset rows='*,0' framespacing=0 border=0 frameborder=0>"+
89:
"<frame name='top' src='"+urlPop+"' scrolling=auto>"+
90:
"<frame name='bottom' src='about:blank' scrolling='no'>"+
91:
"</frameset>"+
92:
"</html>"
93:
NFW.document.open();
94:
NFW.document.write(frameString)
95:
NFW.document.close()
96:
} else {
97:
NFW=window.open(urlPop,"popFrameless","scrollbars,"+s)
98:
NFW.blur()
99:
window.focus()
100:
NFW.resizeTo(windowW,windowH)
101:
NFW.moveTo(windowX,windowY)
102:
}
103:
NFW.focus()
104:
if (autoclose){
105:
window.onunload = function(){NFW.close()}
106:
}
107:
}
108:
109:
</script>
110:
111:
112:
</head>
113:
<body>
114:
<body onload="top.window.focus()">
115:
116:
<div align="center">
117:
118:
119:
<form action="write.php" method="post" class="padding">
120:
<div align="left">
121:
<input type="hidden" name="datum" value="<?=date('Y-m-d H:i:s') ?>">
122:
<b><FONT FACE="Arial" SIZE=1 COLOR="#003366">Namn:</b><br>
123:
<input type="text" name="namn" size="18" style="width: 150px; BACKGROUND-COLOR: #B4C8DF; BORDER: #6A91C0 1px solid; COLOR: #FFFFFF FONT-FAMILY: Times; FONT-COLOR: #000000; FONT-SIZE: 10px"><br>
124:
<b><FONT FACE="Arial" SIZE=1>E-post:</b><br>
125:
<input type="text" name="email" size="18" minlength=1 style="width: 150px; BACKGROUND-COLOR: #B4C8DF; BORDER: #6A91C0 1px solid; COLOR: #FFFFFF FONT-FAMILY: Times; FONT-COLOR: #000000; FONT-SIZE: 10px"><br>
126:
<b><FONT FACE="Arial" SIZE=1>Meddelande:</b><br>
127:
<textarea name="mess" cols="35" rows="6" CLASS="sinp" WRAP="virtual" style="width: 250px; BACKGROUND-COLOR: #B4C8DF; BORDER: #6A91C0 1px solid; COLOR: #FFFFFF FONT-FAMILY: Times; FONT-COLOR: #000000; FONT-SIZE: 11px"></textarea><br>
128:
<input type="submit" name="klar" value="Klottra"> <a href="javascript:openFrameless()">Smilies</a>
129:
130:
131:
</div>
132:
</form></div><br><br>
133:
134:
135:
136:
<?php
137:
138:
function Smilies($text){
139:
140:
141:
$text = htmlentities($text);
142:
$text = nl2br($text);
143:
144:
$smilies = array(
145:
":)", // :) = ler.gif
146:
":(", // :( = sad.gif
147:
":|", // :| = besviken.gif
148:
":D", // :D = skrattar.gif
149:
":O", // :O = surprised.gif
150:
":P", // :P = funny.gif
151:
":S", // :S = confused.gif
152:
";)", // ;) = wink.gif
153:
":'(", // :'( = cry.gif
154:
"(H)", // (H) = cool.gif
155:
":$", // :$ = generad.gif
156:
":@", // :@ = arg.gif
157:
"(L)", // (L) = heart.gif
158:
"(U)", // (U) = heartbreak.gif
159:
":A", // :A = amen.gif
160:
":B", // :B = bible.gif
161:
":C", // :C = cross.gif
162:
"(C)", // (C) = cross2.gif
163:
":H", // :H = hug.gif
164:
":JC", // :JC = jesus-cross.gif
165:
":JS", // :JS = jesus-sign.gif
166:
"=P", // =P = funny.png
167:
"=S", // =/ = confused.png
168:
"-.-" // -.- = careface.png
169:
); // Här listas alla smilies, det är bara att fylla på med egna!
170:
171:
$smilies_replace = array(
172:
"<img src=\"media/smilies/ler.gif\" alt=\"\">", // :)
173:
"<img src=\"media/smilies/sad.gif\" alt=\"\">", // :(
174:
"<img src=\"media/smilies/besviken.gif\" alt=\"\">", // :|
175:
"<img src=\"media/smilies/skrattar.gif\" alt=\"\">", // :D
176:
"<img src=\"media/smilies/surprised.gif\" alt=\"\">", // :O
177:
"<img src=\"media/smilies/funny.gif\" alt=\"\">", // :P
178:
"<img src=\"media/smilies/confused.gif\" alt=\"\">", // :S
179:
"<img src=\"media/smilies/wink.gif\" alt=\"\">", // ;)
180:
"<img src=\"media/smilies/cry.gif\" alt=\"\">", // :'(
181:
"<img src=\"media/smilies/cool.gif\" alt=\"\">", // (H)
182:
"<img src=\"media/smilies/generad.gif\" alt=\"\">", // :$
183:
"<img src=\"media/smilies/arg.gif\" alt=\"\">", // :@
184:
"<img src=\"media/smilies/heart.gif\" alt=\"\">", // (L)
185:
"<img src=\"media/smilies/heartbreak.gif\" alt=\"\">", // (U)
186:
"<img src=\"media/smilies/amen.gif\" alt=\"\">", // :A
187:
"<img src=\"media/smilies/bible.gif\" alt=\"\">", // :B
188:
"<img src=\"media/smilies/cross.gif\" alt=\"\">", // :C
189:
"<img src=\"media/smilies/cross2.gif\" alt=\"\">", // (C)
190:
"<img src=\"media/smilies/hug.gif\" alt=\"\">", // :H
191:
"<img src=\"media/smilies/jesus-cross.gif\" alt=\"\">", // :JC
192:
"<img src=\"media/smilies/jesus-sign.gif\" alt=\"\">", // :JS
193:
"<img src=\"media/smilies/funny.png\" alt=\"\">", // =P
194:
"<img src=\"media/smilies/confused.png\" alt=\"\">", // =S
195:
"<img src=\"media/smilies/careface.png\" alt=\"\">" // -.-
196:
); // Här listas alla smilies-bilderna, det är bara att fylla på med egna!
197:
198:
199:
$text = str_replace($smilies,$smilies_replace,$text);
200:
201:
202:
return $text;
203:
204:
}
205:
206:
207:
$sql = mysql_query("SELECT * FROM klotter ORDER BY datum DESC LIMIT 50");
208:
while ($rad = mysql_fetch_array($sql))
209:
210:
211:
212:
213:
{
214:
$namn = $rad['namn'];
215:
$text = $rad['mess'];
216:
$email = $rad['email'];
217:
$hemsida = $rad['hemsida'];
218:
$date = $rad['datum'];
219:
$Smilies = Smilies($rad['mess']);
220:
echo "<div align=\"center\"><div id=\"form\"><div align=\"left\"><b><a href=\"mailto:$email\">$namn</b></a> <font color=\"#999999\">($date)</font> <hr> $Smilies </div></div></div> <br><br>";
221:
}
222:
223:
224:
225:
?>
226:
227:
228:
229:
230:
231:
</body>
232:
</html>
233: