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.
Options

Point of Comment Insertion?

edited February 2007 in Vanilla 1.0 Help
Hi everyone,

I've got a really odd question but hopefully someone can help me out. I need to make a mysql insert statement to a database outside of vanilla when a user successfully makes a post to the forum. I've spent a good 5 hours now trying to figure out where in the hell I can do that. I can include my settings file and connect to the database and grab from it, insert to it, etc etc... but that's all from the include file direct without any function calls... I can't seem to find out where to add my function to do the rest in the vanilla core...

I'm not looking to make an extension as I don't have the time to learn how the system works, i just want this done quick & dirty. This vanilla install won't be upgraded so I'm not worried about future updates overriding this hack-in.

Can anyone point me to the right section of code I need to be in?

Comments

  • Options
    edited February 2007
    library/Vanilla/Vanilla.Control.DiscussionForm.php, line 132

    Assuming your function is self-contained:function MyFunction(&$DiscussionForm) { // do stuff $Comment = $DiscussionForm->Context->DelegateParameters['ResultComment']; if ($Comment) // do stuff with the result comment (I.E. this would check to make sure the comment saved sucessfully, etc.) } $Context->AddToDelegate('DiscussionForm','PostSaveComment','MyFunction');
    Name this default.php with the extension headers, and you have a extension.
  • Options
    Work's perfectly. It also gave me a bit more information as to how extensions actually work regarding post back controls.

    Thanks a lot WallPhone! +5 For you :)
This discussion has been closed.