当前位置: 首页>>代码示例>>PHP>>正文


PHP pages函数代码示例

本文整理汇总了PHP中pages函数的典型用法代码示例。如果您正苦于以下问题:PHP pages函数的具体用法?PHP pages怎么用?PHP pages使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了pages函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: get_list

 function get_list($condition = 'status=3', $order = 'itemid DESC')
 {
     global $MOD, $pages, $page, $pagesize, $offset, $items, $sum;
     if ($page > 1 && $sum) {
         $items = $sum;
     } else {
         $r = $this->db->get_one("SELECT COUNT(*) AS num FROM {$this->table} WHERE {$condition}");
         $items = $r['num'];
     }
     $pages = pages($items, $page, $pagesize);
     if ($items < 1) {
         return array();
     }
     $lists = array();
     $result = $this->db->query("SELECT * FROM {$this->table} WHERE {$condition} ORDER BY {$order} LIMIT {$offset},{$pagesize}");
     while ($r = $this->db->fetch_array($result)) {
         $r['adddate'] = timetodate($r['addtime'], 5);
         if (strpos($r['content'], '<hr class="club_break" />') !== false) {
             $r['content'] = substr($r['content'], strpos($r['content'], '<hr class="club_break" />'));
         }
         $r['title'] = get_intro($r['content'], 50);
         $r['alt'] = get_intro($r['content'], 500);
         $r['linkurl'] = $MOD['linkurl'] . 'goto.php?itemid=' . $r['itemid'];
         $lists[] = $r;
     }
     return $lists;
 }
开发者ID:hiproz,项目名称:zhaotaoci.cc,代码行数:27,代码来源:reply.class.php

示例2: indexAction

 public function indexAction()
 {
     $search = daddslashes($this->postVar('search', ''));
     $mobile = daddslashes($this->postVar('sms_mobile', ''));
     $startTime = daddslashes($this->postVar('start_time', ''));
     $endTime = daddslashes($this->postVar('end_time', ''));
     $page = (int) $this->reqVar('page', 1);
     if (!empty($search) && !empty($mobile)) {
         $passwdSet['mobile'] = $mobile;
     }
     if (!empty($startTime)) {
         $passwdSet['start_time'] = $startTime;
     }
     if (!empty($endTime)) {
         $passwdSet['end_time'] = $endTime;
     }
     $passwdList = $this->smspassModel->getPasswdList($passwdSet, $page, 20);
     $passwdCount = $this->smspassModel->getPasswdCount($passwdSet);
     $passwdPages = pages($passwdCount, $page, 20, '', $array = array());
     $this->assign('mobile', $mobile);
     $this->assign('passwdList', $passwdList);
     $this->assign("smspwStatus", $this->configModel['smspw_status']);
     $this->assign('passwdPages', $passwdPages);
     $this->getViewer()->needLayout(false);
     $this->render('smspasswd');
 }
开发者ID:spwx820,项目名称:lock-money-admin_cp,代码行数:26,代码来源:smspasswd.php

示例3: get_list

 function get_list($condition = '1', $order = 'addtime DESC')
 {
     global $MOD, $pages, $page, $pagesize, $offset, $sum;
     if ($page > 1 && $sum) {
         $items = $sum;
     } else {
         $r = $this->db->get_one("SELECT COUNT(*) AS num FROM {$this->table} WHERE {$condition}");
         $items = $r['num'];
     }
     $pages = pages($items, $page, $pagesize);
     if ($items < 1) {
         return array();
     }
     $lists = array();
     $result = $this->db->query("SELECT * FROM {$this->table} WHERE {$condition} ORDER BY {$order} LIMIT {$offset},{$pagesize}");
     while ($r = $this->db->fetch_array($result)) {
         $r['adddate'] = timetodate($r['addtime'], 5);
         $r['editdate'] = timetodate($r['edittime'], 5);
         $r['title'] = set_style($r['title'], $r['style']);
         $r['linkurl'] = $MOD['linkurl'] . rewrite('expert.php?itemid=' . $r['itemid']);
         $r['rate'] = $r['answer'] && $r['best'] < $r['answer'] ? dround($r['best'] * 100 / $r['answer'], 2, true) . '%' : '100%';
         $lists[] = $r;
     }
     return $lists;
 }
