24 include_once(
"./Services/COPage/classes/class.ilPageObject.php");
93 $query =
"INSERT INTO il_wiki_page (".
100 $ilDB->query($query);
102 $id = $ilDB->getLastInsertId();
117 function update($a_validate =
true, $a_no_history =
false)
122 $query =
"UPDATE il_wiki_page SET ".
123 " title = ".$ilDB->quote($this->
getTitle()).
124 ",wiki_id = ".$ilDB->quote($this->
getWikiId()).
125 " WHERE id = ".$ilDB->quote($this->
getId());
126 $ilDB->query($query);
139 $query =
"SELECT * FROM il_wiki_page WHERE id = ".
140 $ilDB->quote($this->
getId());
141 $set = $ilDB->query($query);
166 include_once(
"./Services/COPage/classes/class.ilInternalLink.php");
173 $query =
"DELETE FROM il_wiki_page".
174 " WHERE id = ".$ilDB->quote($this->
getId());
176 $ilDB->query($query);
182 foreach($linking_pages as $lp)
184 $st = $ilDB->prepareManip(
"REPLACE INTO il_wiki_missing_page ".
185 "(wiki_id, source_id, target_name) VALUES ".
186 "(?,?,?)", array(
"integer",
"integer",
"text"));
187 $ilDB->execute($st, array($this->
getWikiId(), $lp[
"id"],
204 $query =
"SELECT * FROM il_wiki_page".
205 " WHERE wiki_id = ".$ilDB->quote($a_wiki_id);
206 $set = $ilDB->query($query);
211 $wiki_page->delete();
218 static function exists($a_wiki_id, $a_title)
224 $query =
"SELECT * FROM il_wiki_page".
225 " WHERE wiki_id = ".$ilDB->quote($a_wiki_id).
226 " AND title = ".$ilDB->quote($a_title);
227 $set = $ilDB->query($query);
245 $query =
"SELECT * FROM il_wiki_page".
246 " WHERE wiki_id = ".$ilDB->quote($a_wiki_id).
247 " AND title = ".$ilDB->quote($a_title);
248 $set = $ilDB->query($query);
264 $query =
"SELECT * FROM il_wiki_page".
265 " WHERE id = ".$ilDB->quote($a_page_id);
266 $set = $ilDB->query($query);
269 return $rec[
"title"];
286 $query =
"SELECT * FROM il_wiki_page".
287 " WHERE wiki_id = ".$ilDB->quote($a_wiki_id).
289 $set = $ilDB->query($query);
293 if (isset($pages[$rec[
"id"]]))
295 $pages[$rec[
"id"]][
"title"] = $rec[
"title"];
309 include_once(
"./Services/COPage/classes/class.ilInternalLink.php");
313 foreach ($sources as $source)
315 if ($source[
"type"] ==
"wpg:pg")
317 $ids[] = $source[
"id"];
321 $query =
"SELECT * FROM il_wiki_page wp, page_object p".
323 " AND wp.id = p.page_id AND p.parent_type = 'wpg'".
324 " AND wp.wiki_id = ".$ilDB->quote($a_wiki_id).
326 $set = $ilDB->query($query);
331 $pages[] = array_merge($rec, array(
"user" => $rec[
"last_change_user"],
332 "date" => $rec[
"last_change"]));
349 include_once(
"./Services/COPage/classes/class.ilInternalLink.php");
352 foreach ($pages as $k => $page)
357 foreach ($sources as $source)
359 if ($source[
"type"] ==
"wpg:pg")
361 $ids[] = $source[
"id"];
365 $query =
"SELECT count(*) AS cnt FROM il_wiki_page".
367 " AND wiki_id = ".$ilDB->quote($a_wiki_id).
369 $set = $ilDB->query($query);
371 if ($rec[
"cnt"] == 0 &&
393 $query =
"SELECT * FROM il_wiki_page".
394 " WHERE wiki_id = ".$ilDB->quote($a_wiki_id).
395 " AND title = ".$ilDB->quote($a_title);
396 $set = $ilDB->query($query);
418 return $contributors;
432 return $contributors;
455 $stmt = $ilDB->prepare(
"SELECT * FROM il_wiki_missing_page WHERE ".
456 " wiki_id = ? AND target_name = ?", array(
"integer",
"text"));
458 while ($anmiss = $ilDB->fetchAssoc($set))
465 $stmt = $ilDB->prepareManip(
"DELETE FROM il_wiki_missing_page WHERE ".
466 " wiki_id = ? AND target_name = ?", array(
"integer",
"text"));
473 $stmt = $ilDB->prepareManip(
"DELETE FROM il_wiki_missing_page WHERE ".
474 " wiki_id = ? AND source_id = ?", array(
"integer",
"integer"));
478 include_once(
"./Modules/Wiki/classes/class.ilWikiUtil.php");
481 foreach($int_wiki_links as $wlink)
492 $stmt = $ilDB->prepareManip(
"REPLACE INTO il_wiki_missing_page (wiki_id, source_id, target_name)".
493 " VALUES (?,?,?)", array(
"integer",
"integer",
"text"));
494 $ilDB->execute($stmt, array($this->
getWikiId(), $this->
getId(), $wlink));
506 $query =
"SELECT * FROM il_wiki_page".
507 " WHERE wiki_id = ".$ilDB->quote($a_wiki_id).
508 " AND title = ".$ilDB->quote($a_title);
509 $set = $ilDB->query($query);
527 $query =
"SELECT wp.*, po.view_cnt as cnt FROM il_wiki_page as wp, page_object as po".
528 " WHERE wp.wiki_id = ".$ilDB->quote($a_wiki_id).
529 " AND wp.id = po.page_id ".
530 " AND po.parent_type = 'wpg' ".
531 " ORDER BY po.view_cnt";
532 $set = $ilDB->query($query);
553 $query =
"SELECT count(*) as cnt FROM il_wiki_page".
554 " WHERE wiki_id = ".$ilDB->quote($a_wiki_id);
555 $s = $ilDB->query($query);
577 $rand = rand(1, $cnt);
580 $query =
"SELECT title FROM il_wiki_page".
581 " WHERE wiki_id = ".$ilDB->quote($a_wiki_id).
583 $s = $ilDB->query($query);
600 foreach($pages as $k => $page)