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"] »":"";
$page["prev_page"] = ($page["this_page"] > 1)?"‹":"";
$page["next_page"] = ($page["this_page"] ›":"";
$page['start_page'] = ((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
{
$selected = ($_GET["page"] == $i)?"selected":"";
$page["page_select"] .= "";
$page["page_list"] .= ($i == $page["this_page"])?" $i ":"[$i]";
}
return $page;
}