Index: core/kernel/db/db_tag_processor.php =================================================================== --- core/kernel/db/db_tag_processor.php +++ core/kernel/db/db_tag_processor.php @@ -2035,6 +2035,9 @@ case 'total': return $object->GetRecordsCount(false); + case 'selected': + return $object->GetSelectedCount(); + case 'from': return $object->GetRecordsCount() ? $object->GetOffset() + 1 : 0; //0-based @@ -2225,6 +2228,20 @@ } /** + * Print selected records count. + * + * @param array $params Tag params. + * + * @return string + */ + protected function SelectedRecords(array $params) + { + $list =& $this->GetList($params); + + return $list->GetSelectedCount(); + } + + /** * Range filter field name * * @param Array $params Index: core/kernel/db/dblist.php =================================================================== --- core/kernel/db/dblist.php +++ core/kernel/db/dblist.php @@ -450,7 +450,7 @@ */ public function GetRecordsCount($with_filters = true) { - if (!$this->Counted) { + if ( !$this->Counted ) { $this->CountRecs(); } @@ -465,6 +465,10 @@ */ public function GetSelectedCount() { + if ( !$this->Queried ) { + $this->Query(); + } + return $this->SelectedCount; }