示例#1
0
    public function delete()
    {
        // Hooks
        titania::$hook->call_hook_ref(array(__CLASS__, __FUNCTION__), $this);
        $post = new titania_post();
        // Remove posts and topic
        $sql = 'SELECT post_id FROM ' . TITANIA_POSTS_TABLE . '
			WHERE topic_id = ' . (int) $this->queue_topic_id;
        $result = phpbb::$db->sql_query($sql);
        while ($row = phpbb::$db->sql_fetchrow($result)) {
            $post->post_id = $row['post_id'];
            $post->hard_delete();
        }
        phpbb::$db->sql_freeresult($result);
        // Clear the revision queue id from the revisions table
        $sql = 'UPDATE ' . TITANIA_REVISIONS_TABLE . '
			SET revision_queue_id = 0
			WHERE revision_id = ' . $this->revision_id;
        phpbb::$db->sql_query($sql);
        // Assplode
        parent::delete();
    }