comments per page?

Can someone tell me how to set "x" amount of comments in the comments box?  I've searched the forums and have not seen a question or answer regarding this

Ultra Newb reporting for duty.
Quote · 10 Jul 2013

This is something my members have mentioned as well; actually they would like to set the number of comments that show on their profile pages in their settings.  I looked through the code for some insight on this.

bx_import('BxDolCmts' );
bx_import('BxDolPaginate');

/**
 * @see BxDolCmts
 */
class BxBaseCmtsView extends BxDolCmts
{
    var $_oPaginate;
    var $_sStylePrefix;

    function BxBaseCmtsView( $sSystem, $iId, $iInit = 1 )
    {
        BxDolCmts::BxDolCmts( $sSystem, $iId, $iInit );
        if (empty($sSystem) || !$this->_aSystem)
            return;

        $this->_sJsObjName = 'oCmts' . ucfirst($sSystem) . $iId;
        $this->_oPaginate = new BxDolPaginate(array(
            'page_url' => 'javascript:void(0);',
            'start' => 0,
            'count' => $this->_oQuery->getObjectCommentsCount($this->getId(), 0),
            'per_page' => $this->getPerView(),
            'sorting' => $this->_sOrder,
            'per_page_step' => 2,
            'per_page_interval' => 3,
            'on_change_page' => $this->_sJsObjName . '.changePage({start}, {per_page})',
            'on_change_per_page' => $this->_sJsObjName . '.changePerPage(this)',
            'on_change_sorting' => $this->_sJsObjName . '.changeOrder(this)',
            'info' => false,
        ));
        $this->_sStylePrefix = isset($this->_aSystem['root_style_prefix']) ? $this->_aSystem['root_style_prefix'] : 'cmt';

        $GLOBALS['oSysTemplate']->addJsTranslation('_sys_txt_cmt_loading');
    }

I guess one question is this set for all comments on other pages, such as photos and videos?  Do I need to pull up BxDolCmts?  It would be nice if I could set the number of comments to show on the profile comments independent of the number for photos and videos.

I see this: 'per_page' => $this->getPerView(), Is that the number of comments to show at one time?

Bringing up the BxDolCmts, I see this:

    function & getSystems ()
    {
        if (!isset($GLOBALS['bx_dol_cmts_systems'])) {
            $GLOBALS['bx_dol_cmts_systems'] = $GLOBALS['MySQL']->fromCache('sys_objects_cmts', 'getAllWithKey', '
                SELECT
                    `ID` as `system_id`,
                    `ObjectName` AS `name`,
                    `TableCmts` AS `table_cmts`,
                    `TableTrack` AS `table_track`,
                    `AllowTags` AS `allow_tags`,
                    `Nl2br` AS `nl2br`,
                    `SecToEdit` AS `sec_to_edit`,
                    `PerView` AS `per_view`,
                    `IsRatable` AS `is_ratable`,
                    `ViewingThreshold` AS `viewing_threshold`,
                    `AnimationEffect` AS `animation_effect`,
                    `AnimationSpeed` AS `animation_speed`,
                    `IsOn` AS `is_on`,
                    `IsMood` AS `is_mood`,
                    `RootStylePrefix` AS `root_style_prefix`,
                    `TriggerTable` AS `trigger_table`,
                    `TriggerFieldId` AS `trigger_field_id`,
                    `TriggerFieldComments` AS `trigger_field_comments`,
                    `ClassName` AS `class_name`,
                    `ClassFile` AS `class_file`
                FROM `sys_objects_cmts`', 'name');
        }
        return $GLOBALS['bx_dol_cmts_systems'];
    }

So in the database table sys_objects_cmts there is the PerView field which I guess is what controls how many comments should be displayed.  Is this an accurate guess?  So if we have a place to store these PerView where do we set this in the backend?  Or do I have to edit the database directly?  I would think there would be a place to set these; if not, would be easy peasy to add it.  So, is there a place to change the PerView on comments?  Or is it a database edit?

Geeks, making the world a better place
Quote · 10 Jul 2013

Playing with the database the answer is yes.  However, is there no backend settings for comments?

To answer my question about each member setting how many comments to show on their profile page, I need to just add a field to the profile table, add a setting in the profile edit page, and then when getting the PerView for profile comments check to see if a PerView exists in the member's profile and if so, use it instead of the one in sys_objects_cmts

Geeks, making the world a better place
Quote · 11 Jul 2013

Thank you

Ultra Newb reporting for duty.
Quote · 11 Jul 2013

You are welcomed.  Isn't this code stuff so much fun!

Geeks, making the world a better place
Quote · 11 Jul 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.