<%@Language=VBScript%> <%Option Explicit%> <%=CarregarConfig("CFG_NOME_SITE")%> <% Dim i, Max, rsPesquisa, strTemp, strChave, Pagina, strInfo Dim strSQL, strResultado, strTemplateSite, strTemplateResultado Pagina = 1 If Request("PAGINA") <> "" Then Pagina = Cdbl(Request("PAGINA")) End If Max = Cdbl(CarregarConfig("CFG_ITENS_PAGINA")) strChave = Aspas(Request("SEARCH")) 'carga do template strTemplateSite = CarregarTemplate("site_articles.tpl") strTemplateSite = ProcessarSubTemplates(strTemplateSite) strTemplateResultado = CarregarTemplate("pagina_destaque.tpl") strSQL = "SELECT DEPCODIGO AS CODIGO, DEPNOME AS TITULO, DEPRESUMO AS RESUMO, DEPDATACADASTRO AS DATAHORA " & _ "FROM DEPARTAMENTO WHERE NOT DEPRETIRARLINK AND DEPTIPO='A' AND DEPATIVO ORDER BY DEPDATACADASTRO DESC, DEPNOME " Set rsPesquisa = Server.CreateObject("ADODB.RecordSet") rsPesquisa.PageSize = Max rsPesquisa.CursorLocation = adUseClient rsPesquisa.Open strSQL, objConn, adOpenForwardOnly, adLockReadOnly, adCmdText If Not rsPesquisa.Eof Then rsPesquisa.AbsolutePage = Pagina End If strInfo = ObterConteudoTAG(strTemplateSite, "<@IF_PESQUISA>", "") strTemplateSite = SubstituirConteudoTAG(strTemplateSite, "<@IF_PESQUISA>", "", "#PAINEL_RESULTADO#") strTemplateSite = Replace(strTemplateSite, "#PAINEL_RESULTADO#", "") i = 0 strResultado = "" While Not rsPesquisa.Eof And i < Max strTemp = strTemplateResultado strTemp = Replace(strTemp, "#TITULO#", rsPesquisa("TITULO")) strTemp = Replace(strTemp, "#RESUMO#", rsPesquisa("RESUMO")) strTemp = Replace(strTemp, "#LINK#", "view_page.asp?id=" & rsPesquisa("CODIGO")) strTemp = Replace(strTemp, "#DATAHORA#", FormatarData(rsPesquisa("DATAHORA")) & " " & FormatarHora(rsPesquisa("DATAHORA"))) strResultado = strResultado & strTemp rsPesquisa.MoveNext i = i + 1 Wend strTemplateSite = Replace(strTemplateSite, "#TAG_CLOUD#", tag_cloud(ProcessarTAGCloud(""))) strTemplateSite = Replace(strTemplateSite, "#TOTAL#", rsPesquisa.RecordCount) strTemplateSite = Replace(strTemplateSite, "#CONTEUDO#", strResultado) strTemplateSite = Replace(strTemplateSite, "#PAGINACAO#", IndicePaginacao2(rsPesquisa, Pagina)) Response.Write "
" & strTemplateSite & "
" objConn.Close Set objConn = Nothing %>