Profile Comments Editor - Different TinyMCE

I want to gain control of the profile comment editor separately from the other comment editors on the site so I can load a different editor for that block.  So far I am not having any luck on this and would like some insight on how the profile comment editor block is loaded.

Geeks, making the world a better place
Quote · 7 May 2013

TinyMCE editor for comments is initoalized in templates/base/scripts/BxBaseCmtsView.php file getCmtsInit function, the following lines:

bx_import('BxDolEditor');
$oEditor = BxDolEditor::getObjectInstance();
$ret .= $oEditor ? $oEditor->attachEditor ('textarea[name=CmtText]', BX_EDITOR_MINI) : '';

BX_EDITOR_MINI - is for mini editor, other options are BX_EDITOR_STANDARD and BX_EDITOR_FULL

 

 

Rules → http://www.boonex.com/terms
Quote · 7 May 2013

Yes Alex, I know about the comment editor being mini; it is mini for all comment editors.  What I want to do is to change the comment editor for profile comments ONLY.  I see the profile comments block in the page builders and it is Special Block and there doesn't seem to be any way to control just that comment block.  In the database the function for profile comments is Cmts.  Looking through the code seems to be having the profile comments running all over the place.  There seems to be code for profile comments yet no clear way to say, OK, here is where we are loading the profile comments editor and initialising the TinyMCE, using mini, so change this bit here to use mini_plus editor for the profile comments.  This is where you can run into problems trying to reuse code in too many areas.  Dolphin is funny that way, sometimes it seems code is too much intertwined and at other times it is not intertwined enough.

Geeks, making the world a better place
Quote · 7 May 2013

 

TinyMCE editor for comments is initoalized in templates/base/scripts/BxBaseCmtsView.php file getCmtsInit function, the following lines:

bx_import('BxDolEditor');
$oEditor = BxDolEditor::getObjectInstance();
$ret .= $oEditor ? $oEditor->attachEditor ('textarea[name=CmtText]', BX_EDITOR_MINI) : '';

BX_EDITOR_MINI - is for mini editor, other options are BX_EDITOR_STANDARD and BX_EDITOR_FULL

 

 

Is there a way to know which comment editor is being loaded so that I can change the above just for the profile comment editor?

Geeks, making the world a better place
Quote · 7 May 2013

bx_import('BxDolEditor');
$oEditor = BxDolEditor::getObjectInstance();
$ret .= $oEditor ? $oEditor->attachEditor ('textarea[name=CmtText]', 'profile' == $this->_sSystem ? BX_EDITOR_FULL  : BX_EDITOR_MINI) : '';

 

Is there a way to know which comment editor is being loaded so that I can change the above just for the profile comment editor?

 

Rules → http://www.boonex.com/terms
Quote · 8 May 2013

Thanks Alex.  Let me explain the bigger picture here.  I have the editor for comments turned on.  Now on the profile comments (which my members refer to as their profile guestbook) members can leave images in the profile comments.  Some members don't like getting images in their guestbooks; especially when someone leaves a dozen or more (yes, a dozen).  So this modification will include a switch that members can set in their profile edit to allow or disallow the reduced guestbook editor.  I will create a new editor that will not allow the image tag to be inserted.  Before the TinyMCE editor is initialised for the profile comments, it will check the database to see if the member wants the regular guestbook editor or the reduced guestbook editor for her/his profile guestbook; thus eliminating unwanted images posted to their guestbook.

Geeks, making the world a better place
Quote · 9 May 2013

You can do different things by checking if this is profile comments, comments related classes:

'profile' == $this->_sSystem

Rules → http://www.boonex.com/terms
Quote · 10 May 2013
 
 
Below is the legacy version of the Boonex site, maintained for Dolphin.Pro 7.x support.
The new Dolphin solution is powered by UNA Community Management System.