테스트 사이트 - 개발 중인 베타 버전입니다

포인트랭킹적용소스좀...

· 13년 전 · 1205
<?
include_once("_common.php");
include_once("$g4[path]/lib/mw.builder.lib.php");

$sql_common = " from $g4[member_table] ";
$sql_where = " where mb_id <> '$config[cf_admin]' and mb_level > 1 and mb_leave_date = '' and mb_intercept_date = '' ";
$sql_order = " order by mb_point desc";

$sql = "select sum(mb_point) as total_point
$sql_common
$sql_where";
$row = sql_fetch($sql);
$total_point = number_format($row[total_point]);

$sql = "select count(*) as cnt
$sql_common
$sql_where
and mb_point > '$member[mb_point]'";
$row = sql_fetch($sql);
$my_rank = $row[cnt] + 1;

$sql = "select count(*) as cnt
$sql_common
$sql_where";
$row = sql_fetch($sql);
$total_count = $row[cnt];

$page = "";

$rows = 100;
$total_page = ceil($total_count / $rows); // 전체 페이지 계산
if (!$page) $page = 1; // 페이지가 없으면 첫 페이지 (1 페이지)
$from_record = ($page - 1) * $rows; // 시작 열을 구함

$sql = "select mb_id, mb_name, mb_nick, mb_email, mb_homepage, mb_point
$sql_common
$sql_where
$sql_order
limit $from_record, $rows";
$qry = sql_query($sql);

$list = array();
for ($i=0; $row=sql_fetch_array($qry); $i++) {
$list[$i][rank] = number_format((($page - 1) * $rows) + $i + 1);
$list[$i][name] = get_sideview($row[mb_id], $row[mb_nick], $row[mb_email]. $row[mb_homepage]);
$list[$i][point] = number_format($row[mb_point]);
}

$list_count = sizeof($list);

//$paging = get_paging($rows, $page, $total_page, "?page=");

$g4[title] = "포인트 순위";
include_once("_head.php");
?>

<script type="text/javascript" src="<?=$g4[path]?>/js/sideview.js"></script>

<style type="text/css">
.info { height:25px; margin:0 0 0 10px; font-size:13px; }
.line { border-top:1px solid #ddd; margin:10px 0 10px 0; }
.point-ranking { }
.point-ranking .head { font-weight:bold; text-align:center; height:30px }
.point-ranking .body { height:30px; padding:0; }
.point-ranking .body .rank { width:50px; text-align:right; }
.point-ranking .body .name { width:150px; text-align:left; padding-left:5px; }
.point-ranking .body .point { width:100px; text-align:right; }
.paging { clear:both; height:50px; text-align:center; margin:30px 0 0 0; }
</style>

<?
if ($is_member) {
echo "<div class='info'>· 현재 회원님의 포인트는 <strong>".number_format($member[mb_point])."</strong>점 이며, 순위는 <strong>{$my_rank}</strong>등 입니다.</div>";
echo "<div class='info'>· 전체 포인트 : <strong>{$total_point}</strong>점</div>";
}
?>

<div class="line"></div>

<table width=100% border=0 cellpadding=0 cellspacing=0>
<tr>
<td width="50%" valign="top">
<table border=0 cellpadding=0 cellspacing=0 class="point-ranking">
<? for ($i=0; $i<$rows/2 && $i<$list_count; $i++) { ?>
<tr>
<td class="body"> <div class="rank"><?=$list[$i][rank]?>.</div> </td>
<td class="body"> <div class="name"><?=$list[$i][name]?></div> </td>
<td class="body"> <div class="point"><?=$list[$i][point]?> 점</div> </td>
</tr>
<? } ?>
</table>
</td>
<td width="50%" valign="top">
<table border=0 cellpadding=0 cellspacing=0 class="point-ranking">
<? for ($i=$rows/2; $i<$list_count; $i++) { ?>
<tr>
<td class="body"> <div class="rank"><?=$list[$i][rank]?>.</div> </td>
<td class="body"> <div class="name"><?=$list[$i][name]?></div> </td>
<td class="body"> <div class="point"><?=$list[$i][point]?> 점</div> </td>
</tr>
<? } ?>
</table>
</td>
</tr>
</table>

<div class="line"></div>

<div class="paging"><?=$paging?></div>

<?
include_once("_tail.php");
?>

상위소스는 포인트랭킹소스입니다...
상위소스에 하단의 소스를 이용하여 업로더 포인트적립 순위로 바꾸고 싶은데...
어떻게 적용해야할지 ㅠㅠ
고수님들 부탁드립니다...



if ($mw_basic[cf_uploader_point]) { // 업로더 포인트 제공
$wr_name = $board[bo_use_name] ? $member[mb_name] : $member[mb_nick];
$eval = 'insert_point($write[mb_id], $mw_basic[cf_uploader_point], "{$wr_name}님이 $board[bo_subject] $wr_id 파일 다운 적립", $bo_table, $wr_id, "$member[mb_id] 다운로드");';

댓글 작성

댓글을 작성하시려면 로그인이 필요합니다.

로그인하기

게시글 목록

번호 제목
284508
284499
284492
284490
284484
284481
284478
284476
284474
284472
284470
284458
284457
284454
284453
284447
284446
284444
284441
284440