The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
Show Full CMS Article in Comments Thread Details »» | |||||||||||||||||||||||||||||||
This is more of an example than a modification. I wrote this quick plugin for someone and thought I would share it. It's something someone can take and build on. All it does is if you look at the CMS Article thread in your CMS Comments forum, the content of the CMS Article is shown under the blurb "You can view the page at.....". This is ONLY for Articles - not Static Pages or PHP Direct Evaluation content types. Someone can build on this and do those if they want. The person I wrote this for had forms in their articles and needed the submit button to be disabled, so this plugin does that also.
Like I said - this is more of an example. I don't plan to do anything more with it and I'm not helping with modifying it for your own use. Use it however you want. This adds one query to the threads in the CMS Comments forum. To install.... Create a Plugin Hook Location - postbit_display_complete Title - Show Full CMS Article Plugin PHP Code - PHP Code:
CMS Comment Thread: If you ONLY want to show the full article to users, not guests, then change this condition (thanks to mattysheff): PHP Code:
PHP Code:
Download Now
Screenshots
Show Your Support
|
3 благодарности(ей) от: | ||
Paul M, tbworld, Toorak Times |
Comments |
#42
|
|||
|
|||
THIS IS THE BEST MOD EVER... thank you very much
This is how it should be integrated in CMS/VBulletin... seriously! Thank you again! |
#43
|
|||
|
|||
Thanks for this Lynne;
I have done some tweaks (as usual!) and come up with this, which sort of sets the article into a post within its own box, so to speak. http://www.bowlandcentral.com/forum/...ad.php?t=98178 |
#44
|
||||
|
||||
Very nice, Mark. I always enjoy seeing your tweeks. I am like you with modifications - I never use one straight out of the box.
|
#45
|
|||
|
|||
Very nice it is too. Would you be willing to share?
|
#46
|
|||
|
|||
Yep, I always use them as a basis to build upon. Some need very little but I almost always change bits and bobs, it's good practice too..."oh, this bit of code does THAT!....."
|
#47
|
|||
|
|||
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>'; } } Code:
.article_post { border: {vb:stylevar mid_border}; border-top: 0; background: {vb:stylevar postbit_userinfo_background}; padding: 6px; } |
#48
|
|||
|
|||
Cheers my friend. I shall have a play this weekend.
|
#49
|
|||
|
|||
Great edit Mark!
|
#50
|
|||
|
|||
Is it possible when someone clicks the url of the article or Read More it takes them straight to the forum post?
|
#51
|
|||
|
|||
Got it sorted
|
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|