%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<%
Dim menu
Dim menu_numRows
Set menu = Server.CreateObject("ADODB.Recordset")
menu.ActiveConnection = MM_cenaberta_STRING
menu.Source = "SELECT * FROM seccao WHERE mostrar=1 ORDER BY secao"
menu.CursorType = 0
menu.CursorLocation = 2
menu.LockType = 1
menu.Open()
menu_numRows = 0
%>
<%
Dim noticia_destaque__MMIdCanal
noticia_destaque__MMIdCanal = "1"
If (request.querystring("idcanal") <> "") Then
noticia_destaque__MMIdCanal = request.querystring("idcanal")
End If
%>
<%
Dim noticia_destaque
Dim noticia_destaque_numRows
Set noticia_destaque = Server.CreateObject("ADODB.Recordset")
noticia_destaque.ActiveConnection = MM_cenaberta_STRING
noticia_destaque.Source = "SELECT noticias.id_noticia, noticias.id_seccao, noticias.id_pais, noticias.username, noticias.antetitulo, noticias.titulo, noticias.postitulo, noticias.lead, noticias.texto, noticias.mostrar_1a_pagina, noticias.mostrar_pag_seccao, noticias.data_hora, noticias.data_arquivo, First(imagens.loc_imagem) AS PrimeiroDeloc_imagem, First(imagens.tamanho) AS PrimeiroDetamanho FROM noticias LEFT JOIN imagens ON noticias.id_noticia = imagens.id_noticia WHERE noticias.id_seccao=" + Replace(noticia_destaque__MMIdCanal, "'", "''") + " and noticias.mostrar_pag_seccao=1 GROUP BY noticias.id_noticia, noticias.id_seccao, noticias.id_pais, noticias.username, noticias.antetitulo, noticias.titulo, noticias.postitulo, noticias.lead, noticias.texto, noticias.mostrar_1a_pagina, noticias.mostrar_pag_seccao, noticias.data_hora, noticias.data_arquivo HAVING (((noticias.data_arquivo)>=Date())) ORDER BY noticias.data_hora DESC, noticias.titulo DESC"
noticia_destaque.CursorType = 0
noticia_destaque.CursorLocation = 2
noticia_destaque.LockType = 1
noticia_destaque.Open()
noticia_destaque_numRows = 0
%>
<%
Dim canal__MMIdCanal
canal__MMIdCanal = "1"
If (Request.querystring("idcanal") <> "") Then
canal__MMIdCanal = Request.querystring("idcanal")
End If
%>
<%
Dim canal
Dim canal_numRows
Set canal = Server.CreateObject("ADODB.Recordset")
canal.ActiveConnection = MM_cenaberta_STRING
canal.Source = "SELECT * FROM seccao WHERE id_seccao=" + Replace(canal__MMIdCanal, "'", "''") + ""
canal.CursorType = 0
canal.CursorLocation = 2
canal.LockType = 1
canal.Open()
canal_numRows = 0
%>
<%
Dim imagens
Dim imagens_numRows
Set imagens = Server.CreateObject("ADODB.Recordset")
imagens.ActiveConnection = MM_cenaberta_STRING
imagens.Source = "SELECT TOP 1 noticias.id_noticia, noticias.titulo, noticias.antetitulo, noticias.postitulo, noticias.lead, noticias.mostrar_1a_pagina, imagens.id_imagem, imagens.loc_imagem, imagens.legenda, imagens.tamanho, imagens.autor, noticias.data_hora FROM noticias INNER JOIN imagens ON noticias.id_noticia = imagens.id_noticia ORDER BY noticias.data_hora DESC"
imagens.CursorType = 0
imagens.CursorLocation = 2
imagens.LockType = 1
imagens.Open()
imagens_numRows = 0
%>
<%
' *** Recordset Stats, Move To Record, and Go To Record: declare stats variables
Dim noticia_destaque_total
Dim noticia_destaque_first
Dim noticia_destaque_last
' set the record count
noticia_destaque_total = noticia_destaque.RecordCount
' set the number of rows displayed on this page
If (noticia_destaque_numRows < 0) Then
noticia_destaque_numRows = noticia_destaque_total
Elseif (noticia_destaque_numRows = 0) Then
noticia_destaque_numRows = 1
End If
' set the first and last displayed record
noticia_destaque_first = 1
noticia_destaque_last = noticia_destaque_first + noticia_destaque_numRows - 1
' if we have the correct record count, check the other stats
If (noticia_destaque_total <> -1) Then
If (noticia_destaque_first > noticia_destaque_total) Then
noticia_destaque_first = noticia_destaque_total
End If
If (noticia_destaque_last > noticia_destaque_total) Then
noticia_destaque_last = noticia_destaque_total
End If
If (noticia_destaque_numRows > noticia_destaque_total) Then
noticia_destaque_numRows = noticia_destaque_total
End If
End If
%>
<%
' *** Recordset Stats: if we don't know the record count, manually count them
If (noticia_destaque_total = -1) Then
' count the total records by iterating through the recordset
noticia_destaque_total=0
While (Not noticia_destaque.EOF)
noticia_destaque_total = noticia_destaque_total + 1
noticia_destaque.MoveNext
Wend
' reset the cursor to the beginning
If (noticia_destaque.CursorType > 0) Then
noticia_destaque.MoveFirst
Else
noticia_destaque.Requery
End If
' set the number of rows displayed on this page
If (noticia_destaque_numRows < 0 Or noticia_destaque_numRows > noticia_destaque_total) Then
noticia_destaque_numRows = noticia_destaque_total
End If
' set the first and last displayed record
noticia_destaque_first = 1
noticia_destaque_last = noticia_destaque_first + noticia_destaque_numRows - 1
If (noticia_destaque_first > noticia_destaque_total) Then
noticia_destaque_first = noticia_destaque_total
End If
If (noticia_destaque_last > noticia_destaque_total) Then
noticia_destaque_last = noticia_destaque_total
End If
End If
%>
<%
Dim Repeat3__numRows
Dim Repeat3__index
Repeat3__numRows = 4
Repeat3__index = 0
noticia_destaque_numRows = noticia_destaque_numRows + Repeat3__numRows
%>
<%
Dim RepeatArq__numRows
Dim RepeatArq__index
RepeatArq__numRows = 10
RepeatArq__index = 0
noticia_destaque_numRows = noticia_destaque_numRows + RepeatArq__numRows
%>
<%
Dim Repeat1__numRows
Dim Repeat1__index
Repeat1__numRows = 1
Repeat1__index = 0
noticia_destaque_numRows = noticia_destaque_numRows + Repeat1__numRows
%>
<%=(canal.Fields.Item("secao").Value)%> <% If request.QueryString("idcanal")=21 Then %>
<%response.Redirect("http://www.cenalusofona.pt/manifpopulares/manif.asp?id=230")%>
<% End If %>
<%
Repeat3__index=Repeat3__index+1
Repeat3__numRows=Repeat3__numRows-1
noticia_destaque.MoveNext()
Wend
%>
<% End If ' end Not noticia_destaque.EOF Or NOT noticia_destaque.BOF %>
<% If noticia_destaque.EOF And noticia_destaque.BOF Then %>
Não há notícias de <%=(canal.Fields.Item("secao").Value)%>
<% End If ' end noticia_destaque.EOF And noticia_destaque.BOF %>
ARQUIVO: <%=(canal.Fields.Item("secao").Value)%>
<%
While ((RepeatArq__numRows <> 0) AND (NOT noticia_destaque.EOF))
%>