4 include_once(
"./Services/COPage/classes/class.ilPageObject.php");
28 function __construct($a_id = 0, $a_old_nr = 0, $a_halt =
true)
40 $this->title = $a_title;
80 $this->created = $a_date;
100 $id = $ilDB->nextId(
"il_blog_posting");
105 $query =
"INSERT INTO il_blog_posting (id, title, blog_id, created) VALUES (".
106 $ilDB->quote($this->
getId(),
"integer").
",".
107 $ilDB->quote($this->
getTitle(),
"text").
",".
108 $ilDB->quote($this->
getBlogId(),
"integer").
",".
110 $ilDB->manipulate(
$query);
124 function update($a_validate =
true, $a_no_history =
false, $a_notify =
true)
130 $query =
"UPDATE il_blog_posting SET".
131 " title = ".$ilDB->quote($this->
getTitle(),
"text").
132 " WHERE id = ".$ilDB->quote($this->
getId(),
"integer");
133 $ilDB->manipulate(
$query);
139 include_once
"Modules/Blog/classes/class.ilObjBlog.php";
153 $query =
"SELECT * FROM il_blog_posting".
154 " WHERE id = ".$ilDB->quote($this->
getId(),
"integer");
155 $set = $ilDB->query(
$query);
156 $rec = $ilDB->fetchAssoc($set);
175 $query =
"DELETE FROM il_blog_posting".
176 " WHERE id = ".$ilDB->quote($this->
getId(),
"integer");
177 $ilDB->manipulate(
$query);
193 $query =
"SELECT * FROM il_blog_posting".
194 " WHERE blog_id = ".$ilDB->quote($a_blog_id,
"integer");
195 $set = $ilDB->query(
$query);
196 while($rec = $ilDB->fetchAssoc($set))
213 $query =
"SELECT blog_id FROM il_blog_posting".
214 " WHERE id = ".$ilDB->quote($a_posting_id,
"integer");
215 $set = $ilDB->query(
$query);
216 if ($rec = $ilDB->fetchAssoc($set))
218 return $rec[
"blog_id"];
239 $ilDB->setLimit($a_limit, $a_offset);
242 $query =
"SELECT * FROM il_blog_posting".
243 " WHERE blog_id = ".$ilDB->quote($a_blog_id,
"integer").
244 " ORDER BY created DESC";
245 $set = $ilDB->query(
$query);
247 while($rec = $ilDB->fetchAssoc($set))
249 if (isset($pages[$rec[
"id"]]))
251 $post[$rec[
"id"]] = $pages[$rec[
"id"]];
252 $post[$rec[
"id"]][
"title"] = $rec[
"title"];
267 static function exists($a_blog_id, $a_posting_id)
271 $query =
"SELECT id FROM il_blog_posting".
272 " WHERE blog_id = ".$ilDB->quote($a_blog_id,
"integer").
273 " AND id = ".$ilDB->quote($a_posting_id,
"integer");
274 $set = $ilDB->query(
$query);
275 if($rec = $ilDB->fetchAssoc($set))
293 return array_pop(array_keys(
$data));
304 $this->blog_wsp_id = (int)$a_id;