%
Dim strConnString, oConn, oRS, oFld
Set oConn = Server.CreateObject("ADODB.Connection")
strConnString = Application("conectar")
oConn.Open strConnString
Set bor = Server.CreateObject("ADODB.Connection")
bor.Open oConn
Set mirar = bor.execute("SELECT * FROM vianewsusuario")
%>
<%
if request.form("opini") = "" or request.form("nom") = "" then
%>
News Comicvia
Los
Campos nombre y opinion no pueden dejarse en blanco.
<%
response.end
end if
if Request.Form("pass") = "" then
Set usu = Server.CreateObject("ADODB.Connection")
usu.Open oConn
dim nameuser
nameuser = ltrim(Request.Form("nom"))
nameuser = rtrim(nameuser)
Set usuarios = usu.execute("SELECT * FROM vianewsusuario where usuario = '" & nameuser & "'" )
if usuarios.eof = false then
response.write "Usuario registrado, inserta contraseña"
response.end
end if
Set usu = nothing
end if
if Request.Form("pass") <> "" then
'do until mirar.eof = true
Set usu = Server.CreateObject("ADODB.Connection")
usu.Open oConn
'dim nameuser
nameuser = ltrim(Request.Form("nom"))
nameuser = rtrim(nameuser)
sql = "SELECT * FROM vianewsusuario where usuario = '" & nameuser & "' and pass = '" & Request.Form("pass") & "'"
'response.write sql
'response.end
Set usuarios = usu.execute(sql)
'if Request.Form("nom") = mirar("usuario") and Request.Form("pass") = mirar("pass") then
'bor.Execute "insert into vianewscomentarios (mono, opinion, puntua, nombre) values (" & Request.Form("id") & ",'" & Request.Form("opini") & "'," & Request.Form("puntua") & ",'" & Request.Form("nom") & "')"
if not usuarios.eof then
bor.Execute "insert into vianewscomentarios (mono, opinion, puntua, nombre) values (" & Request.Form("id") & ",'" & Request.Form("opini") & "'," & Request.Form("puntua") & ",'" & Request.Form("nom") & "')"
' set bor = nothing
' exit do
response.write "Gracias por opinar."
else
'response.redirect ("error.htm")
response.write "Contraseña incorrecta"
'exit do
end if
'mirar.movenext
'loop
else
bor.Execute "insert into vianewscomentarios (mono, opinion, puntua, nombre) values (" & Request.Form("id") & ",'" & Request.Form("opini") & "'," & Request.Form("puntua") & ",'" & Request.Form("nom") & "')"
set bor = nothing
end if
'response.end
' ENVIARLO AL FORO.
if request.form("opini") <> "" Then
idnoticia = Request.Form("id")
Set monografico = server.CreateObject("ADODB.recordset")
monografico.Open "select * from mensaje where noticias = " & idnoticia & "", oConn, 3,3
Set noticia = server.CreateObject("ADODB.recordset")
noticia.Open "select * from vianewsnoticia where id = " & idnoticia & "", oConn, 3,3
Set foro = server.CreateObject("ADODB.recordset")
foro.Open "select * from mensaje order by id desc", oConn, 3,3
Set foro11 = server.CreateObject("ADODB.recordset")
foro11.Open "select * from foro where id = 1", oConn, 3,3
if monografico.eof then
if foro.eof then
id = 1
else
foro11.fields("ultimomensaje") = date
foro11.fields("temas") = foro11("temas") + 1
id = foro("id") + 1
end if
foro11.update
Set foro = server.CreateObject("ADODB.recordset")
foro.Open "select * from mensaje", oConn, 3,3
' PRIMER MENSAJE FORO.
foro.addnew
foro.fields("titulomensaje") = "
Noticia " & noticia("titulo")
foro.fields("foro") = "1"
mensajemonografico = noticia("descripcion")
foro.fields("mensaje") = mensajemonografico
foro.fields("autor") = "Comicvia"
foro.fields("respuestas") = "1"
foro.fields("vistos") = "1"
foro.fields("fechaalta") = now
foro.fields("fecharespuesta") = now
foro.fields("noticias") = noticia("id")
foro.update
else
foro11.fields("ultimomensaje") = date
foro11.fields("mensajes") = foro11("mensajes") + 1
foro11.update
id = monografico("id")
end if
' ESTE SERIA EL MENSAJE DEL COMPI.
Set foro = server.CreateObject("ADODB.recordset")
foro.Open "select * from respuestas", oConn, 3,3
foro.addnew
foro.fields("idmensaje") = id
foro.fields("titulomensaje") = "Comentario Noticia"
opinion = request.form("opini")
opinion = opinion & "
Puntuación : " & request.form("puntuacion")
foro.fields("mensaje") = opinion
if session("nombre") <> "" Then
foro.fields("autor") = session("nombre")
else
if Request.Form("nom") <> "" then
foro.fields("autor") = Request.Form("nom")
else
foro.fields("autor") = "invitado"
end if
end if
foro.fields("fecha") = date
foro.update
end if
%>
--**--
--**--
GRACIAS POR OPINAR. --**--
--**--