php 分页类函数
function getPageBar($count = 0)
{
$bad_link_color = "#C0C0C0";
$page["url"] = eregi_replace("&page=[^&]+","",basename($_SERVER[SCRIPT_NAME])."?".$_SERVER[QUERY_STRING]);
$page["result_count"] = (string) $count;
$page["this_page"] = (empty($_GET["page"]))?"1":$_GET["page"];
$page["this_page"] = ($page["result_count"] == 0)?"0":$page["this_page"];
$page["page_size"] = $GLOBALS["option"]["page_size"];
$page["page_count"] = (string) ceil($page["result_count"]/$page["page_size"]);
$page["first_page"] = ($page["this_page"] > 1)?"«":"";
$page["rearward_page"] = ($page["this_page"] < (int) $page["page_count"])?"»":"";
$page["prev_page"] = ($page["this_page"] > 1)?"‹":"";
$page["next_page"] = ($page["this_page"] < (int) $page["page_count"])?"›":"";
$page['start_page'] = ((int)$page["this_page"]-5<1)?1:(int)$page["this_page"]-5;
$page['end_page'] = ((int)$page["this_page"]+5 > $page['page_count'])?(int)$page["page_count"]:(int)$page["this_page"]+5;
for ($i = $page['start_page'];$i <= $page['end_page'];$i++)
{
$selected = ($_GET["page"] == $i)?"selected":"";
$page["page_select"] .= "";
$page["page_list"] .= ($i == $page["this_page"])?" $i ":"[$i]";
}
return $page;
}
已抢186483个
抢已抢67261个
抢已抢352943个
抢已抢667113个
抢已抢122158个
抢已抢23277个
抢