当前位置: 首页>>代码示例>>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;未经允许,请勿转载。