HOW to add a custome comments block to page

 

 Following my post earlier  HOW to create custom page? I was needed to add custom comments block to the page

 

I read about this in the article http://www.boonex.com/trac/dolphin/wiki/DolModDev

 

Which refers me to look in inc/classes/BxDolCmts.php (class)

 

I read the file and followed by the instauration inside.

 

1) I added a recorded to the table sys_objects_cmts

 

 

2) I added new tables etv_cmts and etv_cmts_track

 

3) Then I added to the costume page this code

     // comments
     function getBlockCode_BlockTwo() {

  		bx_import ('BxTemplCmtsView');
		//bx_import('BxEtvCmts');
        //$o = new EtvCmts ('etv', (int)$this->aDataEntry['ID']);
		 $o = new BxTemplCmtsView ('etv',(int)$this->aDataEntry['ID']);
        if (!$o->isEnabled())
            return '';
        return $o->getCommentsFirst ();
		 
     }

And after all I got this error.  

 

Always remember that the future comes one day at a time.
Quote · 29 Sep 2015

I have 2 other files

1. fec.php the custome page

2. EtvCmts.php clone of BxEventCmts beside the class name. (class BxEventsCmts -> class EtvCmts)

Always remember that the future comes one day at a time.
Quote · 29 Sep 2015

Please could you attach EtvCmts.php class here ? 

Also do you have `etv_main` table, could you provide this table structure ? 

Rules → http://www.boonex.com/terms
Quote · 1 Oct 2015

I have attached the file. 

i don't have 'etv_main' table...

how is should be like?

EtvCmts.php · 1.7K · 181 downloads
Always remember that the future comes one day at a time.
Quote · 1 Oct 2015

Actually for basic comments functionality you don't need custom comments class, so:

- remove EtvCmts.php file

- make comments objects like this

INSERT INTO `sys_objects_cmts` (`ID`, `ObjectName`, `TableCmts`, `TableTrack`, `AllowTags`, `Nl2br`, `SecToEdit`, `PerView`, `IsRatable`, `ViewingThreshold`, `AnimationEffect`, `AnimationSpeed`, `IsOn`, `IsMood`, `RootStylePrefix`, `TriggerTable`, `TriggerFieldId`, `TriggerFieldComments`, `ClassName`, `ClassFile`) VALUES
(NULL, 'etv', 'etv_cmts', 'etv_cmts_track', 0, 1, 90, 20, 1, -3, 'none', 0, 1, 0, 'cmt', '', '', '', '', '');

- and finally initialize like this

// comments
function getBlockCode_BlockTwo() 
{
    bx_import ('BxTemplCmtsView');
    $o = new BxTemplCmtsView ('etv', 1);
    if (!$o->isEnabled())
        return '';
    return $o->getCommentsFirst ();	 
}

 

Rules → http://www.boonex.com/terms
Quote · 1 Oct 2015

it's WORKING! thank u alex

Always remember that the future comes one day at a time.
Quote · 1 Oct 2015
 
 
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.