Post in forum, from
outside forum.
We have made a
function in version 7.1 where visitors could comment news written on my page.
When selecting to
comment a post was made in forum, in a category we already have decided what
was. And it would post as the news writer as we include his id and stuff.
All working great.
Now after we have
updated to V 8.2 this function still works, except, the post don’t show op in
the forum, if you select that category. If I track the post via ID I can see
its there. But its not showing up in forum. I know what the problem is, but don’t
how to fix it.
The problem was when
we make a post in forum via our news page it did not create: Start_Thread_ID Last_Thread_ID
So I try the code
below to fix that problem.
Works until some one deletes
a post, then its not right any more.
Lets say Thread_ID 12
was deleted.
Then next Thread_ID will
be 13
But my code will look in forum see that 11 is there + 1 and assume its 12.
And use 12 for my post
:(
strSQL = "SELECT
Max(Thread_ID+1) AS ID FROM tblThread"
lngThreadID =
objConn.Execute(strSQL)("ID")
strSQL = _
"INSERT INTO
tblTopic(Forum_ID,Poll_ID,Moved_ID,Subject,Start_Date,Last_Entry_Date,No_Of_Views,Locked,Priority,NewsID,Start_Thread_ID,Last_Thread_ID)
" & _
"VALUES("&
intForumID &",0,0,'" & strTitleName &
"',GetDate(),GetDate(),0,0,0," & lngNewsID & ","
& lngThreadID & "," & lngThreadID & ")"
objConn.Execute strSQL
strSQL = "SELECT Max(Topic_ID)
AS ID FROM tblTopic"
lngTopicID =
objConn.Execute(strSQL)("ID")
strSQL = _
"INSERT INTO
tblThread(Topic_ID,Author_ID,Message,Message_Date,Show_Signature,IP_Addr)
" & _
"VALUES("
& lngTopicID & "," & strTeamUserID & ",'"
& strTeaser & "',GetDate(),0,'')"
objConn.Execute strSQL
Can you think of a way
i can fix this problem?
Thanks a lot.