Jun 10, 2007, 04:45 AM
Add this function to your plugins/myps.php
I know it looks weird...make sure it's on a test site only. Also turn on friendly redirect because on the redirect page you will get the echos.
Now change the hook on the top of the file from...
$plugins->add_hook('delete_post', 'myps_delete_reply');
to
$plugins->add_hook('delete_post', 'myps_delete_reply2');
The problem is that I have the $pid...but I can't get ANY db query to get me a result from it. I have tried DOZENS of things...nothing seems to work. The problem is actually only in one place...when you use the "inline moderation" tool to delete posts. It's fine to delete with the "Moderation Options:" with the regular function... but the "Inline Post Moderation:" where it uses some Javascript (though that shouldn't effect this) is the problem.
It's weird because I get $pid and $tid just fine...but queries for some reason won't go...I have tried arrays too. EVERYTHING...
Your help is much appreciated on this one. It's pretty much the last bug I want to fix before releasing 1.10.
PHP Code:
function myps_delete_reply2()
{
global $db, $mybb, $pid, $post,$theme, $templates, $lang;
if ($mybb->settings['myps_status'] != "off")
{
$myps_allow = myps_allow();
if($myps_allow == "yes")
{
$query2 = $db->query("SELECT uid FROM `".TABLE_PREFIX."posts` WHERE pid='".$pid."'");
$puid = $db->fetch_field($query2, "uid");
echo $pid . "-pid test<br />";
echo $puid . "-puid test<br />";
}
}
}
I know it looks weird...make sure it's on a test site only. Also turn on friendly redirect because on the redirect page you will get the echos.
Now change the hook on the top of the file from...
$plugins->add_hook('delete_post', 'myps_delete_reply');
to
$plugins->add_hook('delete_post', 'myps_delete_reply2');
The problem is that I have the $pid...but I can't get ANY db query to get me a result from it. I have tried DOZENS of things...nothing seems to work. The problem is actually only in one place...when you use the "inline moderation" tool to delete posts. It's fine to delete with the "Moderation Options:" with the regular function... but the "Inline Post Moderation:" where it uses some Javascript (though that shouldn't effect this) is the problem.
It's weird because I get $pid and $tid just fine...but queries for some reason won't go...I have tried arrays too. EVERYTHING...
Your help is much appreciated on this one. It's pretty much the last bug I want to fix before releasing 1.10.