MyBB Hacks

Full Version: delete last post
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
why this function not delete last post ?

PHP Code:
function plugin_deletelastpost($tids)
{
	global $moderation;

	$query = $db->query("
			SELECT pid
			FROM ".TABLE_PREFIX."posts
			WHERE tid=".$thread['tid']."
			ORDER BY dataline
			DESC LIMIT 1";
			
		");
	$post = $db->fetch_array($query);

	$tid = (int)$mybb->input['tid'];
	$thread = get_thread($tid);
	$fid = $thread['fid'];

			if (empty($moderation))
			{
				require_once MYBB_ROOT."inc/class_moderation.php";
				$moderation = new Moderation;
			}
				$moderation->delete_post($post); 
}

A million possible reasons - you need to give more info.

As for the code dump, you're lacking error checking.  There's also some code in there which doesn't seem to have any purpose...
Well for a start, $thread['lastpost'] is a date.
I wont to delete plastpost when I open thread

Plis help what I mast do I use this hook

class_moderation_open_threads

look first post
Apologizes for Post ater post but still does not work
Any ideas suggestions?
Reference URL's