Mark.B |
02-08-2012 01:22 AM |
Quote:
Originally Posted by starman™
(Post 2297151)
Very nice it is too. Would you be willing to share?
|
Have a play with this....
Change the plugin code to the below (the attachments part is commented out here, uncomment if you want attachments to embed)
Code:
if (THIS_SCRIPT == 'showthread' AND $this->post['postcount'] == 1 AND $this->thread['forumid'] == $this->registry->options['vbcmsforumid']) {
$result = $this->registry->db->query_first("
SELECT cms_article.pagetext, cms_article.threadid, cms_article.htmlstate, cms_node.nodeid
FROM " . TABLE_PREFIX . "cms_article AS cms_article
INNER JOIN " . TABLE_PREFIX . "cms_node AS cms_node ON (cms_node.contentid = cms_article.contentid)
INNER JOIN " . TABLE_PREFIX . "cms_nodeinfo AS cms_nodeinfo ON (cms_nodeinfo.nodeid = cms_node.nodeid)
WHERE cms_nodeinfo.associatedthreadid = ". $this->thread['threadid']. "
");
if($result) {
$bbcode_parser = new vBCms_BBCode_HTML(vB::$vbulletin, vBCms_BBCode_HTML::fetchCmsTags());;
//$attach = new vB_Attach_Display_Content(vB::$vbulletin, 'vBCms_Article');
//$attachments = $attach->fetch_postattach(0, $result['nodeid']);
//$bbcode_parser->attachments = $attachments;
//$bbcode_parser->unsetattach = true;
$result['previewtext'] = $pagetext;
$this->post['message'] .= '<br /><br /><div class="blockhead"><a href="content.php?r='. $result ['nodeid'] . '"><b>' . $this->thread['title'] .'</b></a></div><div class="article_post">'. $result['previewtext'];
$this->post['message'] .= fetch_censored_text($bbcode_parser->do_parse($result['pagetext'], true, $result['htmlstate']));
$this->post['message'] .= '</div>';
}
}
Then add this to additional.css:
Code:
.article_post
{
border: {vb:stylevar mid_border};
border-top: 0;
background: {vb:stylevar postbit_userinfo_background};
padding: 6px;
}
The only issue I have at present is that the CMS Article URL doesn't have the SEO part after it. Also my URL formatting will probably only work with "standard" URLs and not the "Friendly" URL system, as I have never worked with that. Shouldn't take much tweaking though, I just don't know how any of that works.
|