當前位置: 首頁>>代碼示例>>PHP>>正文


PHP url_par函數代碼示例

本文整理匯總了PHP中url_par函數的典型用法代碼示例。如果您正苦於以下問題:PHP url_par函數的具體用法?PHP url_par怎麽用?PHP url_par使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了url_par函數的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: pages

/**
 * 分頁函數
 *
 * @param $num 信息總數
 * @param $curr_page 當前分頁
 * @param $perpage 每頁顯示數
 * @param $urlrule URL規則
 * @param $array 需要傳遞的數組,用於增加額外的方法
 * @return 分頁
 */
function pages($num, $curr_page, $perpage = 20, $urlrule = '', $array = array(), $setpages = 10)
{
    if (defined('URLRULE') && $urlrule == '') {
        $urlrule = URLRULE;
        $array = $GLOBALS['URL_ARRAY'];
    } elseif ($urlrule == '') {
        $urlrule = url_par('page={$page}');
    }
    $multipage = '';
    if ($num > $perpage) {
        $page = $setpages + 1;
        $offset = ceil($setpages / 2 - 1);
        $pages = ceil($num / $perpage);
        if (defined('IN_ADMIN') && !defined('PAGES')) {
            define('PAGES', $pages);
        }
        $from = $curr_page - $offset;
        $to = $curr_page + $offset;
        $more = 0;
        if ($page >= $pages) {
            $from = 2;
            $to = $pages - 1;
        } else {
            if ($from <= 1) {
                $to = $page - 1;
                $from = 2;
            } elseif ($to >= $pages) {
                $from = $pages - ($page - 2);
                $to = $pages - 1;
            }
            $more = 1;
        }
        $multipage .= '<a class="a1">' . $num . L('page_item') . '</a>';
        if ($curr_page > 0) {
            $multipage .= ' <a href="' . pageurl($urlrule, $curr_page - 1, $array) . '" class="a1">' . L('previous') . '</a>';
            if ($curr_page == 1) {
                $multipage .= ' <a href="javascript:;" class="current">1</a>';
            } elseif ($curr_page > 6 && $more) {
                $multipage .= ' <a href="' . pageurl($urlrule, 1, $array) . '">1</a>..';
            } else {
                $multipage .= ' <a href="' . pageurl($urlrule, 1, $array) . '">1</a>';
            }
        }
        for ($i = $from; $i <= $to; $i++) {
            if ($i != $curr_page) {
                $multipage .= ' <a href="' . pageurl($urlrule, $i, $array) . '">' . $i . '</a>';
            } else {
                $multipage .= ' <a href="javascript:;" class="current">' . $i . '</a>';
            }
        }
        if ($curr_page < $pages) {
            if ($curr_page < $pages - 5 && $more) {
                $multipage .= ' ..<a href="' . pageurl($urlrule, $pages, $array) . '">' . $pages . '</a> <a href="' . pageurl($urlrule, $curr_page + 1, $array) . '" class="a1">' . L('next') . '</a>';
            } else {
                $multipage .= ' <a href="' . pageurl($urlrule, $pages, $array) . '">' . $pages . '</a> <a href="' . pageurl($urlrule, $curr_page + 1, $array) . '" class="a1">' . L('next') . '</a>';
            }
        } elseif ($curr_page == $pages) {
            $multipage .= ' <a href="javascript:;" class="current">' . $pages . '</a> <a href="' . pageurl($urlrule, $curr_page, $array) . '" class="a1">' . L('next') . '</a>';
        } else {
            $multipage .= ' <a href="' . pageurl($urlrule, $pages, $array) . '">' . $pages . '</a> <a href="' . pageurl($urlrule, $curr_page + 1, $array) . '" class="a1">' . L('next') . '</a>';
        }
    }
    return $multipage;
}
開發者ID:hw18708118867,項目名稱:htmlmoban,代碼行數:74,代碼來源:global.func.php

示例2: pages

/**
 * 分頁函數
 *
 * @param $num 信息總數
 * @param $curr_page 當前分頁
 * @param $perpage 每頁顯示數
 * @param $urlrule URL規則
 * @param $array 需要傳遞的數組,用於增加額外的方法
 * @return 分頁
 */
