Index: branches/RC/core/kernel/application.php =================================================================== diff -u -N -r10494 -r10516 --- branches/RC/core/kernel/application.php (.../application.php) (revision 10494) +++ branches/RC/core/kernel/application.php (.../application.php) (revision 10516) @@ -869,6 +869,7 @@ $this->_updateAverageStatistics($data, 'SqlCount', $query_statistics['count']); $data['Hits']++; + $data['LastHit'] = adodb_mktime(); $this->Conn->doUpdate($data, TABLE_PREFIX . 'StatisticsCapture', 'StatisticsId = ' . $data['StatisticsId']); } @@ -878,6 +879,7 @@ $data['SqlCountMin'] = $data['SqlCountAvg'] = $data['SqlCountMax'] = $query_statistics['count']; $data['TemplateName'] = $this->GetVar('t'); $data['Hits'] = 1; + $data['LastHit'] = adodb_mktime(); $this->Conn->doInsert($data, TABLE_PREFIX . 'StatisticsCapture'); } } @@ -919,6 +921,7 @@ $data['TemplateNames'] = implode(',', array_unique($template_names)); $data['Hits']++; + $data['LastHit'] = adodb_mktime(); $this->Conn->doUpdate($data, TABLE_PREFIX . 'SlowSqlCapture', 'CaptureId = ' . $data['CaptureId']); } @@ -928,6 +931,7 @@ $data['QueryCrc'] = $query_crc; $data['TemplateNames'] = $this->GetVar('t'); $data['Hits'] = 1; + $data['LastHit'] = adodb_mktime(); $this->Conn->doInsert($data, TABLE_PREFIX . 'SlowSqlCapture'); } @@ -2683,6 +2687,28 @@ return $xml_version ? 'GetDBField('Charset').'"?>' : ''; } + + /** + * Returns category tree + * + * @param int $category_id + * @return Array + */ + function getTreeIndex($category_id) + { + $category_template = $this->getFilename('c', $category_id); // to rebuild "category_tree" cache + + $tree_index = $this->getCache('category_tree', $category_id); + + if ($tree_index) { + $ret = Array (); + list ($ret['TreeLeft'], $ret['TreeRight']) = explode(';', $tree_index); + + return $ret; + } + + return false; + } } ?> \ No newline at end of file