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: General / Current Version (Old)
 Post topic from "external" asp application
 New Topic  Topic Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

GhorZonia
New Member

Finland
60 Posts

Posted - 18 April 2001 :  17:08:56  Show Profile  Visit GhorZonia's Homepage
I have coded a fairly simple database driven news application for my site. I would like that every time I post a news article the a new topic will be created in the forum with the same subject and message as the original news post. This because now people could easily comment the news.

I know this has been asked before but I only need a little help as I don't know how Snitz creates all posts etc.

I would need to know which pieces of code in post_info.asp handle the creation of a new topic, or more specificly, which do I need to use in my news posting application.

Correct me if I'm wrong, but this next piece of code (line 446) should be the one inserting the new topic.


'## Forum_SQL - Add new post to Topics Table
strSql = "INSERT INTO " & strTablePrefix & "TOPICS (FORUM_ID"
strSql = strSql & ", CAT_ID"
strSql = strSql & ", T_SUBJECT"
strSql = strSql & ", T_MESSAGE"
strSql = strSql & ", T_AUTHOR"
strSql = strSql & ", T_LAST_POST"
strSql = strSql & ", T_LAST_POST_AUTHOR"
strSql = strSql & ", T_DATE"
strSql = strSql & ", T_STATUS"
if strIPLogging <> "0" then
strSql = strSql & ", T_IP"
end if
strSql = strSql & ", T_MAIL"
strSql = strSql & ") VALUES ("
strSql = strSql & Request.Form("FORUM_ID")
strSql = strSql & ", " & Request.Form("CAT_ID")
strSql = strSql & ", '" & txtSubject & "'"
strSql = strSql & ", '" & txtMessage & "'"
strSql = strSql & ", " & rs("MEMBER_ID")
strSql = strSql & ", '" & DateToStr(strForumTimeAdjust) & "'"
strSql = strSql & ", " & rs("MEMBER_ID")
strSql = strSql & ", '" & DateToStr(strForumTimeAdjust) & "'"
if Request.Form("lock") = 1 then
strSql = strSql & ", 0 "
else
strSql = strSql & ", 1 "
end if
if strIPLogging <> "0" then
strSql = strSql & ", '" & Request.ServerVariables("REMOTE_ADDR") & "'"
end if
strSql = strSql & ", " & TF & ")"

my_Conn.Execute (strSql)



But, I think that I need to do something else also. The counts should perhaps be updated, or am I wrong on that? Line 487.


'## Forum_SQL - Increase count of topics and replies in Forum table by 1
strSql = "UPDATE " & strTablePrefix & "FORUM "
strSql = strSql & " SET F_LAST_POST = '" & DateToStr(strForumTimeAdjust) & "'"
strSql = strSql & ", F_TOPICS = F_TOPICS + 1"
strSql = strSql & ", F_COUNT = F_COUNT + 1"
strSql = strSql & ", F_LAST_POST_AUTHOR = " & rs("MEMBER_ID") & ""
strSql = strSql & " WHERE FORUM_ID = " & Request.Form("FORUM_ID")

my_Conn.Execute (strSql)


Is there anything else that should be inserted/updated? Some counts maybe?

Hope you understood what I mean

GhorZonia
New Member

Finland
60 Posts

Posted - 19 April 2001 :  12:36:25  Show Profile  Visit GhorZonia's Homepage
Doesn't anyone know?

Should the members table be updated as my post count should increase with every new topic?
Go to Top of Page

HuwR
Forum Admin

United Kingdom
20584 Posts

Posted - 19 April 2001 :  13:04:25  Show Profile  Visit HuwR's Homepage
If you look in post.asp, for the topic insert, you should see which counts need updating.

Go to Top of Page

GhorZonia
New Member

Finland
60 Posts

Posted - 19 April 2001 :  16:32:54  Show Profile  Visit GhorZonia's Homepage
YEAH! I got it to work! **** I'm proud of myself!!

Thanks for your reply HuwR, it helped me alot.

P.S. Woohoo!
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.43 seconds. Powered By: Snitz Forums 2000 Version 3.4.07