convertSortMode($sort_mode); $query_cant = "select count(*) from `tiki_hotwords` $mid"; $result = $this->query($query, $bindvars, $maxRecords, $offset); $cant = $this->getOne($query_cant, $bindvars); $ret = []; while ($res = $result->fetchRow(DB_FETCHMODE_ASSOC)) { $ret[] = $res; } $retval = []; $retval["data"] = $ret; $retval["cant"] = $cant; return $retval; } /** * @param $word * @param $url * * @return TikiDb_Pdo_Result|TikiDb_Adodb_Result */ public function add_hotword($word, $url) { // $word = addslashes($word); $url = addslashes($url); $query = "delete from `tiki_hotwords` where `word`=?"; $this->query($query, [$word]); $query = "insert into `tiki_hotwords`(`word`,`url`) values(?,?)"; return $this->query($query, [$word,$url]); } /** * @param $word * * @return TikiDb_Pdo_Result|TikiDb_Adodb_Result */ public function remove_hotword($word) { $query = "delete from `tiki_hotwords` where `word`=?"; return $this->query($query, [$word]); } } $hotwordlib = new HotwordsLib();