%@ Language="VBScript" %>
<%
if request.querystring("id")="" Then
server.Transfer("page_not_found.asp")
response.End()
End if
%>
<% Dim conn,rs,sql
'create connection
set conn = server.CreateObject ("ADODB.Connection")
conn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & server.MapPath ("fpdb/engglas.mdb")
'query to select active data...
sql = "SELECT * FROM title, vote where title.active = 'y' and title.id = vote.id"
set rs = server.CreateObject ("ADODB.Recordset")
rs.Open sql, conn, 3, 3
%>
<%
Dim strq,ip,objRs
strq="select top 3 * from fft order by id_num desc"
'response.Write(strq)
Set objRs=objConn.execute(strq)
%>
<%
'Inserting article comments in this block
Dim strq2,notify
ip=Request.ServerVariables("REMOTE_ADDR")
if Request.Form("submit")="Add Comment" Then
notify=request.Form("notify")
if notify<>1 Then
notify=0
end if
strq2= "exec ossp_ins_articlecomments '"&request.form("aid")&"','"&request.Form("pname")&"','"&request.Form("email")&"','"&request.Form("comments")&"','"&date&"','"&ip&"',"¬ify&" "
'*****************************************************************************
'Send mail to subscribed users
Dim htmltxt,objRs_mail,mymail,emailstr
ip=Request.ServerVariables("REMOTE_ADDR")
Set objRs_mail=objConn.execute("ossp_slct_notifyuser " &CINT(request.form("aid")))
Set myMail=Server.CreateObject("CDONTS.NewMail")
myMail.Subject="New comments on article - Organic Spam"
myMail.Bodyformat=0
myMail.mailformat=0
myMail.From="contact@organicspam.com"
While not objRs_mail.eof
myMail.Body="
Hi "&objrs_mail("pname")&",
You were sent this email because " & _
"you opted to receive email notifications when someone responded to the following thread. " & _
"
Thanks, OrganicSpam.com Team"
emailstr=emailstr&objRs_mail("email")&","
objRs_mail.movenext
Wend
myMail.To="webmaster@organicspam.com"
myMail.Bcc=emailstr
myMail.Send
Set myMail=Nothing
objRs_mail.close
Set objRs_mail=nothing
'response.Write(emailstr)
'response.Write(strq)
objConn.execute strq2
response.Write("")
response.Write("")
response.End()
End if
%>
<%
'Rating procedure
if request.Form("submit")="Yes" Then
'set cookie
objConn.execute("ossp_inc_rating 'Y',"&request.QueryString("id"))
response.Cookies("orgspm"&request.QueryString("id"))="Yes"
response.Redirect("view_article.asp?id="&request.QueryString("id"))
End if
if request.Form("submit")="No" Then
'set cookie
objConn.execute("ossp_inc_rating 'N',"&request.QueryString("id"))
response.Cookies("orgspm"&request.QueryString("id"))="No"
response.Redirect("view_article.asp?id="&request.QueryString("id"))
End if
%>
<%
objConn.execute("ossp_inc_view "&request.QueryString("id"))
Dim objRs_slct,co
co=0
Set objRs_slct=objConn.execute("select * from articles where id_num="&Request.QueryString("id"))
While not objRs_slct.eof
co=1
%>
Organic Spam Articles - <%=objRs_slct("title")%>
">
<%=objRs_slct("title")%>
Total Views: <%=objRs_slct("total_views")%>
Posted on: <%=objRs_slct("sdate")%>
<%=objRs_slct("content")%>
<%
objRs_slct.movenext
Wend
objRs_slct.close
Set objRs_slct=nothing
if co=0 Then
Server.Execute("page_not_found.asp")
response.End()
End if
%>
<%
Dim objRs1,pct
Set objRs1=objConn.execute("select * from articles_rating where articles_id="&Request.QueryString("id"))
While not objRs1.eof
if objRs1("total_rate")>0 Then
pct = FormatPercent(Eval(objRs1("rate")/objRs1("total_rate")),1)
else
pct=0
end if
%>
<%
objRs1.movenext
Wend
objRs1.close
Set objRs1=nothing
%>
Comments
<%
dim objRs2
Set objRs2=objConn.execute("select * from articles_comments where articles_id="&Request.querystring("id")&" order by id_num desc")
While not objRs2.EOF
%>