1 Star 0 Fork 4

craboy1/myb2c

forked from carlton/myb2c 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
ann.php 841 Bytes
一键复制 编辑 原始数据 按行查看 历史
carlton 提交于 2014-02-09 12:57 . init
<?php
include './include/common.inc.php';
$perpage = 10;
$pagevar = "page";
$nowtime=time();
$q2 = $db->query("select id from ann where time>{$nowtime} or time=0");
$pages = new Fpage();
$pages->totalNums = $db->num_rows($q2);
$pages->perpageNum = $perpage;
$pages->pageVar = $pagevar;
$pages->jump_pageinputId = "jumppage";
$pagestr = $pages->showpages();
$page = ($$pagevar && is_numeric($$pagevar)) ? $$pagevar : 0;
$leftstart = $perpage * (max(0, $page - 1));
$q3 = $db->query("select * from ann where time > {$nowtime} or time=0 order by id desc limit {$leftstart},{$perpage} ");
$ann_list = array();
while ($row = $db->fetch_array($q3)) {
$ann_list[] = $row;
}
unset($q3);
$tpl->assign("ann_list", $ann_list);
$tpl->assign("page", $pagestr);
$tpl->assign("title","公告");
$tpl->display("ann.html");
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/craboy1/myb2c.git
git@gitee.com:craboy1/myb2c.git
craboy1
myb2c
myb2c
master

搜索帮助