[제나플러스] 그누보드에 적용된 포인트 순위
본문
<?
include_once("./_common.php");
$html_title = "포인트순위";
$g4[title] = "" . $html_title;
include_once("./_head.php");
$heart = "<font color=#ff6600><b>♡</b></font>";
?>
<script language="javascript" src="<?=$g4[path]?>/js/sideview.js"></script>
<table width="100%" align=center cellpadding=3 cellspacing=0 border=0>
<tr><td valign=top colspan=2 class=lh>
<?
if ($member[mb_id]) {
$sql = " select count(mb_id) as cnt from $g4[member_table]
where mb_point > '$member[mb_point]' order by mb_point desc ";
$row = sql_fetch($sql);
echo "· 현재 회원님의 포인트는 <B>".number_format($member[mb_point])."점</B> 이며, 순위는 <B>".number_format($row[cnt] + 1)."등</B> 입니다.";
}
$sql = " select sum(mb_point) as sum_point from $g4[member_table]";
$row = sql_fetch($sql);
$sum_point = $row[sum_point];
echo "<br>· 전체 포인트 : <b>".number_format($sum_point) . "점</b><br>";
echo "</td></tr>";
echo "<tr><td colspan=2><table width=100% align=center cellpadding=0 cellspacing=0>";
echo "<tr><td colspan=2 bgcolor='#0A7299' height=2></td></tr>";
echo "<tr><td height=30 width=100 align=center bgcolor='#F2F2F2'>";
echo "<form style='margin:0px;'><font color='#505050'>회원별명</font></td><td> <input type=text name='stx2' id='stx2' value='$stx2' class='ed'> <input type=submit value='검색'> <a href='./cm_point_rank.php'>전체</a></form>";
echo "</td></tr>";
echo "</table><br></td></tr>";
echo "<tr><td valign=top width=50%>";
$where = " (1) ";
if ($stx2)
$where = " mb_nick like '%$stx2%' ";
$sql = " select count(*) as cnt from $g4[member_table] where $where ";
$row = sql_fetch($sql);
$total_count = $row[cnt];
$rows = 50;
$total_page = ceil($total_count / $rows); // 전체 페이지 계산
if ($page == "") { $page = 1; } // 페이지가 없으면 첫 페이지 (1 페이지)
if ($page > 5) $page = 1;
$from_record = ($page - 1) * $rows; // 시작 열을 구함
$mod = 25;
$sql = " select * from $g4[member_table]
where $where
order by mb_point desc, mb_today_login desc
limit $from_record, $rows ";
$result = sql_query($sql);
for ($i=0; $row=sql_fetch_array($result); $i++)
{
if ($i && $i%$mod==0)
echo "</td><td valign=top>";
if ($stx2)
{
$sqlx = " select count(mb_id) as cnt from $g4[member_table] where mb_point > '$row[mb_point]' order by mb_point desc ";
$rowx = sql_fetch($sqlx);
$rank = $rowx['cnt'] + 1;
}
else
$rank = number_format((($page - 1) * $rows) + $i + 1);
$name = get_sideview($row[mb_id], $row[mb_nick], $row[mb_email], $row[mb_homepage]);
$mb_point = $row['mb_point'];
$point = number_format($mb_point);
$p = "{$point}점";
echo "<table width=80% cellpadding=0 align=center class=box border=0><tr>";
echo "<td height=30>$rank. $name</td>";
echo "<td align=right>$p</td>";
echo "<td width=35> </td>";
echo "</tr></table>";
echo "<table width=100%><tr><td></td></tr></table>";
}
?>
</td></tr>
</table>
<?
$page = get_paging($config[cf_write_pages], $page, $total_page, "?$qstr&stx2=$stx2&page=");
include_once("./_tail.php");
?>
포인트님의 댓글
포인트쪽지보내기 메일보내기 홈페이지 자기소개 아이디로 검색 전체게시물 작성일제나홈에있는 포인트 순위소스하고 다른건가요?~~^^