delete last post
Xander Offline
Junior Member
**
Posts: 6
Joined: Aug 2013
Post: #1
delete last post
why this function not delete last post ?

PHP Code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
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); 
}

(This post was last modified: 08-20-2013 06:16 PM by Xander.)
08-19-2013 04:22 AM
Find all posts by this user Quote this message in a reply
ZiNgA BuRgA Offline
Fag
*******
Posts: 3,357
Joined: Jan 2008
Post: #2
RE: delete last 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...

My Blog
08-19-2013 10:22 AM
Find all posts by this user Quote this message in a reply
Seabody Offline
Member
***
Posts: 54
Joined: Aug 2012
Post: #3
RE: delete last post
Well for a start, $thread['lastpost'] is a date.
08-19-2013 05:08 PM
Find all posts by this user Quote this message in a reply
Xander Offline
Junior Member
**
Posts: 6
Joined: Aug 2013
Post: #4
RE: delete last post
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
(This post was last modified: 08-20-2013 06:15 PM by Xander.)
08-20-2013 02:12 AM
Find all posts by this user Quote this message in a reply
Xander Offline
Junior Member
**
Posts: 6
Joined: Aug 2013
Post: #5
RE: delete last post
Apologizes for Post ater post but still does not work
Any ideas suggestions?
08-22-2013 02:25 AM
Find all posts by this user Quote this message in a reply

« Next Oldest | Next Newest »

 Standard Tools
Forum Jump: