<% dim sec, ini, fim, tiraFim, nome_sec 'sec = cstr(request.servervariables("url")) 'fim = instr(sec, "/noticias")-1 'tiraFim = Mid(sec,1,fim) 'ini = instrrev(tiraFim,"/")+1 'nome_sec = mid(tiraFim, ini, fim) dim cod_noticia, sql, rs cod_noticia = request.querystring("ncod") if cod_noticia = empty then response.redirect "../"&nome_sec end if dim usr usr = session("usuario_comum_login") sql = "SELECT secao.cod AS codSec, " sql = sql & "secao.nome_secao AS nomSec, " sql = sql & "secao.nome_secao_url AS urlSec, " sql = sql & "secao.Cor_Secao AS Cor_Secao, " sql = sql & "noticias.Grau AS Grau, " sql = sql & "noticias.Titulo AS Titulo, " sql = sql & "noticias.Imagem AS Imagem, " sql = sql & "noticias.Imagem_TB AS Imagem2, " sql = sql & "noticias.Data AS Data, " sql = sql & "noticias.Codigo AS CodNot, " sql = sql & "noticias.Texto AS Texto, " sql = sql & "noticias.Autor AS Autor, " sql = sql & "noticias.Fonte AS Fonte, " sql = sql & "noticias.Palavras_Chave AS Palavras_Chave, " sql = sql & "noticias.Chamada AS Chamada from (secao INNER JOIN noticias " sql = sql & "on secao.cod = noticias.codigo_secao) where publicado = 'sim' AND noticias.codigo = "&cod_noticia call AbreCon set rs = conexao.execute(sql) if rs.eof then response.write("Sem noticias no banco") response.end() end if dim dataHora, dataCerta, minuto dataHora = rs("Data") minuto = minute(dataHora) if len(minuto)=1 then minuto = "0"&minuto dataCerta = day(dataHora)&"/"&month(dataHora)&"/"&year(dataHora)&" - "&hour(dataHora)&":"&minuto %>

» Você está em: Home > "><%=rs("nomSec")%> > Notícias

<%=rs("Titulo")%>

<%=rs("Chamada")%>

<%=rs("Texto")%>

<%=dataCerta%>

<%if rs("Autor")<>empty then%>

Autor: <%=rs("Autor")%>

<%end if%> <%if rs("Fonte")<>empty then%>

Fonte: <%=rs("Fonte")%>

<%end if%>

< Página inicial de <%=rs("nomSec")%>


<% dim acaoNoticia acaoNoticia = request.QueryString("acao") dim sqlCom, rsCom sqlCom = "SELECT * from comentarios WHERE status='ok' AND idNot="&cod_noticia&" order by data desc" call abreCon set rsCom = server.CreateObject("adodb.recordset") rsCom.cursorLocation=3 rsCom.open sqlCom, conexao numComent = rsCom.recordCount %>

Enviar esta noticia por e-mail

Imprimir Notícia

<% if numComent <= 0 then response.write "

Seja o primeiro a comentar

"&vbnewline else response.write "

Comentar

"&vbnewline response.write "

Ver comentarios ("&numComent&")

"&vbnewline end if %>

Seu nome:


Seu e-mail:




Destinatário:


E-mail do destinatário:



<%if usr <> emtpy then%>

Usuário: <%=usr%>




Comente


<%else%>

Você precisa fazer login para comentar

<%end if%>
<%if acaoNoticia = "lerComentarios" then ' mostrar os comentários response.write "

Exibindo todos os comentários ("&numComent&")

" if not rsCom.eof then do while not rsCom.eof dataCom = day(rsCom("data"))&"/"&month(rsCom("data"))&"-"&hour(rsCom("data"))&":"&minute(rsCom("data")) response.write "
" response.write "

"&rsCom("usuario")&"

" response.write "

Postado em: "&dataCom&"

" response.write "

"&rsCom("comentario")&"

" response.write "
" rsCom.movenext loop end if end if dim sql2, rs2, palavras, k, sqlPalavras palavras = rs("Palavras_Chave") if palavras <> empty then palavras = split(palavras,",") for i=0 to ubound(palavras) if i<>ubound(palavras) then sqlPalavras = sqlPalavras & "palavras_chave like '%"&palavras(i)&"%' OR " else sqlPalavras = sqlPalavras & "palavras_chave like '%"&palavras(i)&"%'" end if next sql2 = "SELECT secao.cod AS codSec, " sql2 = sql2 & "secao.nome_secao_url AS urlSec ," sql2 = sql2 & "noticias.Grau AS Grau ," sql2 = sql2 & "noticias.Titulo AS Titulo ," sql2 = sql2 & "noticias.Data AS Data ," sql2 = sql2 & "noticias.Codigo AS CodNot ," sql2 = sql2 & "noticias.publicado AS publicado ," sql2 = sql2 & "noticias.Palavras_Chave AS Palavras_Chave from (secao INNER JOIN noticias " sql2 = sql2 & "on secao.cod = noticias.codigo_secao) where ("&sqlPalavras&") AND secao.cod="&rs("CodSec")&" AND noticias.publicado = 'sim' AND noticias.Codigo != "&cod_noticia&" order by data desc LIMIT 0, 10" call AbreCon set rs2 = conexao.execute(sql2) if not rs2.eof then dim diaMes response.write "
" response.write "
" response.write "

Notícias relacionadas:

"&vbnewline response.write "
"&vbnewline do while not rs2.eof diaMes = day(rs2("data"))&"/"&month(rs2("data")) response.write "

" response.write ""&diaMes&""&vbnewline response.write rs2("titulo") response.write "" response.write "

"&vbnewline rs2.movenext loop response.write "
"&vbnewline response.write "
"&vbnewline end if end if %>

<%rs.close set rs = nothing call FechaCon%>