Categories::Ads List

<% On Error Resume Next Dim fcount, tPages, PerPage, Remain, adsPath PerPage = 100 adsPath = Server.Mappath(ad_cache) set oFldr = objFile.GetFolder(adsPath) set re = new RegExp re.global=false re.ignoreCase=true I = 1 fc = 1 For df = 2 to 300 objFile.DeleteFile(oFldr & "\" & df & ".asp") Next fcount = oFldr.files.count endCount = PerPage + 1 If endCount > fcount then endCount = fcount For each file in oFldr.files If I > endCount then Exit For cont = ReadFile(file, false) re.pattern = "()(.+)(\s-)" If Not re.test(cont) then re.pattern = "(<title>)(.+)()" set matches = re.execute(cont) set match = matches(0) match = match.SubMatches(1) If len(match) > 35 then match = Left(match, 35) & " ..." If I mod 3 = 1 then If I mod 6 = 1 then color = "class='evencell'": Else: color = "class='oddcell'" Response.Write "" End If Response.Write "" cont = Empty match = Empty If I mod 3 = 0 then Response.Write "" I = I + 1 Next Set re = Nothing tPages = fcount \ PerPage Remain = fcount Mod PerPage If tPages > 1 And Remain > 0 then tPages = tPages + 1 For J = 1 to tPages If J > 1 then Pages = Pages & "" & J & "  " Call BuildAdsPages(J) End If Next End If %>
" & match & "

<%= pages %>

<% Sub BuildAdsPages(nextPage) startCount = (nextPage - 1)* PerPage endCount = startCount + PerPage If endCount > fcount then endCount = fcount startCount = startCount + 1 cr = vbCrLf strNewPage = "" & cr strNewPage = strNewPage & "" & cr strNewPage = strNewPage & "" & cr strNewPage = strNewPage & "" & cr strNewPage = strNewPage & "" & cr strNewPage = strNewPage & "" & cr strNewPage = strNewPage & "" & cr strNewPage = strNewPage & "" & cr strNewPage = strNewPage & "Ads List from <a href='" & web_site & "'>" & web_name & " - Page " & nextPage & "" & cr strNewPage = strNewPage & "" & cr strNewPage = strNewPage & "" & cr & cr & "" & cr & cr strNewPage = strNewPage & "Ads List at " & web_name & " - Page " & nextPage & "

" & cr & cr strNewPage = strNewPage & "Main Ads List Page

" & cr & cr 'strNewPage = strNewPage & "" & cr strNewPage = strNewPage & chr(37) & chr(62) & cr strNewPage = strNewPage & "" & cr writeFile adsPath & "\" & nextPage & ".asp", strNewPage strNewPage = Empty End Sub %>