function pages($num, $curr_page, $perpage = 20, $urlrule = '', $array = array())
{
    if ($urlrule == '') {
        $urlrule = url_par('page={$page}');
    } else {
        $urlrule = url_par('page={$page}', $urlrule);
    }
    $multipage = '';
    if ($num > $perpage) {
        $page = 11;
        $offset = 4;
        $pages = ceil($num / $perpage);
        $from = $curr_page - $offset;
        $to = $curr_page + $offset;
        $more = 0;
        if ($page >= $pages) {
            $from = 2;
            $to = $pages - 1;
        } else {
            if ($from <= 1) {
                $to = $page - 1;
                $from = 2;
            } elseif ($to >= $pages) {
                $from = $pages - ($page - 2);
                $to = $pages - 1;
            }
            $more = 1;
        }
        $multipage .= '總數<b>' . $num . '</b>&nbsp;&nbsp;';
        if ($curr_page > 0) {
            if ($curr_page == 1) {
                $multipage .= ' <a href="' . pageurl($urlrule, 1, $array) . '" class="a1">上一頁</a>';
                $multipage .= ' <span>1</span>';
            } elseif ($curr_page > 6 && $more) {
                $multipage .= ' <a href="' . pageurl($urlrule, $curr_page - 1, $array) . '" class="a1">上一頁</a>';
                $multipage .= ' <a href="' . pageurl($urlrule, 1, $array) . '">1</a>..';
            } else {
                $multipage .= ' <a href="' . pageurl($urlrule, $curr_page - 1, $array) . '" class="a1">上一頁</a>';
                $multipage .= ' <a href="' . pageurl($urlrule, 1, $array) . '">1</a>';
            }
        }
        for ($i = $from; $i <= $to; $i++) {
            if ($i != $curr_page) {
                $multipage .= ' <a href="' . pageurl($urlrule, $i, $array) . '">' . $i . '</a>';
            } else {
                $multipage .= ' <span>' . $i . '</span>';
            }
        }
        if ($curr_page < $pages) {
            if ($curr_page < $pages - 5 && $more) {
                $multipage .= ' ..<a href="' . pageurl($urlrule, $pages, $array) . '">' . $pages . '</a> <a href="' . pageurl($urlrule, $curr_page + 1, $array) . '" class="a1">下一頁</a>';
            } else {
                $multipage .= ' <a href="' . pageurl($urlrule, $pages, $array) . '">' . $pages . '</a> <a href="' . pageurl($urlrule, $curr_page + 1, $array) . '" class="a1">下一頁</a>';
            }
        } elseif ($curr_page == $pages) {
            $multipage .= ' <span>' . $pages . '</span> <a href="' . pageurl($urlrule, $curr_page, $array) . '" class="a1">下一頁</a>';
        } else {
            $multipage .= ' <a href="' . pageurl($urlrule, $pages, $array) . '">' . $pages . '</a> <a href="' . pageurl($urlrule, $curr_page + 1, $array) . '" class="a1">下一頁</a>';
        }
    }
    return $multipage;
}
開發者ID:spwx820,項目名稱:lock-money-admin_cp,代碼行數:72,代碼來源:functions.php

示例3: L

		<th width="20%"><?php 
echo L('filename');
?>
        <div class="tab-use">
        	<div style="position:relative">
        	<div class="arrows cu" onmouseover="hoverUse('use-div');" onmouseout="hoverUse();" onmouseover="this.style.display='block'"></div>
            <ul id="use-div" class="tab-web-panel" onmouseover="this.style.display='block'"  onmouseout="hoverUse('use-div');">
                <li><a href="<?php 
echo url_par('dosubmit=1&status=0');
?>
"><?php 
echo L('not_used');
?>
</a></li>
                <li><a href="<?php 
echo url_par('dosubmit=1&status=1');
?>
"><?php 
echo L('used');
?>
</a></li>
            </ul>
            </div>
        </div></th>
		<th width="10%" ><?php 
echo L('filesize');
?>
</th>
		<th width="20%" ><?php 
