<% If Request.QueryString("action")="logoff" then session("authenticated")="0" session("username")="" session("password")="" Response.Redirect("/notic") End If %> Notícias do Dia - TNnotícias

 
    Envie mensagens para telemóveis !    


   Tradutor
   Câmbios
   Conversor
   Câmbios do Dia
   CHAT
   MAIL
   Livro de visitas
   Hino de Portugal
   Top TerraNatal
   Novidades!!!
Pesquisa
              
 

   Por temas
   da Terra
Com.Lusófonas

   Informações
   Entrevistas
   Reportagens
   Festas e Romarias
   Viagens
   Destinos
   Crónicas
   Consultório
Escrever ao longe
   Frases ditas
   Cidadão
   Empresas
   Emigrante
   Comunidades
   Meteorologia
   Telefones Úteis
   Códigos Postais

XYZ

 

Jogos
   Horóscopos

 

   Adicionar site

 

<% If Session("username")<>"" then %>

Gestão de notícias - Utilizador <%=Session("username")%>  
[Logoff]  
[Índice]   [Nova]


<% End if %>

  <% ' Set NewsDate Session Variable if Session("NewsDate")="" Then Session("NewsDate")=Date if (request.form("date")<>"")and(request.form("update")="")then session("NewsDate")=request.form("date") ' delete news if request.querystring("action")="delete" then SQLOpen("select username from news where id=" & request.querystring("id")) If not SQLEof Then if (Session("username")="admin")or(SQLField("username")=Session("username"))Then SQLClose MyRs.Open "select * from news where id=" & Request.QueryString("id"), MyDSN, adOpenKeySet, adLockPessimistic, adCmdText MyRs.Delete MyRs.Close response.write("Notícia apagada.


") else SQLClose response.write("Não autorizado.
") end if else SQLClose Response.Write "A Notícias já se encontrava apagada.
" End If end if ' update news, from form if request.form("update")="1" then SQLOpen("select username,valid from news where id=" & request.form("id")) if (Session("username")="admin")or((SQLField("username")=Session("username"))and(SQLField("valid")="0"))Then SQLClose MyRs.Open "select * from news where id=" & Request.Form("id"), MyDSN, adOpenKeySet, adLockPessimistic, adCmdText MyRs("date")=request.form("date") MyRs("title")=request.form("title") MyRs("texto")=request.form("texto") MyRs("category")=request.form("categoria") if request.form("partner")<>"" then MyRs("partner")=request.form("partner") MyRs("url_redirect")=request.form("url_redirect") MyRs.Update MyRs.Close response.write("Notícia actualizada.
") else SQLClose response.write("Não autorizado.
") end if end If ' create news, from form if request.form("create")="1" then SQLOpen("select valid_news from users where name='" & Session("username") & "'") ValidNews=SQLField("valid_news") SQLClose MyRs.Open "news", MyDSN, adOpenKeySet, adLockPessimistic, adCmdTable MyRs.AddNew MyRs("date")=now MyRs("title")=request.form("title") MyRs("texto")=request.form("texto") MyRs("category")=request.form("categoria") if request.form("partner")<>"" then MyRs("partner")=request.form("partner") MyRs("url_redirect")=request.form("url_redirect") MyRs("valid")=ValidNews MyRs("username")=Session("username") MyRs.Update MyRs.Close response.write("Notícia criada.
") end If ' update/create news - show form if(request.querystring("action")="update")or(request.querystring("action")="create")then Response.Write "
" ' update news form if(request.querystring("action")="update")then SQLOpen("select id,title,date,category,partner,url_redirect,texto from news where id=" & request.querystring("id")) texto=MyRs("texto").GetChunk(60000) Response.Write "" Response.Write "" response.write "Id: " & SQLField("Id") & "
" Response.Write "Data:
" Response.Write "Descrição:
" Response.Write "Categoria:
" MyRs1.close Response.Write "Partners:
" MyRs1.Close Response.Write "URL:
" Response.Write "Texto:

" Response.Write "" Else ' create news form Response.Write "" Response.Write "Data:
" Response.Write "Descrição:
" Response.Write "Texto:

" Response.Write "Categoria:
" Response.Write "Partners:
" MyRs.Close Response.Write "URL:
" Response.Write "" End If Response.Write "
" else ' show news ' Response.Write "
" %>
Notícias de "> <% SQLNew SQLOpen("select * from news where date<=#" & Session("NewsDate") & "# order by date desc") Response.Write "
" Response.Write "" Count=0 While (Not SQLEof)And(Count<30) Count=Count+1 response.write "" Response.Write "" Response.Write "" Response.Write "" Response.Write "" SQLNextRecord Wend Response.Write "
" & SQLField("id") & "" & SQLField("title") & "" ' delete action Response.Write "Apagar " ' update action Response.Write "Alterar " ' validate action If(SQLField("Valid")=False)And(Session("Username")="admin")Then Response.Write "Validar" Response.Write "
" End If %>

 

Adicionar Site   Publicidade   Comentários   Colabore connosco   Missão   Press Release   Imprensa   Contactos   Mapa do Site   Link para o TerraNatal    Parceiros