예제 #1
0
 /**
  * Get a random page	
  *
  * @param	int		$a_wiki_id		Wiki ID
  */
 static function getRandomPage($a_wiki_id)
 {
     global $ilDB;
     $cnt = ilWikiPage::countPages($a_wiki_id);
     if ($cnt < 1) {
         return "";
     }
     $rand = rand(1, $cnt);
     // delete record of table il_wiki_data
     $ilDB->setLimit(1, $rand);
     $query = "SELECT title FROM il_wiki_page" . " WHERE wiki_id = " . $ilDB->quote($a_wiki_id, "integer");
     $s = $ilDB->query($query);
     $r = $ilDB->fetchAssoc($s);
     return $r["title"];
 }