echo L('uploadtime');
?>
開發者ID:boylzj,項目名稱:omguitar,代碼行數:31,代碼來源:attachment_list.tpl.php

示例4: pages

 /**
  * Funtion pages
  * 視頻分頁
  * @param int $number 總頁數 
  * @param int $page 當前頁
  * @param int $pagesize 每頁數量
  * @param string $js JS屬性
  */
 private function pages($num, $curr_page, $perpage = 20, $setpages = 5, $js = '')
 {
     $urlrule = url_par('page={$page}');
     $multipage = '';
     if ($num > $perpage) {
         $page = $setpages + 1;
         $offset = ceil($setpages / 2 - 1);
         $pages = ceil($num / $perpage);
         if (defined('IN_ADMIN') && !defined('PAGES')) {
             define('PAGES', $pages);
         }
         $from = $curr_page - $offset;
         $to = $curr_page + $offset;
         $more = 0;
         if ($page >= $pages) {
             $from = 2;
             $to = $pages - 1;
         } else {
             if ($from <= 1) {
                 $to = $page - 1;
                 $from = 2;
             } elseif ($to >= $pages) {
                 $from = $pages - ($page - 2);
                 $to = $pages - 1;
             }
             $more = 1;
         }
         $multipage .= '<a class="a1">' . $num . L('page_item') . '</a>';
         if ($curr_page > 0) {
             $multipage .= ' <a href="javascript:void(0);" onclick="' . $js . '(' . intval($curr_page - 1) . ')" class="a1">' . L('previous') . '</a>';
             if ($curr_page == 1) {
                 $multipage .= ' <span>1</span>';
             } elseif ($curr_page > 3 && $more) {
                 $multipage .= ' <a href="javascript:void(0);" onclick="' . $js . '(1)">1</a>..';
             } else {
                 $multipage .= ' <a href="javascript:void(0);" onclick="' . $js . '(1)">1</a>';
             }
         }
         for ($i = $from; $i <= $to; $i++) {
             if ($i != $curr_page) {
                 $multipage .= ' <a href="javascript:void(0);" onclick="' . $js . '(' . $i . ')">' . $i . '</a>';
             } else {
                 $multipage .= ' <span>' . $i . '</span>';
             }
         }
         if ($curr_page < $pages) {
             if ($curr_page < $pages - 2 && $more) {
                 $multipage .= ' ..<a href="javascript:void(0);" onclick="' . $js . '(' . $pages . ')">' . $pages . '</a> <a href="javascript:void(0);" onclick="' . $js . '(' . intval($curr_page + 1) . ')" class="a1">' . L('next') . '</a>';
             } else {
                 $multipage .= ' <a href="javascript:void(0);" onclick="' . $js . '(' . $pages . ')">' . $pages . '</a> <a href="javascript:void(0);" onclick="' . $js . '(' . intval($curr_page + 1) . ')" class="a1">' . L('next') . '</a>';
             }
         } elseif ($curr_page == $pages) {
             $multipage .= ' <span>' . $pages . '</span> <a href="javascript:void(0);" onclick="' . $js . '(' . $curr_page . ')" class="a1">' . L('next') . '</a>';
         } else {
             $multipage .= ' <a href="javascript:void(0);" onclick="' . $js . '(' . $pages . ')">' . $pages . '</a> <a href="javascript:void(0);" onclick="' . $js . '(' . intval($curr_page + 1) . ')" class="a1">' . L('next') . '</a>';
         }
     }
     return $multipage;
 }
開發者ID:shenhua4286,項目名稱:gxw,代碼行數:67,代碼來源:video_for_ck.php

示例5: wpa_pages

/**
 * 分頁函數
 * 
 * @param $num 信息總數
 * @param $curr_page 當前分頁
 * @param $perpage 每頁顯示數
 * @param $urlrule URL規則
 * @param $array 需要傳遞的數組,用於增加額外的方法
 * @return 分頁
 */