开发者ID:hiproz,项目名称:zhaotaoci.cc,代码行数:25,代码来源:expert.class.php

示例4: get_list

 function get_list($condition, $order = 'listorder ASC,itemid ASC')
 {
     global $MOD, $pages, $page, $pagesize, $offset, $sum;
     if ($page > 1 && $sum) {
         $items = $sum;
     } else {
         $r = $this->db->get_one("SELECT COUNT(*) AS num FROM {$this->table} WHERE {$condition}");
         $items = $r['num'];
     }
     $pages = pages($items, $page, $pagesize);
     if ($items < 1) {
         return array();
     }
     $lists = array();
     $result = $this->db->query("SELECT * FROM {$this->table} WHERE {$condition} ORDER BY {$order} LIMIT {$offset},{$pagesize}");
     while ($r = $this->db->fetch_array($result)) {
         $r['adddate'] = timetodate($r['addtime'], 5);
         $r['editdate'] = timetodate($r['edittime'], 5);
         if ($r['areaid']) {
             $r['address'] = area_pos($r['areaid'], '') . $r['address'];
         }
         $lists[] = $r;
     }
     return $lists;
 }
开发者ID:hiproz,项目名称:zhaotaoci.cc,代码行数:25,代码来源:address.class.php

示例5: index

 public function index()
 {
     //$Line_type = M('Line_type');
     $catid = I('get.catid', 1);
     $sql = "select count(*) as num from __LINE_TYPE__ as a,__LINE__ as b\n        where a.type_id = {$catid} and a.line_id = b.line_id and b.status=1";
     $pageNum = 10;
     $_page = pages($sql, $pageNum);
     $nowPage = I('get.p', 1);
     $firstRow = ($nowPage - 1) * $pageNum;
     $Model = new \Think\Model();
     $line_lists = $Model->query("select a.*, b.* from __LINE_TYPE__ as a,\n       __LINE__ as b where a.type_id = {$catid} and a.line_id = b.line_id and b.status=1\n       order by b.update_time desc, b.line_id desc limit {$firstRow},{$pageNum}");
     $line_lists = array_filter($line_lists);
     foreach ($line_lists as $key => $val) {
         $map_two = array();
         $map_two['line_id&is_default'] = array($val['line_id'], 1, '_multi' => true);
         $res = get_tc_val($map_two);
         $line_lists[$key]['price'] = $res['price'];
         $line_lists[$key]['best_price'] = $res['best_price'];
         $line_lists[$key]['start_date'] = get_start_date($res['date_price_data']);
         $line_lists[$key]['img'] = get_cover(array_shift(explode(',', $val['images'])), 'path');
         $line_lists[$key]['url'] = U('Line/show', array('id' => $val['line_id']));
     }
     $this->assign('line_lists', $line_lists);
     $this->assign('_page', $_page);
     $this->display();
 }
开发者ID:lampge,项目名称:youweihui,代码行数:26,代码来源:LineController.class.php

