%
strDSN = "DRIVER={MySQL}; Server=mydb6.surf-town.net; Database=spoforum; Uid=spoaddict; Password=spassersoren;"
Function DBFix(tempString)
tempString = Replace(Trim(tempString), "'", "''")
tempString = Replace(tempString, "|", "")
DBFix = tempString
End Function
%>
<%
Set myConn = Server.CreateObject("ADODB.Connection")
myConn.Open strDSN
count = 0
strSQL = "SELECT *, DATE_FORMAT(date,'%d/%m kl %H:%i') AS posttime FROM 16cnyheder ORDER BY ID DESC"
Set rs = myConn.Execute(strSQL)
If Not (rs.BOF Or rs.EOF) Then
Do While ((Not rs.EOF) And count < 5)
strSQL = "SELECT *, DATE_FORMAT(date,'%d/%m kl %H:%i') AS posttime, DATE_FORMAT(date,'%d-%m-%Y') AS FormDate, TIME_FORMAT(date,'%H:%i') AS FormTime FROM 16cnyheder WHERE (id =" & rs("id") & ")"
Set formatDate = myConn.Execute(strSQL)
dtmFormatDate = formatDate("FormDate")
strSQL = "SELECT Count(*) AS ItemCount FROM lifnyheder Where (id = " & rs("id") & ")"
Set recordCount = myConn.Execute(strSQL)
Function stripHTML(strHTML)
'Strips the HTML tags from strHTML
Dim objRegExp, strOutput
Set objRegExp = New Regexp
objRegExp.IgnoreCase = True
objRegExp.Global = True
objRegExp.Pattern = "<(.|\n)+?>"
'Replace all HTML tag matches with the empty string
strOutput = objRegExp.Replace(strHTML, "")
'Replace all < and > with < and >
strOutput = Replace(strOutput, "<", "<")
strOutput = Replace(strOutput, ">", ">")
stripHTML = strOutput 'Return the value of strOutput
Set objRegExp = Nothing
End Function
' -- Funktion slut
Function Shorten(sString, sLength)
If Len (sString) > sLength Then
Shorten = Left(sString,sLength) & "...."
Else
Shorten = sString
End If
End Function
sNews=Shorten(stripHTML(rs("nyhed")),100)
' If count = 0 Then
strHTML = strHTML & "" & sNews & ""
strHTML = strHTML & "" & rs("posttime") & ""
strHTML = strHTML & "http://www.stolpaaos.dk/16c/nyheder.asp"
strHTML = strHTML & "" & rs("Date") & ""
' Else
' End if
count = count + 1
rs.MoveNext
Loop
End If
myConn.Close
Set myConn = Nothing
'If InStr(Request.ServerVariables("HTTP_ACCEPT"), "application/xhtml+xml") > 0 Then
Response.ContentType = "application/xml"
'Else
' Response.ContentType = "text/html; charset=iso-8859-1"
'End If
Response.Charset = "iso-8859-1"
%>
16c News
http://www.stolpaaos.dk/16c/
StolPaaOs.dk's 16c nyheder
<%=strHTML%>