Register Members List Search Today's Posts Mark Forums Read

Reply
 
Mod Options
Show Full CMS Article in Comments Thread Details »
Show Full CMS Article in Comments Thread
Mod Version: 1.00, by Lynne (Coder/Designer) Lynne is offline
Developer Last Online: Aug 2019 I like it Show Printable Version Email this Page

vB Version: 4.0.8 Rating: (9 votes - 4.89 average) Installs: 58
Released: 27 Nov 2010 Last Update: Never Downloads: 129
Not Supported Uses Plugins Re-usable Code  

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 -


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

CMS Page:

CMS Comment Thread:


If you ONLY want to show the full article to users, not guests, then change this condition (thanks to mattysheff):

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

to this:

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Download Now

Only licensed members can download files, Click Here for more information.

Screenshots

Click image for larger version

Name:	article - cms.png
Views:	3109
Size:	39.2 KB
ID:	123944   Click image for larger version

Name:	article - thread.png
Views:	3184
Size:	63.3 KB
ID:	123945  

Show Your Support

  • To receive notifications regarding updates -> Click to Mark as Installed.
  • If you like this modification support the author by donating.
  • This modification may not be copied, reproduced or published elsewhere without author's permission.
Similar Mod
Mod Developer Type Replies Last Post
Miscellaneous Hacks [CMS] Use original thread for comments Carnage vBulletin 4.x Add-ons 387 26 Nov 2012 01:22

Comments
  #2  
Old 13 Dec 2010, 23:09
Dr.osamA's Avatar
Dr.osamA Dr.osamA is offline
 
Join Date: Aug 2004
Location: Syrie
Real name: Dr.osama
installed

but i have broplem with cms as default
__________________
Reply With Quote
  #3  
Old 13 Dec 2010, 23:30
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Real name: Lynne
Originally Posted by Dr.osamA View Post
installed

but i have broplem with cms as default
Sorry, but I don't understand what you mean.
__________________
Former vBulletin.org Staff Member

Try a search before posting for help. Many users won't, and don't, help if the question has been answered several times before.
W3Schools -
Online vBulletin Manual
If I post some CSS and don't say where it goes, put it in the additional.css template.
I will NOT help via PM (you will be directed to post in the forums for help.)
Reply With Quote
  #4  
Old 30 Dec 2010, 02:39
jimfries's Avatar
jimfries jimfries is offline
 
Join Date: Dec 2009
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'];
}
Reply With Quote
  #5  
Old 30 Dec 2010, 04:13
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Real name: Lynne
Originally Posted by jimfries View Post
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:

.....

MySQL Error : Unknown column 'cms_article.htmlstate' in 'field list'
I just wrote this recently, so I've only been able to test it on 4.0.8 and up. There may not have been a field called htmlstate in the cms_article table back in 4.0.1. If so, then I'm not sure if this will work for you without modifying the query and the do_parse call.
__________________
Former vBulletin.org Staff Member

Try a search before posting for help. Many users won't, and don't, help if the question has been answered several times before.
W3Schools -
Online vBulletin Manual
If I post some CSS and don't say where it goes, put it in the additional.css template.
I will NOT help via PM (you will be directed to post in the forums for help.)
Reply With Quote
  #6  
Old 30 Dec 2010, 04:35
jimfries's Avatar
jimfries jimfries is offline
 
Join Date: Dec 2009
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.
Reply With Quote
  #7  
Old 30 Dec 2010, 05:55
jimfries's Avatar
jimfries jimfries is offline
 
Join Date: Dec 2009
I removed ", cms_article.htmlstate" and submitted it. The addon is working now

Thank you again for this modification!
Reply With Quote
  #8  
Old 30 Dec 2010, 12:05
GamerPerfection's Avatar
GamerPerfection GamerPerfection is offline
 
Join Date: Feb 2006
Tagged.... will try later today.... hope it works on 4.1.0
__________________
Gamer Perfection
Reply With Quote
  #9  
Old 30 Dec 2010, 17:28
GamerPerfection's Avatar
GamerPerfection GamerPerfection is offline
 
Join Date: Feb 2006
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.
__________________
Gamer Perfection
Reply With Quote
  #10  
Old 30 Dec 2010, 17:58
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Real name: Lynne
Originally Posted by GamerPerfection View Post
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.
That is because of the condition I have at the top:

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

I have it set to only check for this in the specified vbcms comments forum. You could remove that part of the condition and see if it works. (Do you always move the threads to a specific other forum? If so, enter that forumid instead.)
__________________
Former vBulletin.org Staff Member

Try a search before posting for help. Many users won't, and don't, help if the question has been answered several times before.
W3Schools -
Online vBulletin Manual
If I post some CSS and don't say where it goes, put it in the additional.css template.
I will NOT help via PM (you will be directed to post in the forums for help.)
Reply With Quote
  #11  
Old 30 Dec 2010, 21:39
GamerPerfection's Avatar
GamerPerfection GamerPerfection is offline
 
Join Date: Feb 2006
Awesome, removing the bit in red works! When I move it to anywhere in the forum it still keeps the content.

And no I don't move them to the same specific area, it can vary.

But thanks for helping me fix it.
__________________
Gamer Perfection
Reply With Quote
  #12  
Old 15 Jan 2011, 16:32
mattysheff mattysheff is offline
 
Join Date: Mar 2008
Thanks for releasing this Lynne, its just what I've been looking for.

One question though, is it possible and if so how would I to it to only get it to show the text to signed in members. I've been trying to figure out how to do it myself but getting nowhere, as while its a user friendly feature, I don't want search engines to be able to see it as I don't want duplicated content listed in the search engines.
Reply With Quote
  #13  
Old 15 Jan 2011, 17:01
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Real name: Lynne
Just add a condition to the plugin to only do it if the user is logged in - you can probably use the $show['member'] variable for that.
__________________
Former vBulletin.org Staff Member

Try a search before posting for help. Many users won't, and don't, help if the question has been answered several times before.
W3Schools -
Online vBulletin Manual
If I post some CSS and don't say where it goes, put it in the additional.css template.
I will NOT help via PM (you will be directed to post in the forums for help.)
Reply With Quote
  #14  
Old 22 Jan 2011, 18:03
mattysheff mattysheff is offline
 
Join Date: Mar 2008
Thanks that works perfect.
Reply With Quote
  #15  
Old 22 Jan 2011, 23:37
tokenyank tokenyank is offline
 
Join Date: Jul 2005
This looks like a great mod - however, wouldn't this count against your SEO by having duplicate content?

Tagged for further investigation when it isn't 00:40!
__________________
MumsOnline - Where Parents Talk
Don't let the name fool you, we aren't just about mums... Dads can come too! A parenting board, for parents by parents.
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Mod Options

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


New To Site? Need Help?

All times are GMT. The time now is 01:41.

Layout Options | Width: Wide Color: