Vanilla 1 is no longer supported or maintained. If you need a copy, you can get it here.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
Comments and DiscussionID
When I start a new discussion, the database assigns the discussion a DiscussionID. When posting comments, this number is used to let Vanilla know which discussion we're posting comments on.
Now when I start a new discussion, the content of the discussion is also the first comment. So when I click the 'Post' button It submits the discussion and the comment simultaneously. My question is how does Vanilla know which DiscussionID is assigned to the discussion when placing the first comment?
I know the question is a little bit vague but I'm not very good at describing things, I'm sorry.
0
This discussion has been closed.
Comments
the DiscussionID field in the database is autinocrement, So all you have to do is send the query without a DiscussionID and the database will automatically assign a new autoincremented ID.
Regarding how does it know the FirstCommenID, i do not know that
you should also look here
library/Vanilla/Vanilla.Class.DiscussionManager.php
The method is SaveDiscussion.