add dropdownlist to post.asp

Snitz™ Forums 2000
https://forum.snitz.com/forumTopic/Posts/60870?pagenum=1
05 November 2025, 14:11

Topic


tribaliztic
add dropdownlist to post.asp
01 February 2006, 04:02


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? <

 

Replies ...


laser
01 February 2006, 04:35


How do I check if the post is the first post or a reply? Check the method variable that is passed to post.asp

How do I check if the post is done in forum with id 85? Check the FORUM_ID variable that is passed to post.asp<
tribaliztic
01 February 2006, 04:44


*doh*
Thanks... <
laser
01 February 2006, 04:56


wink All the answers are here on this very page smile<
tribaliztic
01 February 2006, 05:15


Yeah, sometimes it would be best if one could think ONE more time before posting =)
<
laser
01 February 2006, 05:38


Don't worry mate, it happens to all of us at one time or another.<
tribaliztic
01 February 2006, 07:28


So I got this working.. I stole the code for selecting forum in edit-mode. But where is this saved to the db? I have to add this to the sql-string but can't find it... <
gcoral
01 February 2006, 10:40


I had no answer!<
tribaliztic
01 February 2006, 10:50


uuh...? <
cripto9t
01 February 2006, 12:20


not exactly sure what you want, but everything entered in post.asp is entered using post_info.asp.
Look for
Code:
if MethodType = "Topic" then
<
tribaliztic
02 February 2006, 03:11


ah, I'll have a look in post_info.asp. Thanks. <
tribaliztic
02 February 2006, 07:13


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... <
cripto9t
02 February 2006, 07:48


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"))
<
tribaliztic
02 February 2006, 08:00


DOH!! That's how a real copy-paste-coder does =)
Thanks for pointing out what I sould've seen already! <
cripto9t
02 February 2006, 08:14


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 ########################
<
tribaliztic
02 February 2006, 08:53


Ok, it IS working though.. Why should it not work? =)<
cripto9t
02 February 2006, 12:45


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<
tribaliztic
03 February 2006, 05:47


Okay, txtSubject may be removable, the other I don't know.. It IS working =)
<
© 2000-2021 Snitz™ Communications