%@ Language=VBScript %> <% Option Explicit %> <% Dim con ' database connection Dim rs ' recordset Dim strSQL ' SQL string Dim strOut ' output dim strHeadline dim strSynopsis dim strPageTitle dim strPageKeywords dim strPageDescription dim strStory Dim strAction Dim intPage Dim intnorecords Dim strOrder Dim intTotalrecords Dim inttotpage Dim strForward Dim strBack Dim strnews dim strButtons Set con = Server.CreateObject("ADODB.Connection") Set rs = Server.CreateObject("ADODB.Recordset") con.Open session("strDBCon") strAction = request("hdnAction") intPage = request("pagenumber") intNorecords = request("norecords") strOrder = request("order") if len(trim(strOrder)) < 1 then strOrder = "storydate desc" end if if len(trim(intPage)) < 1 then intPage = 1 end if if len(intNorecords) < 1 then intNorecords = session("records") end if intNorecords = 10 '#################################################################### '' get page keywords and main title '#################################################################### strSQL = "exec advosis_section_get " & session("news") 'response.write strSQL rs.Open strSQL, con If not rs.EOF then strHeadline = rs("headline") strSynopsis = rs("synopsis") strPageTitle = rs("pageTitle") strPageKeywords = rs("pageKeywords") strPageDescription = RS("pagedescription") Else Response.Write "Error: base info" End if rs.Close '' get Just the story details strSQL = "exec advosis_section_Story_get " & session("news") rs.Open strSQL, con If not rs.EOF then strStory = rs("story") Else Response.Write "Error: story data " End if rs.Close '#################################################################### '#################################################################### '' get the testimonials '#################################################################### '------------------------------------------------------------------------ 'Search for results '------------------------------------------------------------------------ strSQL = "exec advosis_Content_Display_by_sections @page=" & intPage & ",@recsPerPage=" & intNorecords & ",@orderby='orderid',@userid=" & session("marineuserid") & ",@sectionid=" & session("news") 'Response.Write strSQL 'response.end rs.Open strSQL, con if not rs.eof then while not rs.eof strout = strOut & "" & rs("headline") & "" & _ "" & brformat(rs("synopsis")) & "" & _ "Read more" intTotalrecords = rs("morerecords") rs.movenext wend end if '######################################################################## ' Calculate the rounding of how many pages are required '######################################################################## if intTotalrecords mod intNorecords then 'Note: use fix, else will round up if remainder is greater than .49, adding an extra page inttotpage = fix(intTotalrecords / intNorecords) + 1 else inttotpage = cint(intTotalrecords / intNorecords) end if '######################################################################## ' Forward and back buttons ' Calculate whether there should be back and forward buttons '######################################################################## if cint(intPage) = cint(inttotpage) or cint(intTotpage) = 0 then strForward = " " else strForward = "next" end if if cint(intpage)> 1 then strBack = "back" else strBack = " " end if '######################################################################## ' Output the forward and back buttons '######################################################################## StrButtons = StrButtons & "
" & strBack & " | " & strForward & " |