function wpa_pages($num, $curr_page, $perpage = 20, $urlrule = '', $array = array(), $setpages = 10)
{
    if (defined('URLRULE')) {
        $urlrule = URLRULE;
        $array = $GLOBALS['URL_ARRAY'];
    } elseif ($urlrule == '') {
        $urlrule = url_par('page={$page}');
    }
    $multipage = '';
    if ($num > $perpage) {
        $page = $setpages + 1;
        $offset = ceil($setpages / 2 - 1);
        $pages = ceil($num / $perpage);
        if (defined('IN_ADMIN') && !defined('PAGES')) {
            define('PAGES', $pages);
        }
        $from = $curr_page - $offset;
        $to = $curr_page + $offset;
        $more = 0;
        if ($page >= $pages) {
            $from = 2;
            $to = $pages - 1;
        } else {
            if ($from <= 1) {
                $to = $page - 1;
                $from = 2;
            } elseif ($to >= $pages) {
                $from = $pages - ($page - 2);
                $to = $pages - 1;
            }
            $more = 1;
        }
        $multipage .= $curr_page . '/' . $pages;
        if ($curr_page > 0) {
            $multipage .= ' <a href="' . pageurl($urlrule, $curr_page - 1, $array) . '">' . L('previous') . '</a>';
        }
        if ($curr_page == $pages) {
            $multipage .= ' <a href="' . pageurl($urlrule, $curr_page, $array) . '">' . L('next') . '</a>';
        } else {
            $multipage .= ' <a href="' . pageurl($urlrule, $curr_page + 1, $array) . '">' . L('next') . '</a>';
        }
    }
    return $multipage;
}
開發者ID:ahmatjan,項目名稱:huluphp,代碼行數:54,代碼來源:global.func.php

示例6: foreach

                    <?php foreach ($modules as $module) {
                    	if(in_array($module['module'], array('pay','digg','search','scan','attachment','block','dbsource','template','release','cnzz','comment','mood'))) continue;
                        echo '<li><a href='.url_par('dosubmit=1&module='.$module['module']).'>'.$module['name'].'</a></li>';
                    }?>
                </ul>
            </div>
        </div>		
		</th>
		<th width="8%" ><?php echo L('catname')?></th>
		<th width="20%"><?php echo L('filename')?>
        <div class="tab-use">
        	<div style="position:relative">
        	<div class="arrows cu" onmouseover="hoverUse('use-div');" onmouseout="hoverUse();" onmouseover="this.style.display='block'"></div>
            <ul id="use-div" class="tab-web-panel" onmouseover="this.style.display='block'"  onmouseout="hoverUse('use-div');">
                <li><a href="<?php echo url_par('dosubmit=1&status=0')?>"><?php echo L('not_used')?></a></li>
                <li><a href="<?php echo url_par('dosubmit=1&status=1')?>"><?php echo L('used')?></a></li>
            </ul>
            </div>
        </div></th>
		<th width="10%" ><?php echo L('filesize')?></th>
		<th width="20%" ><?php echo L('uploadtime')?></th>
		<th width="15%" ><?php echo L('operations_manage')?></th>
		</tr>
        </thead>
        
    <tbody>
<?php 
if(is_array($infos)){
	foreach($infos as $info){
		$thumb = glob(dirname($this->upload_path.$info['filepath']).'/thumb_*'.basename($info['filepath']));
?>
開發者ID:panhongsheng,項目名稱:zl_cms,代碼行數:31,代碼來源:attachment_list.tpl.php

示例7: video_makeurlrule

function video_makeurlrule()
{
    $setting = getcache('video', 'video');
    if ($setting['enable_rewrite'] == 0) {
        return url_par('page={$' . 'page}');
    } else {
        $url = preg_replace('/-[0-9]+.html$/', '-{$page}.html', get_url());
        return $url;
    }
}
開發者ID:ahmatjan,項目名稱:huluphp,代碼行數:10,代碼來源:video.func.php

示例8: makeurlrule

function makeurlrule()
{
    if (strpos(URLRULE, '.html') === FALSE) {
        return url_par('page={$' . 'page}');
    } else {
        $url = preg_replace('/-[0-9]+.html$/', '-{$page}.html', get_url());
        return $url;
    }
}
開發者ID:zhouzhouxs,項目名稱:Progect,代碼行數:9,代碼來源:info.func.php


注:本文中的url_par函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。