removed deprecated mysql_fetch_row().
This commit is contained in:
@@ -11,27 +11,26 @@ class forum
|
||||
|
||||
public function paginator($t, $pagers = 0)
|
||||
{
|
||||
$args = [];
|
||||
if (isset($_GET['search'])) {
|
||||
$where = '( `text` LIKE "%' . mysql_real_escape_string($_GET['search']) . '%" OR `title` LIKE "%' . mysql_real_escape_string($_GET['search']) . '%" OR `login` LIKE "%' . mysql_real_escape_string($_GET['search']) . '%" ) AND `topic` < "0" AND `delete` = "0"';
|
||||
$where = '(text like ? or title like ? or login like ?) and topic < 0 and `delete` = 0';
|
||||
$args = [$_GET['search'], $_GET['search'], $_GET['search']];
|
||||
$pre_url = 'search=' . htmlspecialchars($_GET['search'], null) . '&read=' . $pagers . '&';
|
||||
$idpaginator = $pagers;
|
||||
} elseif ($pagers != 0) {
|
||||
$where = '`topic` = "' . $pagers . '" AND `delete` = "0"';
|
||||
$where = 'topic = ? and `delete` = 0';
|
||||
$args = [$pagers];
|
||||
$pre_url = 'read=' . $pagers . '&';
|
||||
$idpaginator = $pagers;
|
||||
} elseif ($t == 1) {
|
||||
$where = '`topic` < "0" AND `fid` = "' . $this->r . '" AND `delete` = "0"';
|
||||
$where = 'topic < 0 and fid = ? and `delete` = 0';
|
||||
$args = [$this->r];
|
||||
$pre_url = 'r=' . $this->r . '&';
|
||||
$idpaginator = $this->r;
|
||||
} elseif ($t == 2) {
|
||||
$where = '`topic` = "' . $this->see['id'] . '" AND `delete` = "0"';
|
||||
$where = 'topic = ? and `delete` = 0';
|
||||
$args = [$this->see['id']];
|
||||
$pre_url = 'read=' . $this->see['id'] . '&';
|
||||
$idpaginator = $this->see['id'];
|
||||
}
|
||||
$q = "SELECT count(*) FROM forum_msg WHERE " . $where;
|
||||
$res = mysql_query($q);
|
||||
$row = mysql_fetch_row($res);
|
||||
$total_rows = $row[0];
|
||||
|
||||
$total_rows = \Core\Db::getValue("select count(*) from forum_msg where $where", $args);
|
||||
$num_pages = ceil($total_rows / 20);
|
||||
$plist = '';
|
||||
for ($i = 1; $i <= $num_pages; $i++) {
|
||||
|
||||
Reference in New Issue
Block a user