<%@ Language=VBScript %> Joachim.dk <% Dim vPath, pPath, ConString, sqltext1, rsBlogliste, chaexpstatus vPath = "../db/joachim.mdb" 'use this one if database is in root of cart folder pPath = Server.MapPath( vPath ) ConString = "PROVIDER=MICROSOFT.JET.OLEDB.4.0;DATA SOURCE=" & pPath & ";" Function unQuote(strTekst) unQuote = Replace(strTekst,"'","''") End Function Sub Blogliste sqltext1 = "SELECT * from Blog order by Created DESC" 'response.write(sqltext1) set rsBlogliste = Conn.Execute(sqltext1) End Sub Function HentForfatter(nId) sqltext1 = "SELECT Navn from Brugere WHERE Lbnr=" &nId 'response.write(sqltext1) set rsForfatter = Conn.Execute(sqltext1) if (rsForfatter.eof) then HentForfatter = "" else HentForfatter = rsForfatter("Navn") end if Exit Function End Function Function FormatDato(nGMTdato) 'Datoformat - input: 2006-11-07T00:52:33 'nGMTdato = DateAdd("h",-1,Now) sDg = Mid(nGMTdato,9,2) sMd = Mid(nGMTdato,6,2) sYear = Mid(nGMTdato,1,4) sHour = Mid(nGMTdato,12,2) sMin = Mid(nGMTdato,15,2) sSec = Mid(nGMTdato,18,2) FormatDato = sDg &"."& sMd &"."& sYear &" - "& sHour &":"& sMin &":"& sSec Exit Function End Function 'Main program chaexpstatus = unQuote(Request.form("expstatus")) chaarticlelbnr = unQuote(Request.form("articlelbnr")) if (Len(chaexpstatus) < 1) then chaexpstatus = "default" end if if (Len(chaarticlelbnr) < 1) then chaarticlelbnr = "" else chaexpstatus = "specific" end if set Conn = Server.CreateObject("ADODB.Connection") Conn.Open ConString Blogliste %> <% if (Len(Session("Brugerid")) > 0) then response.write "
" response.write "
Log ud
" response.write "
Sideoversigt
" response.write "
Udsend mail
" response.write "
Mail-modtagere
" response.write "
" end if %>
<% numberofarticles = 0 styletext = "" clientservercall = "" do while not rsBlogliste.eof numberofarticles = numberofarticles +1 response.write "" if (chaexpstatus = "default" AND numberofarticles > 1 ) then styletext = "style='display:none'" '1 er server og 2 er client clientservercall = "1" end if if (chaexpstatus = "default" AND numberofarticles = 1 ) then styletext = "" clientservercall = "2" end if if (chaexpstatus = "in" OR chaexpstatus = "specific" ) then 'Altid alle foldet ind fra starten styletext = "style='display:none'" clientservercall = "1" end if if (chaexpstatus = "out") then 'Altid alle foldet ud fra starten styletext = "" clientservercall = "2" end if blogLbnr = "x" & rsBlogliste("Lbnr") & "a" nchaarticlelbnr = chaarticlelbnr & "a" if (nchaarticlelbnr = blogLbnr) then styletext = "" clientservercall = "2" end if if (styletext = "") then iconfilename = "ico_minus.gif" else iconfilename = "ico_plus.gif" response.write "
" end if response.write "
" response.write "
" & "af " & HentForfatter(rsBlogliste("Forfatter")) & ", den "& FormatDato(rsBlogliste("Created")) & "

" if (styletext = "") then response.write rsBlogliste("Tekst") end if response.write "
" if (styletext <> "") then 'Afslutte noprintsec div response.write "
" end if rsBlogliste.movenext Loop %>
<% Conn.Close set Conn = Nothing %>