LPH
Well-known member
I'd like to modify the following code so $body message posted to the new thread looks like what happens when a new resource is added or updated.
So, it would be a message stating a new blog entry has been created, then a trimmed quote, followed by a message to continue reading.
This issue I'm having is getting the user name to display in the $body 'submitted ...' section
Thank you for your help.
So, it would be a message stating a new blog entry has been created, then a trimmed quote, followed by a message to continue reading.
This issue I'm having is getting the user name to display in the $body 'submitted ...' section
PHP:
$body = '';
if($post_contains == 'full')
{
$body = 'submitted a new blog post'; // This is NOT correct
$body .= '[quote]' . XenForo_Helper_String::autoLinkBbCode(XenForo_Html_Renderer_BbCode::renderFromHtml(nl2br($content))) . "[/quote]";
/* Add preg_replace */
$body = preg_replace('#\[nlposts .*\]#', '', $body);
/* Add Trim to 500 Words */
$body = XenForo_Helper_String::wholeWordTrim($body, 500);
}
$body .= "[URL='" . get_permalink($post->ID) . "']Continue reading the Original Blog Post[/URL]";
$postWriter = $writer->getFirstMessageDw();
$postWriter->set('message', $body);
$postWriter->setExtraData(XenForo_DataWriter_DiscussionMessage::DATA_ATTACHMENT_HASH, '');
$writer->preSave();
Thank you for your help.