include"./dbconn.inc";
include"./userfunction.inc";
include"photoqa.cfg";
$photoqa ="freeboard";
if(!$page) {
$page = 1;
}
echo"
";
//Àüü°Ô½Ã¹°ÀÇ ÃÑ °³¼ö¸¦ °¢°¢ ±¸ÇÑ´Ù.
if(!eregi("[^[:space:]]+",$key)) {
$query = "SELECT count(uid) FROM $photoqa";
} else {
$encoded_key = urlencode($key);
$query = "SELECT count(uid) FROM $photoqa WHERE $keyfield LIKE '%$key%'";
}
$result = mysql_query($query,$dbconn);
if (!$result) {
error("QUERY_ERROR");
exit;
}
$total_record = mysql_result($result,0,0);
//ÇöÀçÀÇ ÆäÀÌÁö¿¡¼ Ãâ·ÂÇÒ °Ô½Ã¹°ÀÇ ¹üÀ§¸¦ °áÁ¤ÇÑ´Ù.
if(!$total_record) {
$first = 1;
$last = 0;
} else {
$first = $page_per_num*($page-1);
$last = $page_per_num*$page;
$IsNext = $total_record - $last;
if($IsNext > 0) {
$last -= 1;
} else {
$last = $total_record - 1;
}
}
//Àüü ÆäÀÌÁö¼ö¸¦ °è»êÇÑ´Ù.
$total_page = ceil($total_record/$page_per_num);
$total_block = ceil($total_page/ $num_per_block);
$block = ceil($page/ $num_per_block);
$first_page = ($block-1)* $num_per_block;
$last_page = $block* $num_per_block;
if($total_block <= $block) {
$last_page = $total_page;
}
?>
echo"
";
if(!eregi("[^[:space:]]+",$key)) {
echo"
ÃÑ °Ô½Ã¹° : $total_record
( (Total $total_record Articles) ( $page / $total_page )";
} else {
echo"
°Ë»öµÈ °Ô½Ã¹° : $total_record
( (Total $total_record Articles) ( $page / $total_page )";
}
echo"
|
";
if($block > 1) {
$my_page = $first_page;
echo"";
}
else {
echo"";
}
echo "
|
";
for($direct_page = $first_page+1; $direct_page <= $last_page; $direct_page++) {
if($page == $direct_page) {
echo("[ $direct_page]");
} else {
echo("[ [$direct_page]]");
}
}
echo "
|
";
if($block < $total_block) {
$yboard_page = $last_page+1;
echo("");
} else {
echo "";
}
echo "
|
|
|
";
?>
|