public function ins_posts($post_info, $offset = 0) { $posts = array(); $i = 0; //$defs = array(); $html = new \Ext\Html(); //imessage -> pure text MD or BBCode can be used //omessage -> HTML foreach ($post_info as $post) { //$posts[$i] = $this->set_value($post, $defs); $posts[$i] = $post; $posts[$i]["post_id"] += $offset; if (isset($post['imessage']) && isset($post['omessage'])) { //everything is perfect } else { $posts[$i]["imessage"] = Format::br2nl(Format::imessage($post['message'])); $posts[$i]["omessage"] = $html->filter(Format::parseBBCode($post['message']), false, true); } if (method_exists($this->driver, 'modify_posts')) { $posts[$i] = $this->driver->modify_posts($posts[$i]); } $i++; } // var_dump($cats); $attrs = array("post_id", "topic_id", "cat_id", "uid", "imessage", "omessage", "post_created"); $qry = $this->prepare_ins_qry($posts, $attrs, "codo_posts"); //$this->query .= $qry; }
public static function omessage($mesg) { $html = new \Ext\Html(); //$imesg; no escaping required $mesg = $html->filter(str_replace("STARTCODOTAG", "<", $mesg)); return $mesg; }