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


PHP listpages函数代码示例

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


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

示例1: max

    }
} else {
    $items = $CAT['item'];
}
$pagesize = $MOD['pagesize'];
$showpage = 1;
$template = $CAT['template'] ? $CAT['template'] : 'list';
$total = max(ceil($items / $MOD['pagesize']), 1);
if (isset($fid) && isset($num)) {
    $page = $fid;
    $topage = $fid + $num - 1;
    $total = $topage < $total ? $topage : $total;
}
for (; $page <= $total; $page++) {
    $offset = ($page - 1) * $pagesize;
    $pages = listpages($CAT, $items, $page, $pagesize);
    $tags = $_tags = $ids = array();
    if ($items) {
        $result = $db->query("SELECT " . $MOD['fields'] . " FROM {$table} WHERE {$condition} ORDER BY " . $MOD['order'] . " LIMIT {$offset},{$pagesize}");
        while ($r = $db->fetch_array($result)) {
            if ($lazy && isset($r['thumb']) && $r['thumb']) {
                $r['thumb'] = DT_SKIN . 'image/lazy.gif" original="' . $r['thumb'];
            }
            $tags[] = $r;
        }
    }
    $seo_file = 'list';
    include DT_ROOT . '/include/seo.inc.php';
    $destoon_task = "moduleid={$moduleid}&html=list&catid={$catid}&page={$page}";
    if ($EXT['wap_enable']) {
        $head_mobile = $EXT['wap_url'] . 'index.php?moduleid=' . $moduleid . '&catid=' . $catid . ($page > 1 ? '&page=' . $page : '');
开发者ID:hcd2008,项目名称:destoon,代码行数:31,代码来源:list.htm.php

示例2: get_list

 function get_list($condition = 'status=3', $order = 'edittime DESC', $cache = '')
 {
     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}", $cache);
         $items = $r['num'];
     }
     $pages = defined('CATID') ? listpages(1, CATID, $items, $page, $pagesize, 10, $MOD['linkurl']) : pages($items, $page, $pagesize);
     $lists = $catids = $CATS = 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['linkurl'] = $MOD['linkurl'] . $r['linkurl'];
         $catids[$r['catid']] = $r['catid'];
         $lists[] = $r;
     }
     if ($catids) {
         $result = $this->db->query("SELECT catid,catname,linkurl FROM {$this->db->pre}category WHERE catid IN (" . implode(',', $catids) . ")");
         while ($r = $this->db->fetch_array($result)) {
             $CATS[$r['catid']] = $r;
         }
         if ($CATS) {
             foreach ($lists as $k => $v) {
                 $lists[$k]['catname'] = $v['catid'] ? $CATS[$v['catid']]['catname'] : '';
                 $lists[$k]['caturl'] = $v['catid'] ? $MOD['linkurl'] . $CATS[$v['catid']]['linkurl'] : '';
             }
         }
     }
     return $lists;
 }
开发者ID:hcd2008,项目名称:destoon,代码行数:35,代码来源:video.class.php

示例3: tag


