% Class cPageCollection dim pc_pageChildren() dim pc_intStart dim pc_intFinish dim pc_recordCount dim pc_intPage dim pc_intPageCount dim pc_childCount dim pc_pageStartChild dim pc_pageEndChild dim j public function getPageCollection(page_id, language_id, displayMode, additionalWhereClause, orderByClause, cRecordsPerPage) dim page_id_string dim page_id_array page_id_string = "" page_id_array = split(page_id,"|") for p = 0 to ubound(page_id_array) if len(page_id_array(p)) then if p > 0 then page_id_string = page_id_string & " or " page_id_string = page_id_string & "ia.ia_parentid = " & page_id_array(p) end if next strSQL = "SELECT DISTINCT " &_ "ia.ia_childid, cd.dateRange_start "&_ "FROM ia "&_ "INNER JOIN page_info pi ON pi.page_id = ia.ia_childid "&_ "INNER JOIN page_version pv ON pv.page_id = pi.page_id "&_ "LEFT OUTER JOIN content_dates cd ON cd.page_version_id = pv.page_version_id "&_ "WHERE " & page_id_string & " AND (pi.language_ID = " & language_id & " " if displayMode = "preview" then strSQL = strSQL & "AND pi.page_status < 6 " else strSQL = strSQL & "AND pi.page_status >= 3 AND pi.page_status < 6 " end if if len(additionalWhereClause) then strSQL = strSQL & additionalWhereClause strSQL = strSQL & ") ORDER BY " & orderByClause 'response.write strSQL 'response.end set rs = LoadRSFromDB(strSQL) if not rs.EOF then me.pc_childCount = rs.RecordCount if rs.RecordCount > cRecordsPerPage then rs.PageSize = cRecordsPerPage else rs.PageSize = rs.RecordCount end if rs.CacheSize = rs.PageSize intPageCount = rs.PageCount intRecordCount = rs.RecordCount if cint(intPage) > cint(intPageCount) then intPage = intPageCount if cint(intPage) <= 0 then intPage = 1 me.pc_pageStartChild = (cRecordsPerPage * intPage) - (cRecordsPerPage - 1) if intRecordCount > 0 Then rs.AbsolutePage = intPage intStart = rs.AbsolutePosition if cint(intPage) = cint(intPageCount) then intFinish = intRecordCount else intFinish = intStart + (rs.PageSize - 1) end if me.pc_pageEndChild = intFinish end If me.pc_intPage = intPage me.pc_intPageCount = intPageCount me.pc_recordCount = rs.RecordCount me.pc_intStart = intStart me.pc_intFinish = intFinish dim c c = 0 redim pc_pageChildren(rs.PageSize) for intRecord = 1 to rs.PageSize set me.pc_pageChildren(c) = new cPage if displaymode = "preview" then call me.pc_pageChildren(c).getPage(rs("ia_childid"),3,language_id,"draft") else call me.pc_pageChildren(c).getPage(rs("ia_childid"),3,language_id,"live") end if c = c + 1 rs.movenext if rs.EOF then exit for next else redim pc_pageChildren(1) pc_pageChildren(1) = "empty" me.pc_childCount = 0 end if end function public function writeAnchorList() response.write("
") call teaserText.writeText() response.write("
") end if set teaserText = nothing textWritten = true end if '-- Date case 6 if not length = "firstPara" then set dateObj = new cDates call dateObj.makeDate(contentArray(i,1),contentArray(i,3),contentArray(i,9),contentArray(i,10)) if dateObj.d_content_label = "Event dates" then call dateObj.writeDate("Full") else response.write("Publication date: ") call dateObj.writeDate("Short") response.write("
") end if set dateObj = nothing end if '-- Definition list case 10 set DLObj = new cDefinitionList call DLObj.makeDL(contentArray(i,1),contentArray(i,3),contentArray(i,4),contentArray(i,5)) if DLObj.dl_content_label = "Location" then call DLObj.writeDL() end if set DLObj = nothing end select next end if end if response.write("Date: ") call latestDate.writeDate("Short") response.write("
") set latestDate = nothing response.write writeCloseDL() end if if isObject(latestImage) then call latestImage.writeImage() set latestImage = nothing end if if isObject(latestText) then response.write("") call latestText.writeText() response.write("
") set latestText = nothing end if response.write(VbCrLf) response.write("" & VbCrLf) end if end function public function writePagingInfo() if not me.pc_childCount = 0 then response.write("Displaying items " & me.pc_pageStartChild & " to " & me.pc_pageEndChild & " of " & me.pc_childCount & "
" & VbCrLf) end if end function public function writePagination(template,params,previousLabel,nextLabel) dim paginationString if cint(me.pc_intPage) > 1 then paginationString = "" & previousLabel & "" else paginationString = "" & previousLabel & "" end if paginationString = paginationString & " | " if cint(me.pc_intPage) < cint(me.pc_intPageCount) then paginationString = paginationString & "" & nextLabel & "" else paginationString = paginationString & "" & nextLabel & "" end if response.write("" & me.pc_intStart & " - " & me.pc_intFinish & " of " & me.pc_recordCount & "
" & VbCrLf) response.write("" & paginationString & "
" & VbCrLf) response.write("