示例6: get_list

 function get_list($condition = '1', $order = 'listorder DESC, itemid DESC')
 {
     global $MODULE, $MOD, $pages, $page, $pagesize, $offset, $sum;
     if ($page > 1 && $sum) {
         $items = $sum;
     } else {
         $r = $this->db->get_one("SELECT COUNT(*) AS num FROM {$this->table} WHERE {$condition}");
         $items = $r['num'];
     }
     $pages = pages($items, $page, $pagesize);
     $GROUP = cache_read('group.php');
     $lists = array();
     $result = $this->db->query("SELECT * FROM {$this->table} WHERE {$condition} ORDER BY {$order} LIMIT {$offset},{$pagesize}");
     while ($r = $this->db->fetch_array($result)) {
         $r['adddate'] = timetodate($r['addtime'], 5);
         $r['thumb'] = is_file(DT_ROOT . '/' . $MODULE[4]['moduledir'] . '/skin/' . $r['skin'] . '/thumb.gif') ? $MODULE[4]['linkurl'] . 'skin/' . $r['skin'] . '/thumb.gif' : $MODULE[4]['linkurl'] . 'image/nothumb.gif';
         $groupid = explode(',', substr($r['groupid'], 1, -1));
         $group = array();
         foreach ($groupid as $gid) {
             $group[] = $GROUP[$gid]['groupname'];
         }
         $r['group'] = implode('<br/>', $group);
         $lists[] = $r;
     }
     return $lists;
 }
开发者ID:hcd2008,项目名称:destoon,代码行数:26,代码来源:style.class.php

示例7: indexAction

 public function indexAction()
 {
     $page = (int) $this->reqVar('page', 1);
     $actionOs = daddslashes(trim($this->reqVar('action_os', 'ios')));
     $pageUrl = "/admin/version/";
     $versionSet = array();
     $start = ($page - 1) * 20;
     $end = $page * 20;
     if (!empty($actionOs)) {
         $versionSet['os_type'] = $actionOs;
         $pageUrl .= "?action_os={$actionOs}";
         $versionList = $this->versionModel->query("SELECT * FROM z_version where status in (0, 1) AND os_type='{$actionOs}' ORDER BY id DESC LIMIT {$start}, {$end}");
     } else {
         $versionList = $this->versionModel->query("SELECT * FROM z_version where status in (0, 1) ORDER BY id DESC LIMIT {$start}, {$end}");
     }
     //        $versionList = $this->versionModel->query("SELECT * FROM z_version where status in (0, 1) ORDER BY id DESC LIMIT $start, $end");
     $versionCount = $this->versionModel->getVersionCount($versionSet);
     $versionPages = pages($versionCount, $page, 20, $pageUrl, array());
     $this->assign('versionList', $versionList);
     $this->assign('versionPages', $versionPages);
     $this->assign("packageOs", $this->configModel['pk_os']);
     $this->assign("publicRadio", $this->configModel['public_radio']);
     $this->assign("publicRadio_force", $this->configModel['public_radio_force']);
     $this->assign("versionStatus", $this->configModel['version_status']);
     $this->assign("actionOs", $actionOs);
     $this->assign('page', $page);
     $this->assign('adminId', UID);
     $this->getViewer()->needLayout(false);
     $this->render('version_list');
 }
开发者ID:spwx820,项目名称:lock-money-admin_cp,代码行数:30,代码来源:version.php

示例8: get_list

 function get_list($condition = 'status=3', $order = 'itemid DESC')
 {
     global $MOD, $TYPE, $pages, $page, $pagesize, $offset, $items, $sum;
     if ($page > 1 && $sum) {
         $items = $sum;
     } else {
         $r = $this->db->get_one("SELECT COUNT(*) AS num FROM {$this->table} WHERE {$condition}");
         $items = $r['num'];
     }
     $pages = pages($items, $page, $pagesize);
     if ($items < 1) {
         return array();
     }
     $lists = $groupids = array();
     $result = $this->db->query("SELECT * FROM {$this->table} WHERE {$condition} ORDER BY {$order} LIMIT {$offset},{$pagesize}");
     while ($r = $this->db->fetch_array($result)) {
         $r['adddate'] = timetodate($r['addtime'], 5);
         $groupids[$r['gid']] = $r['gid'];
         $lists[] = $r;
     }
     if ($groupids) {
         $GRPS = array();
         $result = $this->db->query("SELECT itemid,title,linkurl FROM {$this->db->pre}club_group WHERE itemid IN (" . implode(',', $groupids) . ")");
         while ($r = $this->db->fetch_array($result)) {
             $GRPS[$r['itemid']] = $r;
         }
         if ($GRPS) {
             foreach ($lists as $k => $v) {
                 $lists[$k]['groupname'] = $v['gid'] ? $GRPS[$v['gid']]['title'] : '';
                 $lists[$k]['groupurl'] = $v['gid'] ? $MOD['linkurl'] . $GRPS[$v['gid']]['linkurl'] : '';
             }
         }
     }
     return $lists;
 }
