getWhereQuery(); //$query .= " WHERE locked=false"; $query .= " ORDER BY {$order} DESC"; $query .= " LIMIT {$limit} OFFSET {$offset}"; $res = query_rows($query); return $res; } function getSearchWord() { if (isset($_SESSION["test"]["searchword"])) { return $_SESSION["test"]["searchword"]; } return ""; } function getWhereQuery() { global $TeKe; $query = " WHERE"; $query .= " locked=false"; if ($this->getSearchWord()) { $query .= " AND title LIKE '%". $this->getSearchWord() ."%'"; } return $query; } function getPageCount($limit=20) { $query = "SELECT * FROM ". DB_PREFIX ."tests"; $query .= $this->getWhereQuery(); $total_count = mysql_num_rows(query($query)); $last_page = ceil($total_count/$limit); return $last_page; } } ?>