Thread: Show Thread Enhancements - Show Full CMS Article in Comments Thread
View Single Post
  #97  
Old 29 Dec 2013, 05:54
Toorak Times's Avatar
Toorak Times Toorak Times is offline
 
Join Date: Jan 2011
Originally Posted by brad_irc View Post
Thanks for your snippet Lynne. I do many vB mods that are never published, but your code snippet helped -- so here is the solution for users wanting [ATTACH] bbcode parsed properly.

Let me explain so users can better understand the code and why it appears as a link.

Deep inside /includes/class_bbcode.php, line 2581 "if (!empty($this->attachments["$attachmentid"]))" checks if the $bbcode_parser object has an array defined with details about the image attachment (ie; size, contenttype, placement, thumbnail, etc). If that data is not present, it defaults to creating a link to the attachment.

I backtracked through the function where CMS article calls the bbcode parser, see file /packages/vbcms/item/content/article.php, line 428 which shows how it fetches the attachment data using the content nodeid.

The snippet below has nodeid added to the query, and the block populating the $attachments array. Enjoy

Also to be noted, Tapatalk users cannot view articles on main page, now they will be able to view the content using the forum


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

PS: If anyone else has noticed that [ATTACH] is not properly parsed in RSS feeds, I will find a solution and post it in the next couple days.
That worked a treat!

I have an issue where if someone makes a comment the CMS article disappears but the this Forum remains intact, not sure if 2 are connected
Reply With Quote