countItems($key); } public function reindex() { global $pages; $db = $pages->getDB($onlyKeys=false); $authorsIndex = array(); foreach ($db as $pageKey=>$pageFields) { if (in_array($pageFields['type'], $GLOBALS['DB_TAGS_TYPES'])) { $authorName = $pageFields['username']; if (isset($authorsIndex[$authorName])) { array_push($authorsIndex[$authorName]['list'], $pageKey); } else { $authorsIndex[$authorName]['name'] = $authorName; $authorsIndex[$authorName]['list'] = array($pageKey); } } } $this->db = $authorsIndex; $this->sortAlphanumeric(); return $this->save(); } }