Sign in to follow this  
Followers 0

please add a REAL postAddReply data hook.

11 posts in this topic

Posted


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.


/* 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' );

TSP likes this

Share this post


Link to post
Share on other sites

Posted

[quote name='Marcher Technologies' timestamp='1343381699' post='2291431']

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()


/* 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' );

Share this post


Link to post
Share on other sites

Posted

[quote name='stoo2000' timestamp='1343384160' post='2291440']
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?

Share this post


Link to post
Share on other sites

Posted

Yeah. I agree, I want it to be possible to edit in some additonal info (with hook, on reply/start new) to the post content after both topicid and postid have been returned.

Share this post


Link to post
Share on other sites

Posted

[quote name='Marcher Technologies' timestamp='1343384430' post='2291441']
you did think this through right? if i overload addReply in the one place i can hook in, nothing happens, and here is why.

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.


/**

* Magic __call method

*

* @param object ipsRegistry reference

* @return void

*/

public function __call( $method, $arguments )

{

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

}

Share this post


Link to post
Share on other sites

Posted

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

Share this post


Link to post
Share on other sites

Posted

[quote name='Marcher Technologies' timestamp='1343385075' post='2291445']
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;











Share this post


Link to post
Share on other sites

Posted

[quote name='stoo2000' timestamp='1343385379' post='2291446']
getPostData() is a magic method, it returns the post data that's already loaded, no extra database calls.


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:

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

Share this post


Link to post
Share on other sites

Posted

If you're modifying the post, then yes.

Share this post


Link to post
Share on other sites

Posted

[quote name='stoo2000' timestamp='1343386089' post='2291449']
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.

Share this post


Link to post
Share on other sites

Posted

[quote name='Marcher Technologies' timestamp='1343386514' post='2291450']
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.

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:

Marcher Technologies and AndyF like this

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0

  • Who's Browsing   0 members

    No registered users viewing this page.