<% Dim newsheadlines Dim conn Dim rsNews Dim NewsHeadline Dim NewsText Dim MaxNewsChars Function gSQLDate (sTime) If Not IsDate(sTime) Then gSQLDate = "0000-00-00 00:00:00" Else Dim sHour Dim sMin Dim sSecs Dim sDay Dim sMonth Dim sYear sTime = Cdate(sTime) sHour = Hour(sTime) sMin = Minute(sTime) sSecs = Second(sTime) sDay = Day(sTime) sMonth = Month(sTime) sYear = Year(sTime) gSQLDate = sYear & "-" & sMonth & "-" & sDay & " " & sHour & ":" & sMin & ":" & sSecs End If End Function MaxNewsChars=60 Function RemoveHTML( strText ) Dim RegEx Set RegEx = New RegExp RegEx.Pattern = "<[^>]*>" RegEx.Global = True RemoveHTML = RegEx.Replace(strText, "") End Function set conn = server.createobject("ADODB.Connection") set rsNews = server.createobject("ADODB.Recordset") conn.open ("ncontent") strSQL = "SELECT * FROM website_special_news WHERE News_WebID = 6 AND News_date > '" & gSQLDate(dateadd("m",-3,now())) & _ "' AND News_OnHome=1 ORDER BY News_Date DESC;" 'strSQL = "SELECT * FROM website_special_news WHERE News_WebID = 6 AND News_OnHome=1 ORDER BY News_Date DESC;" set rsNews = conn.execute(strSQL) Count = 1 if rsNews.EOF AND rsNews.BOF then newsheadlines="" else rsNews.movefirst While Not rsNews.eof 'AND Count <= NewsNum NewsHeadline = RemoveHTML(rsNews("News_Headline")) NewsText = replace(replace(RemoveHTML(rsNews("News_Text")),vbcrlf,""),vbtab,"") If Len(NewsText) > MaxNewsChars Then NewsText = Mid(NewsText,1,MaxNewsChars) & "..." End If newsheadlines = newsheadlines & NewsHeadline & ": " & NewsText & " " rsNews.movenext Count = Count + 1 Wend End If rsNews.close set rsNews=nothing conn.close set conn=nothing if newsheadlines<>"" then %> <% end if %>
Gairloch and Loch Ewe Action Forum Gairloch and Loch Ewe Action Forum
Home
Site Map
About GALE
Tourist Information
For Sale
Local Products
News and Events
"" then %> onmouseover="stopscrl();" onmouseout="startscrl();"<% end if %>>
Garloch and Loch Ewe Action Forum

Introduction