Jump to content

please add a REAL postAddReply data hook.


Marcher Technologies

Recommended Posts


/* Data Hook Location */

IPSLib::doDataHooks( $post, 'postAddReply' );


/* Finally insert.. */

$this->DB->insert( 'posts', $post );


$post['pid'] = $this->DB->getInsertId();


^ currently the bane of my existence... that is NOT 'post' adding the reply.


/* Data Hook Location */

IPSLib::doDataHooks( $post, 'preAddReply' );


/* Finally insert.. */

$this->DB->insert( 'posts', $post );


$post['pid'] = $this->DB->getInsertId();

/* Data Hook Location */

IPSLib::doDataHooks( $post, 'postAddReply' );


Please? >.< need pid... I looked at the next data hooks down the chain... you do not store it with the topic, you do not hand it to us at any point.... is a wasteful thing to go db diving for anyway and the name of the data hook point denotes something it is not.

Link to comment
Share on other sites



/* Data Hook Location */

IPSLib::doDataHooks( $post, 'postAddReply' );


/* Finally insert.. */

$this->DB->insert( 'posts', $post );


$post['pid'] = $this->DB->getInsertId();


^ currently the bane of my existence... that is NOT 'post' adding the reply.


/* Data Hook Location */

IPSLib::doDataHooks( $post, 'preAddReply' );


/* Finally insert.. */

$this->DB->insert( 'posts', $post );


$post['pid'] = $this->DB->getInsertId();

/* Data Hook Location */

IPSLib::doDataHooks( $post, 'postAddReply' );


Please? >.< need pid... I looked at the next data hooks down the chain... you do not store it with the topic, you do not hand it to us at any point.... is a wasteful thing to go db diving for anyway and the name of the data hook point denotes something it is not.


There's a real easy way to do this.

LibraryHook, extend classPostForms, overload addReply, then use methods getPostData()/getTopicData()
Link to comment
Share on other sites


There's a real easy way to do this.



LibraryHook, extend classPostForms, overload addReply, then use methods getPostData()/getTopicData()



Dd you not hear the main reason? load.... why should i call a method that will run a select for data I already should have? i could use a futher in data hook if i wanted to do that.
How many hijinky 'postAddReply' loads can one board take?
Link to comment
Share on other sites


you did think this through right? if i overload addReply in the one place i can hook in, nothing happens, and here is why.



/**

* Magic __call method

*

* @param object ipsRegistry reference

* @return void

*/

public function __call( $method, $arguments )

{

return parent::__call( $method, $arguments );

}


that method is not defined here, and is being caught and trapped into the unhook-able class.


Of course I thought it through, i've been using that method of overloading in ContentSpy since release.
Link to comment
Share on other sites


see edit.... not quick enough :tongue: i can do the same thing by selecting from the db at postAddReplyTopicUpdate, it is a matter of execution time as well.. we WANT our changes in the post cache, sans fuss.


We cannot do that from there, and we cannot do it before insert sans pid if we need to use that elsewhere(I do).



getPostData() is a magic method, it returns the post data that's already loaded, no extra database calls.


case 'getPostData':


if ( !empty($arguments[0]) )


{


return $this->_postData[ $arguments[0] ];


}


else


{


return $this->_postData;


}


break;

Link to comment
Share on other sites


getPostData() is a magic method, it returns the post data that's already loaded, no extra database calls.



 	 IPSContentCache::update( $post['pid'], 'post', $this->formatPostForCache( $post['post'] ) );


That is the crux of it.... I need to modify the post submission, and I NEED the pid as well, in the same spot, same go, same code exec.
we run that effectively twice then? I'm fairly certain that is heavy... so every mod doing this is stacking another call, when we just need to update the DB and adjust the native data a bit.
While I'm here, add first post has the same issue.... though we have that thankfully via the firstpost flag.... this is a plea for efficiency moreover than anything else..... every other official app has a pre and post for add... why is there an argument even :blink:

Link to comment
Share on other sites


If you're modifying the post, then yes.



That is why i am here.
How many mods can do this at once, even with light changes, before the DB is being locked up on big boards? again, I'm asking for a more efficient entry point.
I already have the need to perform regular expression and a db update here... I do not need to be updating caches multiple times, even by multiple mod interactions.
Link to comment
Share on other sites


That is why i am here.


How many mods can do this at once, even with light changes, before the DB is being locked up on big boards? again, I'm asking for a more efficient entry point.


I already have the need to perform regular exp

ression and a db update here... I do not need to be updating caches multiple times, even by multiple mod interactions.



You didn't mention that you wanted to update the post in your first post, had assumed you just wanted to know when there was a reply. :rofl:
Link to comment
Share on other sites

Archived

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

  • Recently Browsing   0 members

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