<% dim minCon 'Connection dim rsGbok 'recordsetten för nya inlägg dim strSQL dim indag, dat Session.LCID = 1053 function fix(S) if S > 2 AND S <= 20 then fix = S & "e" Else if S > 23 AND S <= 30 then fix = S & "e" Else fix = S & "a" end if end if end function 'byta ut första bokstaven Function FirstVersal(txt) versal = UCase(Left(txt,1)) & LCase(Right(txt, Len(txt)-1)) FirstVersal = versal End Function Function Smilies(txt) txt = Replace(txt, ":)", "") txt = Replace(txt, ":(", "") txt = Replace(txt, ":e", "") txt = Replace(txt, ";)", "") txt = Replace(txt, ":p", "") txt = Replace(txt, ":h", "") txt = Replace(txt, ":OO","") txt = Replace(txt, "x(", "") txt = Replace(txt, ":o", "") txt = Replace(txt, ":q", "") txt = Replace(txt, ":D", "") txt = Replace(txt, ":P", "") txt = Replace(txt, "§jr", "") txt = Replace(txt, "§e", "") txt = Replace(txt, ":l", "") txt = Replace(txt, ":i", "") txt = Replace(txt, ":D", "") txt = Replace(txt, ":L", "") txt = Replace(txt, ":bla", "") txt = Replace(txt, "(y)", "") txt = Replace(txt, "(n)", "") Smilies = txt End Function %>

Gästboken


<% Set minCon = Server.CreateObject("ADODB.Connection") set rsGbok = Server.CreateObject("ADODB.Recordset") minCon.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath("../data/guests.mdb") strSQL =" SELECT * FROM guestbook ORDER by ID DESC" rsGbok.Open strSQL, minCon, 3, 3 Do While Not rsGbok.EOF //'eftersom sidan ligger på en amerikansk server så har vi 6 timmars tidsdifferens indag = Cdate(rsGbok("Datum")) vdag = DateAdd("h",0,indag) dat = FirstVersal(WeekDayName(WeekDay(vdag)))&"en "& " den " & fix(DatePart("d", vdag)) & " " & MonthName(Month(vdag)) &" kl " & FormatDateTime(vdag,4) Response.Write "

" & dat & " skrevs följande:

" //' i VBScript kan man inte använda sig utav radbrytningar därför behövs följande: Replace(rsGbok("Message"), vbCrLf, "
" & vbCrLf) Response.Write "

" & Replace(Smilies(rsGbok("Message")), vbCrLf, "
" & vbCrLf) & "


" Response.Write " av:" Response.Write " " & rsGbok("Namn") Response.Write "
Skicka insändaren E-post: " Response.Write "


" rsGbok.MoveNext Loop rsGbok.Close Set rsGbok = Nothing minCon.Close Set minCon = Nothing %>

Webmaster: Peter   Valid CSS! Valid XHTML 1.0 Transitional