![]() |
Show Full CMS Article in Comments Thread
1 Attachment(s)
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:
https://vborg.vbsupport.ru/attachmen...1&d=1290890523 CMS Comment Thread: https://vborg.vbsupport.ru/attachmen...1&d=1290890523 If you ONLY want to show the full article to users, not guests, then change this condition (thanks to mattysheff): PHP Code:
PHP Code:
|
installed
but i have broplem with cms as default |
Quote:
|
After I put in this plug-in, activate it then reload my website I get this Error:
================== Database error in vBulletin 4.0.1: Invalid SQL: SELECT cms_article.pagetext, cms_article.threadid, cms_article.htmlstate FROM distortedforumscms_article AS cms_article INNER JOIN distortedforumscms_node AS cms_node ON (cms_node.contentid = cms_article.contentid) INNER JOIN distortedforumscms_nodeinfo AS cms_nodeinfo ON (cms_nodeinfo.nodeid = cms_node.nodeid) WHERE cms_nodeinfo.associatedthreadid = 570; MySQL Error : Unknown column 'cms_article.htmlstate' in 'field list' Error Number : 1054 Request Date : Wednesday, December 29th 2010 @ 08:37:48 PM Error Date : Wednesday, December 29th 2010 @ 08:37:48 PM Script : http://www.distortedguild.com/showth...ate-12-30-2010 Referrer : http://www.distortedguild.com/forumd...p?5-Guild-Chat IP Address : 76.125.212.129 Username : Guadah Classname : vB_Database MySQL Version : 4.1.24-max-log Here is the code I put into the Plug-in. I just copied and pasted it. ================== if (THIS_SCRIPT == 'showthread' AND $this->thread['forumid'] == $this->registry->options['vbcmsforumid'] AND $this->post['postcount'] == 1) { $result = $this->registry->db->query_first(" SELECT cms_article.pagetext, cms_article.threadid, cms_article.htmlstate 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']. " "); $bbcode_parser = new vBCms_BBCode_HTML(vB::$vbulletin, vBCms_BBCode_HTML::fetchCmsTags()); $pagetext = fetch_censored_text($bbcode_parser->do_parse($result['pagetext'],true,$result['htmlstate'])); $find = 'type="submit"'; $replace = 'type="submit" disabled'; $pagetext = str_replace ($find, $replace, $pagetext); $result['previewtext'] = $pagetext; $this->post['message'] .= '<br />*********<br />'. $result['previewtext']; } |
Quote:
|
oh man, what a bummer.
I'm not sure I can upgrade, I think one or two addons will stop working if I do. I'll backup the website and try to upgrade this weekend when I have time. Thanks for the work done in it regardless! It's an awesome modification. |
I removed ", cms_article.htmlstate" and submitted it. The addon is working now :)
Thank you again for this modification! |
Tagged.... will try later today.... hope it works on 4.1.0 :)
|
It works. :)
One problem I have though, which is not an issue with it as it is, but more with how I personally do things on my forum. Once I publish an article, I then go to the forum and I move the thread from vBCMS Comments to a more relevant section of the forum. When I move it the article content in the thread disappears and i'm left with the standard "you can view the page here". The way around it I have at the moment is I copy the content from the auto created thread, then I move the thread, then edit the thread and paste in the content. It works, but it means a little more work on my behalf. :) |
Quote:
Code:
if (THIS_SCRIPT == 'showthread' AND $this->thread['forumid'] == $this->registry->options['vbcmsforumid'] AND $this->post['postcount'] == 1) |
All times are GMT. The time now is 07:06 AM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|