comments order

All the topics other than the two goes here.
  • Ads

comments order

Postby xmccay » Fri Nov 06, 2009 4:15 pm

Hi,

May I know how can I change the way comments are displayed in the blog, profile and photo gallery? I want to display the latest comment on top instead of the oldest one as what we have by default.

Please advise. THanks/
xmccay
Jr. Member
Jr. Member
 
Posts: 195
Joined: Sat Nov 01, 2008 3:42 pm

Re: comments order

Postby Administrator » Tue Nov 10, 2009 5:28 pm

Open the file inc/classes/BxDolCmtsQuery.php

FInd:

Code: Select all
      $a = $this->getAll("SELECT
            $sFields
            `c`.`cmt_id`,
            `c`.`cmt_parent_id`,
            `c`.`cmt_object_id`,
            `c`.`cmt_author_id`,
            `c`.`cmt_text`,
            `c`.`cmt_rate`,
            `c`.`cmt_rate_count`,
            `c`.`cmt_replies`,
            (UNIX_TIMESTAMP() - UNIX_TIMESTAMP(`c`.`cmt_time`)) AS `cmt_secs_ago`,
            `p`.`NickName` AS `cmt_author_name`,
            `m`.`med_file` AS `cmt_author_icon`
         FROM {$this->_sTable} AS `c`
         LEFT JOIN `Profiles` AS `p` ON (`p`.`ID` = `c`.`cmt_author_id`)
         LEFT JOIN `media` AS `m` ON (`m`.`med_id` = `p`.`PrimPhoto` AND `m`.`med_status` = 'active')
         $sJoin
         WHERE `c`.`cmt_object_id` = '$iId' AND `c`.`cmt_parent_id` = '$iCmtParentId'
         ORDER BY `c`.`cmt_time` ASC");


Replace it with:

Code: Select all
      $a = $this->getAll("SELECT
            $sFields
            `c`.`cmt_id`,
            `c`.`cmt_parent_id`,
            `c`.`cmt_object_id`,
            `c`.`cmt_author_id`,
            `c`.`cmt_text`,
            `c`.`cmt_rate`,
            `c`.`cmt_rate_count`,
            `c`.`cmt_replies`,
            (UNIX_TIMESTAMP() - UNIX_TIMESTAMP(`c`.`cmt_time`)) AS `cmt_secs_ago`,
            `p`.`NickName` AS `cmt_author_name`,
            `m`.`med_file` AS `cmt_author_icon`
         FROM {$this->_sTable} AS `c`
         LEFT JOIN `Profiles` AS `p` ON (`p`.`ID` = `c`.`cmt_author_id`)
         LEFT JOIN `media` AS `m` ON (`m`.`med_id` = `p`.`PrimPhoto` AND `m`.`med_status` = 'active')
         $sJoin
         WHERE `c`.`cmt_object_id` = '$iId' AND `c`.`cmt_parent_id` = '$iCmtParentId'
         ORDER BY `c`.`cmt_time` DESC");
Regards,
Praveen
Administrator
Administrator
Administrator
 
Posts: 1069
Joined: Mon Aug 25, 2008 7:18 am
Location: India

Re: comments order

Postby xmccay » Wed Nov 11, 2009 4:12 pm

Thank you
xmccay
Jr. Member
Jr. Member
 
Posts: 195
Joined: Sat Nov 01, 2008 3:42 pm

  • Ads

Return to Dolphin General Help

Who is online

Users browsing this forum: No registered users and 1 guest

cron