<%p content%>
<%
'GET COMMENT COUNT FOR THIS IMAGE
commentcount = 0
sql = "SELECT * FROM blogComments WHERE permKeyConnect=" & permKey & "" 'GET ALL THE COMMENTS THAT HAVE THE SAME PICTURE KEY AS THE CURRENT IMAGES KEY
set rsComment = conn1.execute(sql)
do while not rsComment.eof 'LOOP THROUGH ALL THE COMMENTS THAT HAVE THE SAME PICTURE KEY, AND KEEP THE COUNT
commentCount = commentCount + 1 'INCREMENT COUNTER
rsComment.MoveNext
loop
%>
<%
commentAction = Request.QueryString("commentAction") 'which entry should comments be displayed
'commentAction was a string, whereas permKey was a number, and the two were showing false when compared - solution: convert commentAction to an integer.
commentAction = Cint(commentAction)
if commentAction <> permKey then
'permanent means only one entry is being shown - so the displayStart/End needs to be taken out
if permanent = "yes" then %>
[ <%p commentcount%> ]
<% else %>
[ <%p commentcount%> ]
<% end if %>
show comments
<% else
'permanent means only one entry is being shown - so the displayStart/End needs to be taken out
if permanent = "yes" then %>
[ <%p commentcount%> ]
<% else %>
[ <%p commentcount%> ]
<% end if %>
hide comments
<% end if %>
<%
linkCalled = request.queryString("linkCalled")
if linkCalled = "" then %>
link this
<% elseif linkCalled = "yes" then %>
hide link
<% end if %>
archive:
<%p tag1%>
<%p tag2%>
<%p tag3%>
<%p tag4%>
<%p tag5%>
<% raction = request.queryString("raction") if linkCalled = "yes" then %>
Linking to this entry?
Use this URL : http://www.susanbuck.net/sb/words/index.asp?permanent=yes&permKey=<%p permKey%> <% end if %> <% if (count MOD 2 = 0) AND (permKey <> "") then %>
<% end if %> <% if permKey = commentAction then 'only if there is a commentAction do you do something %>
Comments
<% 'get all comments from the blogComments table where the permKeyConnect matches the connecting blog entry via commentAction getCommentSQL = "SELECT * FROM blogComments WHERE permKeyConnect=" & commentAction & "" Set rsGetComment = Conn1.Execute(getCommentSQL) 'THIS IS FOR DISPLAYING COMMENTS 'set up variables for each comment color = "on" Do While Not rsGetComment.EOF namePrex = rsGetComment.fields ("name") name1x = Replace(namePrex,"[[]]","""") name2x = Replace(name1x,"[]","'") theDate = rsGetComment.fields ("theDate") emailPre = rsGetComment.fields ("email") email1 = Replace(emailPre,"[[]]","""") email2 = Replace(email1,"[]","'") webAddressPre = rsGetComment.fields ("webAddress") webAddress1 = Replace(webAddressPre,"[[]]","""") webAddress2 = Replace(webAddress1,"[]","'") commentsPre = rsGetComment.fields ("comments") comments1 = Replace(commentsPre,"[[]]","""") comments2 = Replace(comments1,"[]","'") permKeyConnect = rsGetComment.fields ("permKeyConnect") %> <% if color = "on" then %>
<% color = "off"
else %>
<% rsGetComment.MoveNext Loop %> <% submitAction = Request.QueryString("submitAction") 'if just viewing comments, set the values from any stored cookie values if submitAction = "" then nameValue = request.cookies("name") emailValue = request.cookies("email") commentValue = request.cookies("comments") webAddressvalue = request.cookies("webAddress") elseif submitAction = "clear" then nameValue = "" emailValue = "" commentValue = "" webAddressValue = "" else nameValue = request.queryString("nameValue") emailValue = request.queryString("emailValue") commentValue = request.queryString("commentValue") webAddressValue = request.queryString("webAddressValue") end if 'THIS IS FOR ADDING COMMENTS Select case(submitAction) case "add" 'SAVE COOKIES 'only do it if the check box is checked if Request.Form("rememberMe") = "checked" then Response.Cookies("name") = Request.Form("name") Response.Cookies("name").Expires=#January 18, 2038# Response.Cookies("email") = Request.Form("email") Response.Cookies("email").Expires=#January 18, 2038# Response.Cookies("comments") = Request.Form("comments") Response.Cookies("comments").Expires=#January 18, 2038# Response.Cookies("webAddress") = Request.Form("webAddress") Response.Cookies("webAddress").Expires=#January 18, 2038# else Response.Cookies("name") = "" Response.Cookies("email") = "" Response.Cookies("comments") = "" Response.Cookies("webAddress") = "" end if namePre = Request.Form("name") name1 = Replace(namePre,"""","[[]]") name2 = Replace(name1,"'","[]") name3 = Replace(name2,",","") 'fix for weird bug where commas are being added emailPre = Request.Form("email") email1 = Replace(emailPre,"""","[[]]") email2 = Replace(email1,"'","[]") email3 = Replace(email2,",","") 'fix for weird bug where commas are being added webAddressPre = Request.Form("webAddress") webAddress1 = Replace(webAddressPre,"""","[[]]") webAddress2 = Replace(webAddress1,"'","[]") webAddress3 = Replace(webAddress2,",","") 'fix for weird bug where commas are being added commentsPre = Request.Form("comments") comments1 = Replace(commentsPre,"""","[[]]") comments2 = Replace(comments1,"'","[]") comments3 = Replace(comments2,",","") 'fix for weird bug where commas are being added theDate2 = month(date) & "/" & day(date) & "/" & year(date) userIP = Request.ServerVariables("REMOTE_HOST") Set myMail=CreateObject("CDO.Message") myMail.Subject="susanbuck.net BLOG comments for [" & title & "]" myMail.From = emailPre myMail.To="susancbk@gmail.com" myMail.HTMLBody = namePre & " (" & emailPre & ") wrote on " & theDate2 & " about the image [" & title & "] -
" & commentsPre & "" myMail.Send set myMail=nothing sqlAdd = "INSERT into blogComments (userIP,theDate,permKeyConnect,name,email,webAddress,comments) VALUES ('" & userIP &"','" & theDate2 &"','" & commentAction &"','" & name3 &"','" & email3 & "','" & webAddress3 & "','" & comments3 & "')" conn1.Execute(sqlAdd) Response.Redirect "index.asp?displayStart=" & displayStart & "&displayEnd=" & displayEnd & "&commentAction=" & commentAction case "errorName" errorMsg = "Please enter your name." case "errorEmail" errorMsg = "Please enter your email address." case "errorComments" errorMsg = "Please enter a comment." case "errorSpamPrevention" errorMsg = "Please fill in the spam prevention question." end select %>
Name
Email (won't be posted)
Web Address (optional)
What color is a stop light? (spam preventionBy answering this question you're proving you're a human, not a computer trying to leave me spam.)
<%
color = "on"
end if
If webAddress2 = "" Then
p name2x
Else%>
<%p name2x%>
<%End If%>
wrote on <%p theDate%> -
<%p comments2%>
<%p comments2%>
<% rsGetComment.MoveNext Loop %> <% submitAction = Request.QueryString("submitAction") 'if just viewing comments, set the values from any stored cookie values if submitAction = "" then nameValue = request.cookies("name") emailValue = request.cookies("email") commentValue = request.cookies("comments") webAddressvalue = request.cookies("webAddress") elseif submitAction = "clear" then nameValue = "" emailValue = "" commentValue = "" webAddressValue = "" else nameValue = request.queryString("nameValue") emailValue = request.queryString("emailValue") commentValue = request.queryString("commentValue") webAddressValue = request.queryString("webAddressValue") end if 'THIS IS FOR ADDING COMMENTS Select case(submitAction) case "add" 'SAVE COOKIES 'only do it if the check box is checked if Request.Form("rememberMe") = "checked" then Response.Cookies("name") = Request.Form("name") Response.Cookies("name").Expires=#January 18, 2038# Response.Cookies("email") = Request.Form("email") Response.Cookies("email").Expires=#January 18, 2038# Response.Cookies("comments") = Request.Form("comments") Response.Cookies("comments").Expires=#January 18, 2038# Response.Cookies("webAddress") = Request.Form("webAddress") Response.Cookies("webAddress").Expires=#January 18, 2038# else Response.Cookies("name") = "" Response.Cookies("email") = "" Response.Cookies("comments") = "" Response.Cookies("webAddress") = "" end if namePre = Request.Form("name") name1 = Replace(namePre,"""","[[]]") name2 = Replace(name1,"'","[]") name3 = Replace(name2,",","") 'fix for weird bug where commas are being added emailPre = Request.Form("email") email1 = Replace(emailPre,"""","[[]]") email2 = Replace(email1,"'","[]") email3 = Replace(email2,",","") 'fix for weird bug where commas are being added webAddressPre = Request.Form("webAddress") webAddress1 = Replace(webAddressPre,"""","[[]]") webAddress2 = Replace(webAddress1,"'","[]") webAddress3 = Replace(webAddress2,",","") 'fix for weird bug where commas are being added commentsPre = Request.Form("comments") comments1 = Replace(commentsPre,"""","[[]]") comments2 = Replace(comments1,"'","[]") comments3 = Replace(comments2,",","") 'fix for weird bug where commas are being added theDate2 = month(date) & "/" & day(date) & "/" & year(date) userIP = Request.ServerVariables("REMOTE_HOST") Set myMail=CreateObject("CDO.Message") myMail.Subject="susanbuck.net BLOG comments for [" & title & "]" myMail.From = emailPre myMail.To="susancbk@gmail.com" myMail.HTMLBody = namePre & " (" & emailPre & ") wrote on " & theDate2 & " about the image [" & title & "] -
" & commentsPre & "" myMail.Send set myMail=nothing sqlAdd = "INSERT into blogComments (userIP,theDate,permKeyConnect,name,email,webAddress,comments) VALUES ('" & userIP &"','" & theDate2 &"','" & commentAction &"','" & name3 &"','" & email3 & "','" & webAddress3 & "','" & comments3 & "')" conn1.Execute(sqlAdd) Response.Redirect "index.asp?displayStart=" & displayStart & "&displayEnd=" & displayEnd & "&commentAction=" & commentAction case "errorName" errorMsg = "Please enter your name." case "errorEmail" errorMsg = "Please enter your email address." case "errorComments" errorMsg = "Please enter a comment." case "errorSpamPrevention" errorMsg = "Please fill in the spam prevention question." end select %>
Name
Email (won't be posted)
Web Address (optional)
What color is a stop light? (spam preventionBy answering this question you're proving you're a human, not a computer trying to leave me spam.)
<%p errorMsg%>
<%
end if 'end if test to see if a comment is being called for
%>
<% rsBlogs.MoveNext loop %>
<%
' if at start, with no previous entries, don't display previous button
if displayStart < 2 OR permanent = "yes" then
' do nothing
else %>