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


PHP P2Util::getListNaviRange方法代码示例

本文整理汇总了PHP中P2Util::getListNaviRange方法的典型用法代码示例。如果您正苦于以下问题:PHP P2Util::getListNaviRange方法的具体用法?PHP P2Util::getListNaviRange怎么用?PHP P2Util::getListNaviRange使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在P2Util的用法示例。


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

示例1: foreach

if ($_conf['ktai']) {
    // {{{ 倉庫にtorder付与
    if ($aThreadList->spmode == "soko") {
        if ($aThreadList->threads) {
            $soko_torder = 1;
            foreach ($aThreadList->threads as $at) {
                $at->torder = $soko_torder++;
            }
        }
    }
    // }}}
    // {{{ 表示数制限
    // 念のため、補正しておく
    $aThreadList->num = count($aThreadList->threads);
    $sb_disp_all_num = $aThreadList->num;
    $disp_navi = P2Util::getListNaviRange($sb_disp_from, $_conf['mobile.sb_disp_range'], $sb_disp_all_num);
    if ($aThreadList->threads) {
        $aThreadList->threads = array_slice($aThreadList->threads, $disp_navi['offset'], $disp_navi['limit']);
    }
    $aThreadList->num = sizeof($aThreadList->threads);
    // }}}
    include P2_LIB_DIR . '/sb_print_k.inc.php';
    if ($_conf['iphone']) {
        include P2_LIB_DIR . '/toolbar_i.inc.php';
        include P2_LIB_DIR . '/sb_header_i.inc.php';
        sb_print_k($aThreadList);
        include P2_LIB_DIR . '/sb_footer_i.inc.php';
    } else {
        include P2_LIB_DIR . '/sb_header_k.inc.php';
        sb_print_k($aThreadList);
        include P2_LIB_DIR . '/sb_footer_k.inc.php';
开发者ID:xingskycn,项目名称:p2-php,代码行数:31,代码来源:subject.php

示例2: printItaSearch

    /**
     * 板名を検索してHTML表示する for 携帯
     *
     * @access  public
     * @return  void
     */
    function printItaSearch($categories)
    {
        global $_conf;
        global $list_navi_ht;
        if (!$categories) {
            return;
        }
        // {{{ 表示数制限
        $list_disp_from = empty($_GET['from']) ? 1 : intval($_GET['from']);
        $list_disp_all_num = $GLOBALS['ita_mikke']['num'];
        //
        $disp_navi = P2Util::getListNaviRange($list_disp_from, $_conf['k_sb_disp_range'], $list_disp_all_num);
        $detect_hint_q = 'detect_hint=' . urlencode('◎◇');
        $word_q = '&word=' . rawurlencode($GLOBALS['word']);
        if ($disp_navi['from'] > 1) {
            $mae_ht = <<<EOP
<a href="{$_conf['menu_k_php']}?w{$detect_hint_q}{$word_q}&amp;from={$disp_navi['mae_from']}&amp;nr=1{$_conf['k_at_a']}">前</a>
EOP;
        } else {
            $mae_ht = '';
        }
        if ($disp_navi['end'] < $list_disp_all_num) {
            $tugi_ht = <<<EOP
<a href="{$_conf['menu_k_php']}?{$detect_hint_q}{$word_q}&amp;from={$disp_navi['tugi_from']}&amp;nr=1{$_conf['k_at_a']}">次</a>
EOP;
        } else {
            $tugi_ht = '';
        }
        if (!$disp_navi['all_once']) {
            $list_navi_ht = <<<EOP
{$disp_navi['range_st']}{$mae_ht} {$tugi_ht}<br>
EOP;
        } else {
            $list_navi_ht = '';
        }
        // }}}
        if (UA::isIPhoneGroup()) {
            ?>
<ul><?php 
        }
        foreach ($categories as $cate) {
            if ($cate->num > 0) {
                $t = false;
                foreach ($cate->menuitas as $mita) {
                    $GLOBALS['menu_show_ita_num']++;
                    if ($GLOBALS['menu_show_ita_num'] >= $disp_navi['from'] and $GLOBALS['menu_show_ita_num'] <= $disp_navi['end']) {
                        if (!$t) {
                            echo "<b>{$cate->name}</b><br>\n";
                        }
                        $t = true;
                        $uri = UriUtil::buildQueryUri($_conf['subject_php'], array('host' => $mita->host, 'bbs' => $mita->bbs, 'itaj_en' => $mita->itaj_en, UA::getQueryKey() => UA::getQueryValue()));
                        $atag = P2View::tagA($uri, $mita->itaj_ht);
                        if (UA::isIPhoneGroup()) {
                            echo "<li>{$atag}</li>\n";
                        } else {
                            echo '&nbsp;' . $atag . "<br>\n";
                        }
                    }
                }
            }
            $this->cate_id++;
        }
        if (UA::isIPhoneGroup()) {
            ?>
</ul><?php 
        }
    }
开发者ID:poppen,项目名称:p2,代码行数:73,代码来源:ShowBrdMenuK.php

示例3: printItaSearch

    /**
     * 板名を検索してプリントする for 携帯
     */
    public function printItaSearch(array $categories)
    {
        global $_conf, $word;
        global $list_navi_ht;
        if ($categories) {
            // {{{ 表示数制限
            if ($_GET['from']) {
                $list_disp_from = $_GET['from'];
            } else {
                $list_disp_from = 1;
            }
            $list_disp_all_num = $GLOBALS['ita_mikke']['num'];
            //
            $disp_navi = P2Util::getListNaviRange($list_disp_from, $_conf['mobile.sb_disp_range'], $list_disp_all_num);
            $word_en = rawurlencode($word);
            if ($disp_navi['from'] > 1) {
                $mae_ht = <<<EOP
<a href="menu_k.php?word={$word_en}&amp;from={$disp_navi['mae_from']}&amp;nr=1&amp;{$_conf['detect_hint_q']}{$_conf['k_at_a']}">前</a>
EOP;
            }
            if ($disp_navi['end'] < $list_disp_all_num) {
                $tugi_ht = <<<EOP
<a href="menu_k.php?word={$word_en}&amp;from={$disp_navi['tugi_from']}&amp;nr=1&amp;{$_conf['detect_hint_q']}{$_conf['k_at_a']}">次</a>
EOP;
            }
            if (!$disp_navi['all_once']) {
                $list_navi_ht = "{$disp_navi['range_st']} {$mae_ht} {$tugi_ht}<br>";
            }
            // }}}
            $i = 0;
            foreach ($categories as $cate) {
                if ($cate->num > 0) {
                    $t = false;
                    foreach ($cate->menuitas as $mita) {
                        $GLOBALS['menu_show_ita_num']++;
                        if ($GLOBALS['menu_show_ita_num'] >= $disp_navi['from'] and $GLOBALS['menu_show_ita_num'] <= $disp_navi['end']) {
                            if (!$t) {
                                echo "<b>{$cate->name}</b><br>\n";
                            }
                            $t = true;
                            echo " <a href=\"{$_conf['subject_php']}?host={$mita->host}&amp;bbs={$mita->bbs}&amp;itaj_en={$mita->itaj_en}{$_conf['k_at_a']}\">{$mita->itaj_ht}</a><br>\n";
                        }
                    }
                }
                $this->_cate_id++;
            }
        }
    }
开发者ID:xingskycn,项目名称:p2-php,代码行数:51,代码来源:ShowBrdMenuK.php

示例4: printItaSearch

    /**
     * 板名を検索してHTML表示する for 携帯
     *
     * @access  public
     * @return  void
     */
    function printItaSearch($categories)
    {
        global $_conf;
        global $list_navi_ht;
        if (!$categories) {
            return;
        }
        // {{{ 表示数制限
        $list_disp_from = empty($_GET['from']) ? 1 : $_GET['from'];
        $list_disp_all_num = $GLOBALS['ita_mikke']['num'];
        //
        $disp_navi = P2Util::getListNaviRange($list_disp_from, $_conf['k_sb_disp_range'], $list_disp_all_num);
        $detect_hint_q = 'detect_hint=' . urlencode('◎◇');
        $word_q = '&amp;word=' . rawurlencode($_REQUEST['word']);
        if ($disp_navi['from'] > 1) {
            $mae_ht = <<<EOP
<span class="mae"><a href="menu_i.php?w{$detect_hint_q}{$word_q}&amp;from={$disp_navi['mae_from']}&amp;nr=1{$_conf['k_at_a']}">前</a> </span>
EOP;
        } else {
            $mae_ht = '';
        }
        if ($disp_navi['end'] < $list_disp_all_num) {
            $tugi_ht = <<<EOP
<span class="tugi"><a href="menu_i.php?{$detect_hint_q}{$word_q}&amp;from={$disp_navi['tugi_from']}&amp;nr=1{$_conf['k_at_a']}">次</a> </span>
EOP;
        } else {
            $tugi_ht = '';
        }
        if (!$disp_navi['all_once']) {
            //{$disp_navi['range_st']} iphone
            $list_navi_ht = <<<EOP
<div class="foot_sure" id="foot">
{$mae_ht}
{$tugi_ht}
</div>
EOP;
        } else {
            $list_navi_ht = '';
        }
        // }}}
        echo '<ul>';
        $i = 0;
        foreach ($categories as $cate) {
            if ($cate->num > 0) {
                $t = false;
                foreach ($cate->menuitas as $mita) {
                    $GLOBALS['menu_show_ita_num']++;
                    if ($GLOBALS['menu_show_ita_num'] >= $disp_navi['from'] and $GLOBALS['menu_show_ita_num'] <= $disp_navi['end']) {
                        if (!$t) {
                            echo "<li class=\"group\">{$cate->name}</li>\n";
                        }
                        $t = true;
                        echo "<li><a href=\"{$_conf['subject_php']}?host={$mita->host}&amp;bbs={$mita->bbs}&amp;itaj_en={$mita->itaj_en}{$_conf['k_at_a']}\">{$mita->itaj_ht}</a></li>\n";
                    }
                }
            }
            $this->cate_id++;
        }
        echo '</ul>';
    }
开发者ID:68,项目名称:rep2iphone,代码行数:66,代码来源:showbrdmenuk.class.php

示例5: showNaviK

 /**
  * 携帯用ナビをHTML表示する
  * 表示範囲($this->resrange)もセットされる
  *
  * @access  public
  * @param   string  $position  表示箇所識別名 'footer', 'header'
  * @param   integer $totalNum  アイテム総数
  * @return  void
  */
 function showNaviK($position, $totalNum)
 {
     global $_conf;
     // 表示数制限
     $list_disp_all_num = $totalNum;
     $list_disp_range = $_conf['k_rnum_range'];
     $from = isset($_GET['from']) ? intval($_GET['from']) : null;
     $end = isset($_GET['end']) ? intval($_GET['end']) : null;
     if (!empty($from)) {
         $list_disp_from = $from;
         if (!empty($end)) {
             $list_disp_range = max(1, $end - $list_disp_from + 1);
         }
     } else {
         $list_disp_from = 1;
     }
     $disp_navi = P2Util::getListNaviRange($list_disp_from, $list_disp_range, $list_disp_all_num);
     $this->resrange['start'] = $disp_navi['from'];
     $this->resrange['to'] = $disp_navi['end'];
     $this->resrange['nofirst'] = false;
     $mae_ht = '';
     if ($disp_navi['from'] > 1) {
         if ($position == 'footer') {
             $attrs = array($_conf['accesskey_for_k'] => $_conf['k_accesskey']['prev']);
             $str = "{$_conf['k_accesskey']['prev']}.前";
         } else {
             $attrs = array();
             $str = "前";
         }
         $atag = P2View::tagA(UriUtil::buildQueryUri('read_res_hist.php', array('from' => $disp_navi['mae_from'], UA::getQueryKey() => UA::getQueryValue())), hs($str), $attrs);
         $mae_ht = " {$atag} ";
     }
     $tugi_ht = '';
     if ($disp_navi['end'] < $list_disp_all_num) {
         if ($position == 'footer') {
             $attrs = array($_conf['accesskey_for_k'] => $_conf['k_accesskey']['next']);
             $str = "{$_conf['k_accesskey']['next']}.次";
         } else {
             $attrs = array();
             $str = "次";
         }
         $atag = P2View::tagA(UriUtil::buildQueryUri('read_res_hist.php', array('from' => $disp_navi['tugi_from'], UA::getQueryKey() => UA::getQueryValue())), hs($str), $attrs);
         $tugi_ht = " {$atag} ";
     }
     if (!$disp_navi['all_once']) {
         $list_navi_ht = " {$disp_navi['range_st']}{$mae_ht} {$tugi_ht} ";
     }
     echo $list_navi_ht;
 }
开发者ID:poppen,项目名称:p2,代码行数:58,代码来源:res_hist.class.php

示例6: showNaviK

    /**
     * 携帯用ナビを表示する
     * 表示範囲もセットされる
     */
    public function showNaviK($position)
    {
        global $_conf;
        // 表示数制限
        $list_disp_all_num = $this->num;
        $list_disp_range = $_conf['mobile.rnum_range'];
        if ($_GET['from']) {
            $list_disp_from = $_GET['from'];
            if ($_GET['end']) {
                $list_disp_range = $_GET['end'] - $list_disp_from + 1;
                if ($list_disp_range < 1) {
                    $list_disp_range = 1;
                }
            }
        } else {
            $list_disp_from = 1;
            /*
            $list_disp_from = $this->num - $list_disp_range + 1;
            if ($list_disp_from < 1) {
                $list_disp_from = 1;
            }
            */
        }
        $disp_navi = P2Util::getListNaviRange($list_disp_from, $list_disp_range, $list_disp_all_num);
        $this->resrange['start'] = $disp_navi['from'];
        $this->resrange['to'] = $disp_navi['end'];
        $this->resrange['nofirst'] = false;
        if ($disp_navi['from'] > 1) {
            if ($position == 'footer') {
                $mae_ht = <<<EOP
<a href="read_res_hist.php?from={$disp_navi['mae_from']}{$_conf['k_at_a']}"{$_conf['k_accesskey_at']['prev']}>{$_conf['k_accesskey_st']['prev']}前</a>
EOP;
            } else {
                $mae_ht = <<<EOP
<a href="read_res_hist.php?from={$disp_navi['mae_from']}{$_conf['k_at_a']}">前</a>
EOP;
            }
        }
        if ($disp_navi['end'] < $list_disp_all_num) {
            if ($position == 'footer') {
                $tugi_ht = <<<EOP
<a href="read_res_hist.php?from={$disp_navi['tugi_from']}{$_conf['k_at_a']}"{$_conf['k_accesskey_at']['next']}>{$_conf['k_accesskey_st']['next']}次</a>
EOP;
            } else {
                $tugi_ht = <<<EOP
<a href="read_res_hist.php?from={$disp_navi['tugi_from']}{$_conf['k_at_a']}">次</a>
EOP;
            }
        }
        if (!$disp_navi['all_once']) {
            echo "<div class=\"navi\">{$disp_navi['range_st']} {$mae_ht} {$tugi_ht}</div>\n";
        }
    }
开发者ID:xingskycn,项目名称:p2-php,代码行数:57,代码来源:ResHist.php


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