Jump to content

DataHook : editPostData


Recommended Posts


It would be alot more usefull if you would add an additional hook here:


/* Data Hook Location */

IPSLib::doDataHooks( &$post, 'editPostData' );

$this->DB->force_data_type = array( 'post_edit_reason' => 'string' );

$this->DB->update( 'posts', $post, 'pid='.$this->_originalPost['pid'] );


IPSLib::doDataHooks( &$post, 'editPostDataAfterUpdate' );

Its usefull if you add any dynamic parsed custom bbcode like for example [ping]IP[/ping].
It can't be saved as HTML because its has to be dynamicly reparsed each time someone refresh the page.

I could add it myself but its not the point.


Link to comment
Share on other sites

Well.. even adding an hook point there the content is immediately saved in the cache table if you have it enabled so it won't solve your issue.

You need to overload the function public_forums_forums_topics::parsePostRow instead, check if your tag is available (strpos?) and perform a replace on-the-fly before display the post.

Link to comment
Share on other sites

Ok it seems ok but it would work only for displayed topic posts and full editor... not for ajax one.

I would also have to overload public_forums_ajax_topics::editBoxSave which is kind of impossible because of ::returnJsonArray which outputs the result to client and does exit().

I cant modify the $_POST['post'] there without rewriting the whole editBoxSave method (sic!).
If i modify the $_POST['post'] before calling the parent::editBoxSave it would save my modifications to the DB (but i dont want that).

Any ideas to do that using hooks ?

Link to comment
Share on other sites


This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...