开发者ID:hiproz,项目名称:zhaotaoci.cc,代码行数:35,代码来源:fans.class.php

示例9: get_list

 function get_list($condition = 'status=3', $order = 'addtime DESC', $cache = '')
 {
     global $MOD, $pages, $page, $pagesize, $offset, $items, $TYPE, $special, $sum;
     if ($page > 1 && $sum) {
         $items = $sum;
     } else {
         $r = $this->db->get_one("SELECT COUNT(*) AS num FROM {$this->table} WHERE {$condition}", $cache);
         $items = $r['num'];
     }
     $pages = pages($items, $page, $pagesize);
     if ($items < 1) {
         return array();
     }
     $lists = array();
     $result = $this->db->query("SELECT * FROM {$this->table} WHERE {$condition} ORDER BY {$order} LIMIT {$offset},{$pagesize}", $cache);
     while ($r = $this->db->fetch_array($result)) {
         $r['adddate'] = timetodate($r['addtime'], 5);
         $r['editdate'] = timetodate($r['edittime'], 5);
         $r['alt'] = $r['title'];
         $r['title'] = set_style($r['title'], $r['style']);
         $r['type'] = $r['typeid'] && isset($TYPE[$r['typeid']]) ? set_style($TYPE[$r['typeid']]['typename'], $TYPE[$r['typeid']]['style']) : '';
         $r['typeurl'] = $r['type'] ? rewrite($MOD['linkurl'] . 'type.php?tid=' . $r['typeid']) : '';
         $lists[] = $r;
     }
     return $lists;
 }
开发者ID:hiproz,项目名称:zhaotaoci.cc,代码行数:26,代码来源:item.class.php

示例10: indexAction

 public function indexAction()
 {
     $page = (int) $this->reqVar('page', 1);
     $actionType = daddslashes($this->postVar('action_type', ''));
     $actionStatus = daddslashes($this->postVar('action_status', ''));
     $adSet = array();
     if (!empty($actionType)) {
         $adSet['action'] = $actionType;
     }
     if (is_numeric($actionStatus)) {
         $adSet['z_status'] = $actionStatus;
     }
     $adList = $this->adwidgetModel->getAdList($adSet, $page, 60);
     $adCount = $this->adwidgetModel->getAdCount($adSet);
     $adPages = pages($adCount, $page, 60, '', $array = array());
     $this->assign('adList', $adList);
     $this->assign('adCount', $adCount);
     $this->assign('adPages', $adPages);
     $this->assign("adTop", $this->configModel['ad_top']);
     $this->assign("adStatus", $this->configModel['ad_status']);
     $this->assign("adZStatus", $this->configModel['ad_z_status']);
     $this->assign("adType", $this->configModel['ad_widget_type']);
     $this->assign("actionType", $actionType);
     $this->assign("actionStatus", $actionStatus);
     $this->getViewer()->needLayout(false);
     $this->render('adwidget_list');
 }
开发者ID:spwx820,项目名称:lock-money-admin_cp,代码行数:27,代码来源:adwidget.php

