/** * Get all postings of blog * * @param int $a_blog_id * @param int $a_limit * @param int $a_offset * @return array */ static function getAllPostings($a_blog_id, $a_limit = 1000, $a_offset = 0) { global $ilDB; $pages = parent::getAllPages("blp", $a_blog_id); if ($a_limit) { $ilDB->setLimit($a_limit, $a_offset); } $query = "SELECT * FROM il_blog_posting" . " WHERE blog_id = " . $ilDB->quote($a_blog_id, "integer") . " ORDER BY created DESC"; $set = $ilDB->query($query); $post = array(); while ($rec = $ilDB->fetchAssoc($set)) { if (isset($pages[$rec["id"]])) { $post[$rec["id"]] = $pages[$rec["id"]]; $post[$rec["id"]]["title"] = $rec["title"]; $post[$rec["id"]]["created"] = new ilDateTime($rec["created"], IL_CAL_DATETIME); $post[$rec["id"]]["author"] = $rec["author"]; $post[$rec["id"]]["approved"] = (bool) $rec["approved"]; } } return $post; }
/** * Get all pages of wiki * * @access public */ static function getAllPages($a_wiki_id) { global $ilDB; $pages = parent::getAllPages("wpg", $a_wiki_id); $query = "SELECT * FROM il_wiki_page" . " WHERE wiki_id = " . $ilDB->quote($a_wiki_id, "integer") . " ORDER BY title"; $set = $ilDB->query($query); $pg = array(); while ($rec = $ilDB->fetchAssoc($set)) { if (isset($pages[$rec["id"]])) { $pg[$rec["id"]] = $pages[$rec["id"]]; $pg[$rec["id"]]["title"] = $rec["title"]; } } return $pg; }