Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Help Groups for Snitz Forums 2000 Users
 Help: MOD Implementation
 Help with Reply code to update Topics Table
 New Topic  Topic Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

StephenD
Senior Member

Australia
1044 Posts

Posted - 14 June 2005 :  07:38:42  Show Profile  Send StephenD a Yahoo! Message
I've got a custom post.asp page that updates custom fields in the Topics table when you post a new topic or edit a topic.

What I would like to do is update those same fields when I reply or replyquote to a topic using the same custom post.asp

I've tried just adding strRqMethod="Reply" in various places but I think I need to pull the data from the Topics table into the query the same time I pull the data to post the reply.

If anyone thinks they can help with this, here's a link to my custom post page. The bits I want updated for reply and replyquote are marked by '###############This code here###############

http://www.stephendoyle.net/post_applicant.txt


Edited by - StephenD on 14 June 2005 07:43:13

StephenD
Senior Member

Australia
1044 Posts

Posted - 21 June 2005 :  02:05:41  Show Profile  Send StephenD a Yahoo! Message
I can get the custom fields to display on the Reply to Topic Form ok but after that I'm a bit lost.
Go to Top of Page

StephenD
Senior Member

Australia
1044 Posts

Posted - 24 June 2005 :  00:25:45  Show Profile  Send StephenD a Yahoo! Message
Alright, I've nearly got it. I've got the custom fields appearing and populated correctly on the Reply to topic form. Just trying to pass it through post_info.

Its these 4 fields in the Topics table that I need updated the same time a reply is posted:
strSql = strSql & ", LOCATION = '" & txtLocation & "'"
strSql = strSql & ", T_MSGICON = " & cLng(Request.Form("strMessageIcon"))
strSql = strSql & ", T_SCSTAT = " & cLng(Request.Form("strSCIcon"))
strSql = strSql & ", T_EVENT_DATE = '" & dateHolder & "'"


I really need help here. Here's a link to my post and post info files.
http://www.stephendoyle.net/post_applicant2.txt
http://www.stephendoyle.net/post_info_applicant2.txt

Can anyone please show me which Insert Into statements I need to modify.

Edited by - StephenD on 24 June 2005 00:33:22
Go to Top of Page

Shaggy
Support Moderator

Ireland
6780 Posts

Posted - 24 June 2005 :  04:53:40  Show Profile
You'll find the code to update the TOPICS table beginning on line 1088 of your post_info file. If you have moderation turned on, you'll also need to edit the UpdateTopic sub in pop_moderation as well.


Search is your friend
“I was having a mildly paranoid day, mostly due to the
fact that the mad priest lady from over the river had
taken to nailing weasels to my front door again.”
Go to Top of Page

StephenD
Senior Member

Australia
1044 Posts

Posted - 24 June 2005 :  06:08:24  Show Profile  Send StephenD a Yahoo! Message
Thank you so much Shaggy, I've now got 3 out of the 4 fields updating on submit. My code in that block now looks like this:
			'## Forum_SQL - Update Last Post and count
			strSql = "UPDATE " & strActivePrefix & "TOPICS "
			strSql = strSql & " SET T_LAST_POST = '" & DateToStr(strForumTimeAdjust) & "'"
			strSql = strSql & ",    T_REPLIES = T_REPLIES + 1 "
			strSql = strSql & ",    T_LAST_POST_AUTHOR = " & rs("MEMBER_ID")
			strSql = strSql & ",    T_LAST_POST_REPLY_ID = " & NewReplyID
			strSql = strSql & ", 	LOCATION = '" & txtLocation & "'"
			strSql = strSql & ", 	T_MSGICON = " & cLng(Request.Form("strMessageIcon"))
			strSql = strSql & ", 	T_SCSTAT = " & cLng(Request.Form("strSCIcon"))
			strSql = strSql & ", 	T_EVENT_DATE = '" & dateHolder & "'"
			if Request.Form("lock") = 1 and ForumChkSkipAllowed = 1 then
				strSql = strSql & ",        T_STATUS = 0 "
			end if
			strSql = strSql & " WHERE TOPIC_ID = " & Topic_ID

The only field that is not updating is T_EVENT_DATE. It is setting the field to Null. Here's my updated txt file. http://www.stephendoyle.net/post_info_applicant2.txt

..so close..
Go to Top of Page

Shaggy
Support Moderator

Ireland
6780 Posts

Posted - 24 June 2005 :  06:16:28  Show Profile
Only think I can spot straight off is that the date field in your form is named event_Date whereas you're looking for event_date when processing the form. Never realised case sensitivity was an issue when calling field names so that may not be it.


Search is your friend
“I was having a mildly paranoid day, mostly due to the
fact that the mad priest lady from over the river had
taken to nailing weasels to my front door again.”
Go to Top of Page

StephenD
Senior Member

Australia
1044 Posts

Posted - 24 June 2005 :  06:17:48  Show Profile  Send StephenD a Yahoo! Message
OK, trying that now...
Go to Top of Page

StephenD
Senior Member

Australia
1044 Posts

Posted - 24 June 2005 :  06:22:07  Show Profile  Send StephenD a Yahoo! Message
Nah, sorry that's not it. It works when you post a new topic or edit a topic. Something to do with the dateholder code.(best uneducated guess)
Go to Top of Page

StephenD
Senior Member

Australia
1044 Posts

Posted - 24 June 2005 :  06:29:46  Show Profile  Send StephenD a Yahoo! Message
Got it! Copied and pasted this:
if Request.Form("event_date")="" then
		dateHolder=""
		else
		dateHolder = DatetoStr(CDate(Request.Form("event_date")))
	       end if

to just above that previous block of code.
Thank you so much again Shaggy. This has taken me hours and hours...
Go to Top of Page

Shaggy
Support Moderator

Ireland
6780 Posts

Posted - 24 June 2005 :  07:17:01  Show Profile
Weird! Don't see how that would have caused a problem, but as long as it works You're welcome, man.


Search is your friend
“I was having a mildly paranoid day, mostly due to the
fact that the mad priest lady from over the river had
taken to nailing weasels to my front door again.”
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Topic Locked
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.35 seconds. Powered By: Snitz Forums 2000 Version 3.4.07