示例11: indexAction

 public function indexAction()
 {
     $page = (int) $this->reqVar('page', 1);
     $menuSet = array();
     $menuList = $this->menuModel->getMenuList($menuSet, $page, 100);
     if ($menuList) {
         foreach ($menuList as $key => $val) {
             if (empty($val['parent_id'])) {
                 $menuList[$key]['parent_name'] = '一级菜单';
                 continue;
             }
             $menuParent = $this->menuModel->getMenu(array('id' => $val['parent_id']));
             if ($menuParent) {
                 $menuList[$key]['parent_name'] = $menuParent['name'];
             } else {
                 $menuList[$key]['parent_name'] = '';
             }
         }
     }
     $menuCount = $this->menuModel->getMenuCount($menuSet);
     $menuPages = pages($menuCount, $page, 100, '', $array = array());
     $this->assign('menuList', $menuList);
     $this->assign("menuConceal", $this->configModel['menu_conceal']);
     $this->assign("menuStatus", $this->configModel['menu_status']);
     $this->assign('menuCount', $menuCount);
     $this->assign('menuPages', $menuPages);
     $this->assign('page', $page);
     $this->getViewer()->needLayout(false);
     $this->render('menu_list');
 }
开发者ID:spwx820,项目名称:lock-money-admin_cp,代码行数:30,代码来源:menu.php

示例12: get_list

 function get_list($condition = '1', $order = 'addtime DESC')
 {
     global $pages, $page, $pagesize, $offset, $pagesize, $MOD, $item, $sum;
     if ($page > 1 && $sum) {
         $items = $sum;
     } else {
         $r = $this->db->get_one("SELECT COUNT(*) AS num FROM {$this->table} WHERE {$condition}");
         $item = $r['num'];
     }
     $pages = pages($item, $page, $pagesize);
     $lists = $pids = $P = array();
     $result = $this->db->query("SELECT * FROM {$this->table} WHERE {$condition} ORDER BY {$order} LIMIT {$offset},{$pagesize}");
     while ($r = $this->db->fetch_array($result)) {
         $r['adddate'] = timetodate($r['addtime'], 5);
         $r['editdate'] = timetodate($r['edittime'], 5);
         $r['linkurl'] = $MOD['linkurl'] . rewrite('price.php?itemid=' . $r['pid']);
         $pids[$r['pid']] = $r['pid'];
         $lists[] = $r;
     }
     if ($pids) {
         $result = $this->db->query("SELECT * FROM {$this->table_product} WHERE itemid IN (" . implode(',', $pids) . ")");
         while ($r = $this->db->fetch_array($result)) {
             $P[$r['itemid']] = $r;
         }
         if ($P) {
             foreach ($lists as $k => $v) {
                 $lists[$k]['unit'] = $P[$v['pid']]['unit'];
                 $lists[$k]['alt'] = $P[$v['pid']]['title'];
                 $lists[$k]['title'] = set_style($P[$v['pid']]['title'], $P[$v['pid']]['style']);
             }
         }
     }
     return $lists;
 }
开发者ID:hcd2008,项目名称:destoon,代码行数:34,代码来源:price.class.php

示例13: show

 function show()
 {
     global $set, $db, $apx, $html;
     quicklink('contact.add');
     $orderdef[0] = 'title';
     $orderdef['title'] = array('title', 'ASC', 'COL_TITLE');
     $orderdef['email'] = array('email', 'ASC', 'COL_EMAIL');
     $col[] = array('ID', 3, 'align="center"');
     $col[] = array('COL_TITLE', 50, 'class="title"');
     $col[] = array('COL_EMAIL', 47, '');
     list($count) = $db->first("SELECT count(id) FROM " . PRE . "_contact");
     pages('action.php?action=contact.show&amp;sortby=' . $_REQUEST['sortby'], $count);
     $data = $db->fetch("SELECT id,title,email FROM " . PRE . "_contact " . getorder($orderdef) . getlimit());
     if (count($data)) {
         foreach ($data as $res) {
             ++$i;
             $tabledata[$i]['COL1'] = $res['id'];
             $tabledata[$i]['COL2'] = replace($res['title']);
             $tabledata[$i]['COL3'] = replace($res['email']);
             //Optionen
             if ($apx->user->has_right('contact.edit')) {
                 $tabledata[$i]['OPTIONS'] .= optionHTML('edit.gif', 'contact.edit', 'id=' . $res['id'], $apx->lang->get('CORE_EDIT'));
             }
             if ($apx->user->has_right('contact.del')) {
                 $tabledata[$i]['OPTIONS'] .= optionHTMLOverlay('del.gif', 'contact.del', 'id=' . $res['id'], $apx->lang->get('CORE_DEL'));
             }
         }
     }
     $apx->tmpl->assign('TABLE', $tabledata);
     $html->table($col);
     orderstr($orderdef, 'action.php?action=contact.show');
     save_index($_SERVER['REQUEST_URI']);
 }
