Function createPost improvement

Arantor

  • As powerful as possible, as complex as necessary.
  • Posts: 14,278
Re: Function createPost improvement
« Reply #15, on May 12th, 2011, 06:12 PM »
It is, prior to going into createPost. I seem to recall that hook being outside the create function though.
When we unite against a common enemy that attacks our ethos, it nurtures group solidarity. Trolls are sensational, yes, but we keep everyone honest. | Game Memorial

Nao

  • Dadman with a boy
  • Posts: 16,079
Re: Function createPost improvement
« Reply #16, on May 12th, 2011, 06:21 PM »
No, it was inside.
$topicOptions['id'] has the topic ID but I'm not sure we can determine whether it's a new topic in create_post_after, though. It can be done in create_post_before by testing for the topic ID (empty), but not after -- I think. It may be smart to add &$new_topic as a parameter in the create_post_after (and in create_post_before, in case you want to 'cancel' the new topic status and redirect the post to an existing topic.)
I'll do just that. (Actually, done.) (Just needs to be committed.)

Arantor

  • As powerful as possible, as complex as necessary.
  • Posts: 14,278
Re: Function createPost improvement
« Reply #17, on May 12th, 2011, 06:23 PM »
Awesome (and a huge improvement)

Thing is, I could have sworn the create-topic hook in SMF was outside createPost because I did SD's equivalent inside the equivalent function and at the time I could have sworn I did so deliberately. But that was most of a year ago I added that integration hook to SD...

Nao

  • Dadman with a boy
  • Posts: 16,079