MyBB Community Forums

Full Version: Plugin: datahandler_post_update & Quick Update
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hey guys, I've browsed some other questions but I couldn't find what I needed.

I'm making a mod. Here's my mod:


//...
//inserting a new reply : works great!
$plugins->add_hook("datahandler_post_insert_post", "exp_insertpost", 10, "myphpfile.php");
//inserting a new thread : works great!
$plugins->add_hook("datahandler_post_insert_thread_post", "exp_insertthread", 10, "myphpfile.php");
//changing a post: PROBLEMS
$plugins->add_hook("datahandler_post_update", "exp_updatepost", 10, "myphpfile.php");
// ...
myphpfile.php
<?php

require_once "./global.php";
require_once "./xexescommon.php";

//datahandler_post_insert_post
function exp_insertpost($data){
	//...
	return $data;
}

//datahandler_post_insert_post
function exp_insertthread($data){
	//...
	return $data;
}

// PROBLEM: any hook for datahandler_post_update seems to cause Quick Update to have fits
 //$plugins->run_hooks("datahandler_post_update", $this);
function exp_updatepost($data){
	return $data;
}
  

?>

But, when I run this, I get some issues.
When I go to edit a post on the normal post-editing screen, it works just fine.
But when I go to edit a post on the Quick Reply screen and press Save Changes, it shows the waiting timer-circle and then the waiting-timer-circle goes away and leaves me with the same Quick Reply screen.
I also tried changing the priority to 1 with no luck. I also tried adding a xmlhttp hook but it seems like even having that hook present makes it so that the quick reply won't even open at all, regardless of any other hooks.

I'm really baffled as to what's going on here, any ideas? Am I supposed to send some sort of signal to Quick Reply to tell it it's okay?

MyBB Version: 1.6.9
Installed Mods:
Account Switcher 1.0
Forum Affiliates Manager 1.1
Askimet 1.2.2
EXP Increase (this is what I'm asking help on)
Help Center 1.5
My Achievements 1.8.3
NewPoints (1.9.6)
Show the users that has been online today (2.0)
Page Manager (1.5.2)
Post Counter (1.1)
Registration Security Question (1.2)
Side bar for mybb (1.0)

(I know that I have NewPoints installed but this mod does something very different from NewPoints , the two systems run concurrently. )
Are you sure it is datahandler_post_update in your plugin causing the issues? AFAIK datahandler_post_update is not run on replies.
Update: Figured it out.

The
$plugins->add_hook("datahandler_post_update", "exp_updatepost" );
$plugins->add_hook('xmlhttp', 'testxmlhttp');
hooks REFUSE to be on a different page, they have to be on your plugin php page.

Didn't work like I expected it to, but it's better than nothing.