开发者ID:bigfraggle,项目名称:open-apexx,代码行数:33,代码来源:admin.php

示例14: get_list

 function get_list($condition = 'status=3', $order = 'itemid DESC')
 {
     global $MOD, $pages, $page, $pagesize, $offset, $sum;
     if ($page > 1 && $sum) {
         $items = $sum;
     } else {
         $r = $this->db->get_one("SELECT COUNT(*) AS num FROM {$this->table} WHERE {$condition}");
         $items = $r['num'];
     }
     $pages = pages($items, $page, $pagesize);
     if ($items < 1) {
         return array();
     }
     $lists = array();
     $result = $this->db->query("SELECT * FROM {$this->table} WHERE {$condition} ORDER BY {$order} LIMIT {$offset},{$pagesize}");
     while ($r = $this->db->fetch_array($result)) {
         $r['adddate'] = timetodate($r['addtime'], 5);
         $r['content'] = nl2br($r['content']);
         $r['editdate'] = '--';
         if ($r['reply']) {
             $r['reply'] = nl2br($r['reply']);
             $r['editdate'] = timetodate($r['edittime'], 5);
         }
         $lists[] = $r;
     }
     return $lists;
 }
开发者ID:hiproz,项目名称:zhaotaoci.cc,代码行数:27,代码来源:guestbook.class.php

示例15: indexAction

 public function indexAction()
 {
     $keyword = daddslashes($this->reqVar('keyword', ''));
     $startTime = daddslashes($this->reqVar('start_time', ''));
     $endTime = daddslashes($this->reqVar('end_time', ''));
     $page = (int) $this->reqVar('page', 1);
     $pageUrl = "/admin/thread_raffle/";
     $raffleSet = array();
     if (!empty($keyword)) {
         $raffleSet['tid'] = $keyword;
         $pageUrl .= "?keyword={$keyword}";
     }
     if (!empty($startTime)) {
         $raffleSet['start_time'] = $startTime . " 00:00:00";
         $pageUrl .= !empty($keyword) ? "&" : "?";
         $pageUrl .= "start_time={$startTime}";
     }
     if (!empty($endTime)) {
         $raffleSet['end_time'] = $startTime . " 23:59:59";
         $pageUrl .= !empty($keyword) || !empty($startTime) ? "&" : "?";
         $pageUrl .= "end_time={$endTime}";
     }
     $raffleList = $this->raffleModel->getRaffleList($raffleSet);
     $raffleCount = $this->raffleModel->getRaffleCount($raffleSet);
     $rafflePages = pages($raffleCount, $page, 20, $pageUrl, array());
     $this->assign('raffleList', $raffleList);
     $this->assign('rafflePages', $rafflePages);
     $this->assign('isImagesStatus', $this->isImagesStatus);
     $this->assign('keyword', $keyword);
     $this->assign('page', $page);
     $this->assign('siteUrl', $this->siteUrl);
     $this->getViewer()->needLayout(false);
     $this->render('thread_raffle_list');
 }
开发者ID:spwx820,项目名称:lock-money-admin_cp,代码行数:34,代码来源:thread_raffle.php


注:本文中的pages函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。