Profile Comments, Newest First

Hi,

I'm wondering is there anyway to show profile comments by newest first? I tried searching here and Google but no luck.

Thanks in advance

-Mark

Quote · 28 Sep 2008

BxDolCmtsQuery.php

function getComments ($iId, $iCmtParentId = 0, $iAuthorId = 0)

ORDER BY `c`.`cmt_time` ASC

just change to DESC

Quote · 29 Sep 2008

Is there any chance that you can post a step-by-step approach in getting this done?

I'm brand new to the Dolphin software and have very limited experience in adjusting/changing code in a PHP file.

Any additional help would be appreciated.

Quote · 29 Sep 2008

Ohh, .. I`m usually just provide way-help. so just show you exactly place of realization. I`m not perform creating any instructions :)

But I try

via your FTP client connect to your dolphin,

download inc/classes/BxDolCmtsQuery.php file to local computer,

lets edit it:

lets find next row:

' function getComments ($iId, $iCmtParentId = 0, $iAuthorId = 0) '

a little after this line we can see:


ORDER BY `c`.`cmt_time` ASC

change that 'ASC' to 'DESC'

save file and upload it back to destination place (where it was before)

something like thi

Quote · 30 Sep 2008

Andrey, doing this on a 6.1.4 site and the code is as follows:

 

 function getComments ($iId, $iCmtParentId = 0, $iAuthorId = 0)
    {
  $sFields = "'' AS `cmt_rated`,";
  $sJoin = '';
  if ($iAuthorId)
  {
   $sFields = '`r`.`cmt_rate` AS `cmt_rated`,';
   $sJoin = "LEFT JOIN {$this->_sTableTrack} AS `r` ON (`r`.`cmt_system_id` = ".$this->_aSystem['system_id']." AND `r`.`cmt_id` = `c`.`cmt_id` AND `r`.`cmt_rate_author_id` = $iAuthorId)";
  }  
       
  $a = $this->getAll("SELECT cmt_type,
    $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");
  
  for(reset($a) ; list ($k) = each ($a) ; )
    $a[$k]['cmt_ago'] = _format_when ($a[$k]['cmt_secs_ago']);
    
  return $a;
 }

 

However, comments are still appearing in the order of latest last.  I've done this to 6.1.6 sites with no problem, but 6.1.4 is being a pain in the arse on this one.

Quote · 2 Aug 2009
 
 
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.