id = $id+0; $this->getData(); } // --------------------------------------------------------------- // getData() : récupération infos // --------------------------------------------------------------- public function getData() { global $dbh,$msg; if($this->id) { $requete = "SELECT * FROM bannette_tpl WHERE bannettetpl_id='".$this->id."' LIMIT 1 "; $result = @pmb_mysql_query($requete, $dbh); if(pmb_mysql_num_rows($result)) { $temp = pmb_mysql_fetch_object($result); $this->name = $temp->bannettetpl_name; $this->comment = $temp->bannettetpl_comment; $this->tpl = $temp->bannettetpl_tpl; } } } public static function render($id, $data) { global $dbh, $charset; $requete = "SELECT * FROM bannette_tpl WHERE bannettetpl_id='".$id."' LIMIT 1 "; $result = @pmb_mysql_query($requete, $dbh); if(pmb_mysql_num_rows($result)) { $temp = pmb_mysql_fetch_object($result); $data_to_return = H2o::parseString($temp->bannettetpl_tpl)->render($data); if ($charset !="utf-8") { $data_to_return = utf8_decode($data_to_return); } return $data_to_return; } } } // fin class