<% Dim articlecategory Dim articlesubcategory Dim articletype Dim cnnFormToDBselector Dim objRSselector Dim ordersort Dim pageno Dim PageSize Dim recordsshown Dim prevbutton pagesize = 20 pageno = trim(Request.QueryString("pageno")) If pageno = "" Then pageno = 1 End if Set cnnFormToDBselector = Server.CreateObject("ADODB.Connection") cnnFormToDBselector.Open strConnString articlecategory = trim(Request.QueryString("articlecategory")) articlecategory = Replace(articlecategory,"-"," ") articlesubcategory = trim(Request.QueryString("articlesubcategory")) articlesubcategory = Replace(articlesubcategory,"-"," ") articletype = trim(Request.QueryString("articletype")) articletype = Replace(articletype,"-"," ") If articletype = "news" Then ordersort = "articleid desc" Else ordersort = "articletitle" End If If articletype = "" or articletype = "all" Then strsqlselector = "select articleid, articletitle, newsdate from kmdata where articlecategory='" & articlecategory & "' and articlesubcategory='" & articlesubcategory & "' order by " & ordersort Else If articlesubcategory = "" or articlesubcategory = "all" Then strsqlselector = "select articleid, articletitle, newsdate from kmdata where articletype='" & articletype & "' order by " & ordersort Else strsqlselector = "select articleid, articletitle, newsdate from kmdata where articletype='" & articletype & "' and articlecategory='" & articlecategory & "' and articlesubcategory='" & articlesubcategory & "' order by " & ordersort End If End if Set objRSselector = cnnFormToDBselector.Execute(strsqlselector) %> <% Function Shorten(sString, sLength) If Len (sString) > sLength Then Shorten = Left(sString,sLength) & "...." Else Shorten = sString End If End Function %> <% Dim origarticletype origarticletype = articletype %> <% If articletype = "" or articletype = "all" Then articletype= "documents" End If If articletype = "case study" Then articletype= "case studies" End If If articletype = "article" Then articletype= "articles" End If If articletype = "presentation" Then articletype= "presentations" End If %> Knowledge Centre <% Dim cnnFormToDB Dim objRS Set cnnFormToDB = Server.CreateObject("ADODB.Connection") cnnFormToDB.Open strConnString strsql = "select TOP 5 articleid, articletitle from kmdata order by articleid DESC" %> <% Dim cnnFormToDBread Dim objRSread Set cnnFormToDBread = Server.CreateObject("ADODB.Connection") cnnFormToDBread.Open strConnString strsqlread = "select TOP 5 articleid, articletitle from kmdata order by totalhits DESC" %>
<% If Not objRSselector.EOF Then %> Showing all <%= articletype %> from section: <%= articlecategory %> under subcategory: <%= articlesubcategory %>. Click on the links below to proceed further.
<% Else %> There are no <%= articletype %> from section: <%= articlecategory %> under subcategory: <%= articlesubcategory %>. Please try another combination.
<% End If %>


<% If Not objRSselector.EOF Then objRSselector.MoveFirst End If Dim currentrecord prevbutton = False if pageno > 1 Then prevbutton = True prevpageno = pageno - 1 recordsshown = pageno * pagesize recordsshown = recordsshown - pagesize currentrecord = 0 Do While currentrecord < recordsshown currentrecord = currentrecord + 1 objRSselector.Movenext Loop End if totalcount = 0 Do While Not objRSselector.EOF and totalcount <= pagesize %> "> > <%= Shorten(trim(objRSselector.Fields("articletitle")),280) %> <% newsid = trim(objRSselector.Fields("newsdate")) If newsid <> "" Then %> <%= objRSselector.Fields("newsdate") %> <% End if %>
<% totalcount = totalcount + 1 objRSselector.MoveNext Loop If pageno > 1 Then prevpageno = pageno - 1 prevbutton = True Else prevbutton = False End if If not objRSselector.EOF Then pageno = pageno + 1 nextbutton = True Else nextbutton = False End if objRSselector.Close Set objRSselector = Nothing Set cnnFormToDBselector = Nothing %>
<% If prevbutton = True Then %> Previous <% End If %> <% If nextbutton = True Then %> Next <% End If %>


BROWSE FEATURES
MOST RECENT
<% Set objRS = cnnFormToDB.Execute(strsql) objRS.MoveFirst Do While Not objRS.EOF %> "> • <%= Shorten(trim(objRS.Fields("articletitle")),28) %>
<% objRS.MoveNext Loop objRS.Close Set objRS = Nothing Set cnnFormToDB = Nothing %>
MOST READ
<% Set objRSread = cnnFormToDBread.Execute(strsqlread) objRSread.MoveFirst Do While Not objRSread.EOF %> "> • <%= Shorten(trim(objRSread.Fields("articletitle")),28) %>
<% objRSread.MoveNext Loop objRSread.Close Set objRSread = Nothing Set cnnFormToDBread = Nothing %>