PHP page-Class functions
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)? " <a href= "". $page [url]. " &page=1 "title=" Home "><span style=" FONT-SIZE:12PX; Font-weight:bold; Font-familly:courier; " >«</span></a> "": "";
$page ["rearward_page"] = ($page ["This_page"] < (int) $page ["Page_count"])? " <a href= "". $page [url]. " &page= ". $page [" Page_count "]." title= "last" ><span style= "FONT-SIZE:12PX; Font-weight:bold; Font-familly:courier; " >»</span></a> "": "";
$page ["prev_page"] = ($page ["This_page"] > 1)? " <a href= "". $page [url]. " &page= ". ((int) $page ["This_page"]-1). "" title= "Previous page" ><span style= "FONT-SIZE:12PX; Font-weight:bold; Font-familly:courier; " >& #8249;</span></a> ":" ";
$page ["next_page"] = ($page ["This_page"] < (int) $page ["Page_count"])? " <a href= "". $page [url]. " &page= ". ((int) $page ["This_page"] + 1). "" title= "Next page" ><span style= "FONT-SIZE:12PX; Font-weight:bold; Font-familly:courier; " >& #8250;</span></a> ":" ";
$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"] . = "<option value=" $i "$selected > $i </option> ";
$page ["page_list"] . = ($i = = $page ["This_page"])? "<font Color= "Red" > $i </font> ":" <a href= "". $page [' url ']. " &page= $i "title=", $i. "Page" >[$i]</a> ";
}
return $page;
}