0?intval($_GET['page']):1; $perPage = 16; $query = $db->query_first("select count(*) as c from {$db->prefix}news"); $count = $query['c']; if ($count%$perPage) { $countPage = intval(($count/$perPage)+1); } else { $countPage = intval($count/$perPage); } $start = intval($thisPage-1) * $perPage; $query = $db->query("select * from {$db->prefix}news ORDER BY id DESC limit $start,$perPage"); for ($i=0;$i<$db->num_rows($query);$i++) { $data[$i] = $db->fetch_array($query); } $smarty->assign("data",$data); if ($countPage > 1) $smarty->assign("pager",getPage($thisPage,$countPage,'news.php')); $smarty->assign("title",$lang?"Events":"新闻中心"); $smarty->display($langtpl . "news.html"); ?>