Jaxel
Well-known member
I am using the following two codes to hard delete threads and posts:
Very simple right? However, the same can not be done with Profile Posts... I must instead do...
You'll notice that no only do I need to manually write the delete code... but I must ALSO delete the entry for the deletion log, which is missing from the profilepost datawriter.
Code:
if ($thread['delete_age'] > $cutoff)
{
$this->getModelFromCache('XenForo_Model_Thread')->deleteThread($thread['thread_id'], 'hard');
XenForo_Helper_Cookie::clearIdFromCookie($thread['thread_id'], 'inlinemod_threads');
}
Code:
if ($post['delete_age'] > $cutoff)
{
$this->getModelFromCache('XenForo_Model_Post')->deletePost($post['post_id'], 'hard');
XenForo_Helper_Cookie::clearIdFromCookie($post['post_id'], 'inlinemod_posts');
}
Very simple right? However, the same can not be done with Profile Posts... I must instead do...
Code:
if ($profile_post['delete_age'] > $cutoff)
{
$dw = XenForo_DataWriter::create('XenForo_DataWriter_DiscussionMessage_ProfilePost');
$dw->setExistingData($profile_post['profile_post_id']);
$dw->delete();
XenForo_Helper_Cookie::clearIdFromCookie($profile_post['profile_post_id'], 'inlinemod_profilePosts');
$this->getModelFromCache('XenForo_Model_DeletionLog')->removeDeletionLog('profile_post', $profile_post['content_id']);
}
You'll notice that no only do I need to manually write the delete code... but I must ALSO delete the entry for the deletion log, which is missing from the profilepost datawriter.
Upvote
0