//.........这里部分代码省略.........
        } else {
            if ($moduleid == 4) {
                $condition .= " AND catids LIKE '%,{$catid},%'";
            }
        }
    }
    if ($areaid) {
        if (is_numeric($areaid)) {
            $ARE = $db->get_one("SELECT child,arrchildid FROM {$db->pre}area WHERE areaid={$areaid}");
            $condition .= $areachild && $ARE['child'] ? " AND areaid IN (" . $ARE['arrchildid'] . ")" : " AND areaid={$areaid}";
        } else {
            if ($areachild) {
                $areaids = '';
                $result = $db->query("SELECT arrchildid FROM {$db->pre}area WHERE areaid IN ({$areaid})");
                while ($r = $db->fetch_array($result)) {
                    $areaids .= ',' . $r['arrchildid'];
                }
                if ($areaids) {
                    $areaid = substr($areaids, 1);
                }
            }
            $condition .= " AND areaid IN ({$areaid})";
        }
    }
    $table = isset($table) ? $prefix . $table : get_table($moduleid);
    $offset or $offset = ($page - 1) * $pagesize;
    $percent = dround(100 / $cols) . '%';
    $num = 0;
    $order = $order ? ' ORDER BY ' . $order : '';
    $condition = stripslashes($condition);
    $condition = str_replace('##', '%', $condition);
    if ($showpage) {
        $num = $db->count($table, $condition, $tag_expires ? $tag_expires : $CFG['db_expires']);
        $pages = $catid ? listpages(get_cat($catid), $num, $page, $pagesize) : pages($num, $page, $pagesize);
    } else {
        if ($group) {
            $condition .= ' GROUP BY ' . $group;
        }
    }
    if ($page < 2 && strpos($parameter, '&page=') !== false) {
        $db_cache = 'CACHE';
        $tag_expires = $CFG['tag_expires'];
    }
    if ($template == 'null') {
        $db_cache = 'CACHE';
    }
    $query = "SELECT " . $fields . " FROM " . $table . " WHERE " . $condition . $order . " LIMIT " . $offset . "," . $pagesize;
    if ($debug) {
        echo $parameter . '<br/>' . $query . '<br/>';
    }
    $tags = $catids = $CATS = array();
    $result = $db->query($query, $db_cache, $tag_expires);
    while ($r = $db->fetch_array($result)) {
        if ($moduleid == 4 && isset($r['company'])) {
            $r['alt'] = $r['companyname'] = $r['company'];
            if ($length) {
                $r['company'] = dsubstr($r['company'], $length);
            }
        }
        if (isset($r['title'])) {
            $r['title'] = str_replace('"', '&quot;', trim($r['title']));
            $r['alt'] = $r['title'];
            if ($length) {
                $r['title'] = dsubstr($r['title'], $length);
            }
            if (isset($r['style']) && $r['style']) {
开发者ID:hiproz,项目名称:zhaotaoci.cc,代码行数:67,代码来源:tag.func.php

示例4: pages

            $items = $db->count($table, $condition, $CFG['db_expires']);
            if ($items != $GRP['post']) {
                $GRP['post'] = $items;
                $db->query("UPDATE {$table}_group SET post={$items} WHERE itemid={$catid}");
            }
        } else {
            $items = $GRP['post'];
        }
    }
}
$pagesize = $MOD['pagesize'];
$offset = ($page - 1) * $pagesize;
if ($typeid) {
    $pages = pages($items, $page, $pagesize);
} else {
    $pages = listpages(array('catid' => $GRP['itemid'], 'catdir' => $GRP['filepath'], 'catname' => $GRP['title'], 'linkurl' => $GRP['linkurl']), $items, $page, $pagesize);
}
$tags = array();
if ($typeid == 0 && $page == 1) {
    $result = $db->query("SELECT " . $MOD['fields'] . " FROM {$table} WHERE status=3 AND ontop=2 ORDER BY addtime DESC LIMIT " . $MOD['maxontop'], 'CACHE');
    while ($r = $db->fetch_array($result)) {
        $r['adddate'] = timetodate($r['addtime'], 5);
        $r['editdate'] = timetodate($r['edittime'], 5);
        if ($lazy && isset($r['thumb']) && $r['thumb']) {
            $r['thumb'] = DT_SKIN . 'image/lazy.gif" original="' . $r['thumb'];
        }
        $r['alt'] = $r['title'];
        $r['title'] = set_style($r['title'], $r['style']);
        $r['linkurl'] = $MOD['linkurl'] . $r['linkurl'];
        if (!$r['username']) {
            $r['username'] = 'Guest';
开发者ID:hiproz,项目名称:zhaotaoci.cc,代码行数:31,代码来源:group.inc.php

示例5: get_list

 function get_list($condition = 'status=3', $order = 'edittime DESC', $cache = '')
 {
     global $MOD, $pages, $page, $pagesize, $offset, $CATEGORY, $items, $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 = defined('CATID') ? listpages(1, CATID, $items, $page, $pagesize, 10, $MOD['linkurl']) : pages($items, $page, $pagesize);
     $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['alt'] = $r['title'];
         $r['title'] = set_style($r['title'], $r['style']);
         $r['linkurl'] = $MOD['linkurl'] . $r['linkurl'];
         $r['parentid'] = $CATEGORY[$r['catid']]['parentid'] ? $CATEGORY[$r['catid']]['parentid'] : $r['catid'];
         $lists[] = $r;
     }
     return $lists;
 }
开发者ID:hcd2008,项目名称:destoon,代码行数:21,代码来源:resume.class.php

示例6: listpages

 function listpages($subpages)
 {
     foreach ($subpages as $subpage) {
         echo '<div class="page"><div class="pagename">';
         echo '<span class="name">' . $subpage->title() . '</span>';
         if ($subpage->num() != "") {
             $number = $subpage->num();
         } else {
             $number = "–";
         }
         echo '<span class="number smallbox">' . $number . '</span>';
         echo '<span class="link smallbox active smalllink" data-link="' . $subpage->uri() . '"><i class="icon fa fa-link"></i></span>';
         if ($subpage->children()->count() > 0) {
             echo '<span class="slidedown active smallbox smalllink"><i class="icon fa fa-angle-down"></i></span>';
         } else {
             echo '<span class="slidedown smallbox smalllink">–</span>';
         }
         echo '</div><div class="subpages d' . $subpage->depth() . '" style="background-color: rgba(0,0,0,' . $subpage->depth() / 25 . ')">';
         if ($subpage->children()->count() > 0) {
             listpages($subpages = $subpage->children());
         }
         echo '</div></div>';
     }
 }
开发者ID:medienbaecker,项目名称:kirby-visual-markdown,代码行数:24,代码来源:modals.php


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