<% option explicit %> <% dim strSQL 'generic string to hold SQL Dim intPageNum, intItems intItems = 12 'controls how many news items to display at once dim sLimitPart dim sTitleLimit 'get querystring vars If Request.QueryString("page") <> "" AND IsNumeric(Request.QueryString("page")) AND Request.QueryString("page") <> "0" Then intPageNum = Abs(CInt(Request.QueryString("page"))) Else intPageNum = 1 End If ' Helper Functions Function in_array(element, arr) For i=0 To Ubound(arr) If Trim(arr(i)) = Trim(element) Then in_array = True Exit Function Else in_array = False End If Next End Function Function Push(ByRef arrArray, varElement) 'Add an element to the end of an array. Return new length. ReDim arrArray(UBound(arrArray) + 1) arrArray(UBound(arrArray)) = varElement Push = UBound(arrArray) End Function %> Manitoba Wildlands - Current News and Home page

 Search our Site:
Energy Manitoba logo Climate Action Network Canada logo
 Sign up for
 Notices here

 
Manitoba Wildlands logo

<% 'BELOW selects the top 7 BRAG BOX items sorted descendingly by number - WORKS set objRS = objConn.execute("SELECT * FROM brag_box ORDER BY num DESC LIMIT 14") %>
Brag Box
<%=objRS("itemDate")%>
    <% DIM aTitles() dim iCounter dim bInArray, i iCounter = 0 objRS.MoveFirst Do While Not objRS.EOF 'check if title already exists bInArray = false for each i in aTitles if(i = objRS("title")) then bInArray = true exit for end if next if(iCounter < 7) Then if (bInArray = false) then 'increase array ubound ReDim Preserve aTitles(iCounter + 1) 'push title to array aTitles(iCounter) = objRS("title") response.Write("
  • " & objRS("subject") & " " & objRS("title") & "
  • ") 'increment counter iCounter = iCounter + 1 end if else exit do End If objRS.MoveNext Loop %>



News

<% 'BELOW selects the item number, title and full_text from top 18 records sorted descendingly by number - WORKS strSQL = "SELECT number,title, full_text FROM news_items ORDER BY number DESC " sLimitPart = "LIMIT " & (intItems * (intPageNum - 1)) & ", " & intItems strSQL = strSQL + sLimitPart set objRS = objConn.execute(strSQL) 'Error catch - if there is no records found If (objRS.EOF = TRUE) then response.Write "There is an error in locating the current News items. Please contact the Webmaster at Webmaster@ManitobaWildlands.org" End if %>
    <% 'TITLES SUMMARY: Do While Not objRS.EOF Response.Write "
  • " & objRS("title") & "
  • " objRS.MoveNext Loop 'NEED an error message if it IS EOF Response.Write("
") %> <% 'go back to beginning of recordset objRS.MoveFirst 'Error catch - if there is no records found If (objRS.EOF = TRUE) then response.Write "There is an error in locating the current News items. Please contact the Webmaster at Webmaster@ManitobaWildlands.org" End if 'Full News items : Do While Not objRS.EOF Response.Write objRS("full_text") Response.Write "
" objRS.MoveNext Loop %>

Manitoba Wildlands2002-2014