Index: branches/5.2.x/core/kernel/db/cat_tag_processor.php =================================================================== diff -u -N -r14585 -r14628 --- branches/5.2.x/core/kernel/db/cat_tag_processor.php (.../cat_tag_processor.php) (revision 14585) +++ branches/5.2.x/core/kernel/db/cat_tag_processor.php (.../cat_tag_processor.php) (revision 14628) @@ -1,6 +1,6 @@ Prefix.'-rev'; - $review_tag_processor =& $this->Application->recallObject($prefix.'.item_TagProcessor'); + $prefix = $this->Prefix . '-rev'; + + $review_tag_processor =& $this->Application->recallObject($prefix . '.item_TagProcessor'); + /* @var $review_tag_processor kDBTagProcessor */ + return $review_tag_processor->PrintList($params); } function ReviewCount($params) { $review_tag_processor =& $this->Application->recallObject('rev.item_TagProcessor'); + /* @var $review_tag_processor kDBTagProcessor */ + return $review_tag_processor->TotalRecords($params); } @@ -609,50 +614,53 @@ */ function LastUpdated($params) { - $category_id = (int)$this->Application->GetVar('m_cat_id'); - $local = array_key_exists('local', $params) && ($category_id > 0) ? $params['local'] : false; + $category_id = (int)$this->Application->GetVar('m_cat_id'); + $local = array_key_exists('local', $params) && ($category_id > 0) ? $params['local'] : false; $serial_name1 = $this->Application->incrementCacheSerial('c', $local ? $category_id : null, false); $serial_name2 = $this->Application->incrementCacheSerial($this->Prefix, null, false); $cache_key = 'categoryitems_last_updated[%' . $serial_name1 . '%][%' . $serial_name2 . '%]'; $row_data = $this->Application->getCache($cache_key); - if ($row_data === false) { - if ($local && ($category_id > 0)) { + if ( $row_data === false ) { + if ( $local && ($category_id > 0) ) { // scan only current category & it's children - list ($tree_left, $tree_right) = $this->Application->getTreeIndex($category_id); + list ($tree_left, $tree_right) = $this->Application->getTreeIndex($category_id); - $sql = 'SELECT MAX(item_table.Modified) AS ModDate, MAX(item_table.CreatedOn) AS NewDate + $sql = 'SELECT MAX(item_table.Modified) AS ModDate, MAX(item_table.CreatedOn) AS NewDate FROM ' . $this->Application->getUnitOption($this->Prefix, 'TableName') . ' item_table LEFT JOIN ' . TABLE_PREFIX . 'CategoryItems ci ON (item_table.ResourceId = ci.ItemResourceId) LEFT JOIN ' . TABLE_PREFIX . 'Category c ON c.CategoryId = ci.CategoryId WHERE c.TreeLeft BETWEEN ' . $tree_left . ' AND ' . $tree_right; - } + } else { // scan all categories in system $sql = 'SELECT MAX(Modified) AS ModDate, MAX(CreatedOn) AS NewDate FROM ' . $this->Application->getUnitOption($this->Prefix, 'TableName'); - } + } - $this->Conn->nextQueryCachable = true; + $this->Conn->nextQueryCachable = true; $row_data = $this->Conn->GetRow($sql); $this->Application->setCache($cache_key, $row_data); } - if (!$row_data) { - return ''; - } + if ( !$row_data ) { + return ''; + } - $date = $row_data[ $row_data['NewDate'] > $row_data['ModDate'] ? 'NewDate' : 'ModDate' ]; + $date = $row_data[$row_data['NewDate'] > $row_data['ModDate'] ? 'NewDate' : 'ModDate']; - // format date - $format = isset($params['format']) ? $params['format'] : '_regional_DateTimeFormat'; - if (preg_match("/_regional_(.*)/", $format, $regs)) { + // format date + $format = isset($params['format']) ? $params['format'] : '_regional_DateTimeFormat'; + + if ( preg_match("/_regional_(.*)/", $format, $regs) ) { $lang =& $this->Application->recallObject('lang.current'); - if ($regs[1] == 'DateTimeFormat') { + /* @var $lang LanguagesItem */ + + if ( $regs[1] == 'DateTimeFormat' ) { // combined format - $format = $lang->GetDBField('DateFormat').' '.$lang->GetDBField('TimeFormat'); + $format = $lang->GetDBField('DateFormat') . ' ' . $lang->GetDBField('TimeFormat'); } else { // simple format