add dropdownlist to post.asp - Posted (1615 Views)
Senior Member
tribaliztic
Posts: 1532
1532
I would like to add a dropdownlist where the user can select stuff when starting a topic IF the topic is placed in a certain forum.
So: user 1 start a topic in forum with id 85, the dropdownlist is shown and the selection is entered in the db
user 2 post a reply to the topic and NO dropdownlist is shown.
How do I check if the post is the first post or a reply? How do I check if the post is done in forum with id 85? <
/Tribaliztic
- www.gotlandrace.se -
 Sort direction, for dates DESC means newest first  
 Page size 
Posted
Senior Member
tribaliztic
Posts: 1532
1532
I'm getting an sql-error on this...
-----------------
UPDATE FORUM_TOPICS SET T_MESSAGE = 'actual message', SET T_PICLINK = 'picture.gif', SET T_INGRESS = 'new test of ingress', SET T_ARTICLECAT = 'blah category', T_SUBJECT = 'ny test', T_MSGICON = 1, T_POLLSTATUS = 1, T_SIG = 1, T_LAST_EDIT = '20060202131103', T_LAST_EDITBY = 20, T_STICKY = 0 WHERE TOPIC_ID = 3616
-----------------
the sql starts on line 680 in this file:
http://www.gotlandrace.se/tabort/post_info.txt

What's wrong? The code looks the same (I think..) for "if MethodType = "Topic" then" and that works... <
/Tribaliztic
- www.gotlandrace.se -
Posted
Average Member
cripto9t
Posts: 881
881
Remove Set. You only need one ;)
Code:

		'## Forum_SQL
strSql = "UPDATE " & strActivePrefix & "TOPICS "
strSql = strSql & " SET T_MESSAGE = '" & txtMessage & "'"
strSql = strSql & ", SET T_PICLINK = '" & PicLink & "'"
strSql = strSql & ", SET T_INGRESS = '" & Ingress & "'"
strSql = strSql & ", SET T_ARTICLECAT = '" & ArticleCat & "'"
strSql = strSql & ", T_SUBJECT = '" & txtSubject & "'"
' strSql = strSql & ", T_EVENT_DATE = '" & dateHolder & "'"
strSql = strSql & ", T_MSGICON = " & cLng(Request.Form("strMessageIcon"))
<
    _-/Cripto9t\-_
Posted
Senior Member
tribaliztic
Posts: 1532
1532
DOH!! That's how a real copy-paste-coder does =)
Thanks for pointing out what I sould've seen already! <
/Tribaliztic
- www.gotlandrace.se -
Posted
Average Member
cripto9t
Posts: 881
881
The "Topic" part looks ok except I didn't see your error msg fo ingress.
This part don't look right in "EditTopic"
Code:
	if Request.Form("modedit") = "true" then
txtMessage = txtMessage & "<br>This post was edited by a moderator at " & DateToStr(strForumTimeAdjust)
ArticleCat = ChkString(Request.Form("ArticleCat"),"SQLString")
PicLink = ChkString(Request.Form("PicLink"),"SQLString")
Ingress = ChkString(Request.Form("Ingress"),"SQLString")
txtSubject = ChkString(Request.Form("Subject"),"SQLString")
else
txtMessage = chkString(Request.Form("Message"),"message")
ArticleCat = ChkString(Request.Form("ArticleCat"),"SQLString")
PicLink = ChkString(Request.Form("PicLink"),"SQLString")
Ingress = ChkString(Request.Form("Ingress"),"SQLString")
txtSubject = ChkString(Request.Form("Subject"),"SQLString")
end if
txtSubject = chkString(Request.Form("Subject"),"SQLString")
' ######################### Poll Mod ########################
It would work unless a mod edited. Maybe this
Code:
        txtMessage = chkString(Request.Form("Message"),"message")
ArticleCat = ChkString(Request.Form("ArticleCat"),"SQLString")
PicLink = ChkString(Request.Form("PicLink"),"SQLString")
Ingress = ChkString(Request.Form("Ingress"),"SQLString")
txtSubject = ChkString(Request.Form("Subject"),"SQLString")
if Request.Form("modedit") = "true" then
txtMessage = txtMessage & "<br>This post was edited by a moderator at " & DateToStr(strForumTimeAdjust)
end if
' ######################### Poll Mod ########################
<
    _-/Cripto9t\-_
Posted
Senior Member
tribaliztic
Posts: 1532
1532
Ok, it IS working though.. Why should it not work? =)<
/Tribaliztic
- www.gotlandrace.se -
Posted
Average Member
cripto9t
Posts: 881
881
If "modedit" = true, you haven't given a value to "txtMessage" that I can see. Maybe I'm missing it :^)

Code:
	if Request.Form("modedit") = "true" then
'You haven't pulled it from the form yet, so txtMessage = "" at this point
txtMessage = txtMessage & "<br>This post was edited by a moderator at " & DateToStr(strForumTimeAdjust)
ArticleCat = ChkString(Request.Form("ArticleCat"),"SQLString")
PicLink = ChkString(Request.Form("PicLink"),"SQLString")
Ingress = ChkString(Request.Form("Ingress"),"SQLString")
txtSubject = ChkString(Request.Form("Subject"),"SQLString")
else
txtMessage = chkString(Request.Form("Message"),"message") 'Works here
ArticleCat = ChkString(Request.Form("ArticleCat"),"SQLString")
PicLink = ChkString(Request.Form("PicLink"),"SQLString")
Ingress = ChkString(Request.Form("Ingress"),"SQLString")
txtSubject = ChkString(Request.Form("Subject"),"SQLString")
end if

txtSubject = chkString(Request.Form("Subject"),"SQLString")
also "txtSubject" is defined twice. just extra code<
    _-/Cripto9t\-_
Posted
Senior Member
tribaliztic
Posts: 1532
1532
Okay, txtSubject may be removable, the other I don't know.. It IS working =)
<
/Tribaliztic
- www.gotlandrace.se -
You Must enter a message