그누보드 [G5] 이번달 포인트 순위 보이기
페이지 정보
본문
1. 전체 포인트 Top10
<table style="width:100%;">
<tr>
<td style="text-align:center; background-color:#39F; font-size:1.2em; font-weight:bold; color:#fff; line-height:30px; padding:3px 0;" colspan="3">전체 포인트 Top10</td>
</tr>
<?php
$sql_rank = "SELECT DISTINCT t1.mb_id, t1.mb_point, t1.mb_nick, COUNT(t1.mb_id) AS ranking
FROM {$g5['member_table']} t1, {$g5['member_table']} t2
WHERE (t1.mb_point < t2.mb_point OR t1.mb_id = t2.mb_id) and t1.mb_level<10
GROUP BY t1.mb_id ORDER BY ranking LIMIT 0 , 10
";
//echo $sql_rank;
$result_rank = sql_query($sql_rank);
for($i=1; $row_rank = sql_fetch_array($result_rank); $i++){
$rank_member = sql_fetch("select mb_id, mb_nick, mb_email, mb_homepage from {$g5['member_table']} where mb_id = '".$row_rank['mb_id']."'");
$rank_sideview= get_sideview($tmp_member['mb_id'], cut_str($tmp_member['mb_nick'], $config['cf_cut_name']), $tmp_member['mb_email'], $tmp_member['mb_homepage']);
?>
<tr style="border-bottom:1px dotted #CCC;">
<td style="width:70px; text-align:center; line-height:25px;"><?php echo $i; ?></td>
<td><?php echo $rank_sideview; ?></td>
<td style="text-align:right; padding-right:20px;"><?php echo number_format($row_rank['mb_point']); ?></td>
</tr>
<?php
}
?>
</table>
2. 이번달의 포인트 Top 10
<table width="100%">
<?php
$rank_nowdate = date("Y-m",time()); // 이번달
$rank_sql = "select * , count(B.mb_id) as count, sum(B.po_point) as point from {$g5['member_table']} as A
left join {$g5['point_table']} as B
on (A.mb_id = B.mb_id and A.mb_level < 10 and A.mb_point >= 0)
where date_format(B.po_datetime,'%Y-%m') = '{$rank_nowdate}'
group by B.mb_id order by point desc LIMIT 0, 10
";
$rank_result = sql_query($rank_sql);
//echo $rank_sql;
?>
<tr>
<td colspan="3" style="text-align:center; background-color:#39F; font-size:1.2em; font-weight:bold; color:#fff; line-height:30px; padding:3px 0;">
포인트 순위
<span style="font-size:0.9em;">(<?php echo substr($rank_nowdate, 0, 4)."년"; ?> <?php echo substr($rank_nowdate,5,2)."월"; ?>)</span>
</td>
</tr>
<?php
for ($i=1; $rank_row=sql_fetch_array($rank_result); $i++)
{
$rank_member = sql_fetch("select mb_id, mb_nick, mb_email, mb_homepage from {$g5['member_table']} where mb_id = '".$row_rank['mb_id']."'");
$rank_sideview = get_sideview($tmp_member['mb_id'], cut_str($tmp_member['mb_nick'], $config['cf_cut_name']), $tmp_member['mb_email'], $tmp_member['mb_homepage']);
?>
<tr style="border-bottom:1px dotted #CCC;">
<td style="width:70px; text-align:center; line-height:26px;"><?php echo $i; ?></td>
<td><?php echo $rank_sideview; ?></td>
<td style="text-align:right; padding-right:20px;"><?php echo number_format($rank_row['mb_point']); ?></td>
</tr>
<?php
}
?>
</table>
3. 전체 포인트 Top10 ( 아미나빌더 )
<table style="width:100%;">
<tr>
<td style="text-align:center; background-color:#39F; font-size:1.2em; font-weight:bold; color:#fff; line-height:30px; padding:3px 0;" colspan="3">전체 포인트 Top10</td>
</tr>
<?php
$sql_rank = "SELECT DISTINCT t1.mb_id, t1.mb_point, t1.mb_nick, COUNT(t1.mb_id) AS ranking
FROM {$g5['member_table']} t1, {$g5['member_table']} t2
WHERE (t1.mb_point < t2.mb_point OR t1.mb_id = t2.mb_id) and t1.mb_level<10
GROUP BY t1.mb_id ORDER BY ranking LIMIT 0 , 10
";
//echo $sql_rank;
$result_rank = sql_query($sql_rank);
for($i=1; $row_rank = sql_fetch_array($result_rank); $i++){
$rank_member = sql_fetch("select mb_id, mb_nick, mb_email, mb_homepage, as_level from {$g5['member_table']} where mb_id = '".$row_rank['mb_id']."'");
$rank_sideview = get_sideview($rank_member['mb_id'], cut_str($rank_member['mb_nick'], $config['cf_cut_name']), $rank_member['mb_email'], $rank_member['mb_homepage']);
?>
<tr style="border-bottom:1px dotted #CCC;">
<td style="width:70px; text-align:center; line-height:25px;"><?php echo $i; ?></td>
<td>
<img src="<?php echo xp_icon($rank_member['mb_id'], $rank_member['as_level'], 'zb4');?>">
<?php echo $rank_sideview; ?>
</td>
<td style="text-align:right; padding-right:20px;"><?php echo number_format($row_rank['mb_point']); ?></td>
</tr>
<?php
}
?>
</table>
4. 이번달의 포인트 Top 10 ( 아미나빌더 )
<table width="100%">
<?php
$rank_nowdate = date("Y-m",time()); // 이번달
$rank_sql = "select * , count(B.mb_id) as count, sum(B.po_point) as point from {$g5['member_table']} as A
left join {$g5['point_table']} as B
on (A.mb_id = B.mb_id and A.mb_level < 10 and A.mb_point >= 0)
where date_format(B.po_datetime,'%Y-%m') = '{$rank_nowdate}'
group by B.mb_id order by point desc LIMIT 0, 10
";
$rank_result = sql_query($rank_sql);
//echo $rank_sql;
?>
<tr>
<td colspan="3" style="text-align:center; background-color:#39F; font-size:1.2em; font-weight:bold; color:#fff; line-height:30px; padding:3px 0;">
포인트 순위
<span style="font-size:0.9em;">(<?php echo substr($rank_nowdate, 0, 4)."년"; ?> <?php echo substr($rank_nowdate,5,2)."월"; ?>)</span>
</td>
</tr>
<?php
for ($i=1; $rank_row=sql_fetch_array($rank_result); $i++)
{
$rank_member = sql_fetch("select mb_id, mb_nick, mb_email, mb_homepage, as_level from {$g5['member_table']} where mb_id = '".$rank_row['mb_id']."'");
$rank_sideview = get_sideview($rank_member['mb_id'], cut_str($rank_member['mb_nick'], $config['cf_cut_name']), $rank_member['mb_email'], $rank_member['mb_homepage']);
?>
<tr style="border-bottom:1px dotted #CCC;">
<td style="width:70px; text-align:center; line-height:26px;"><?php echo $i; ?></td>
<td>
<img src="<?php echo xp_icon($rank_member['mb_id'], $rank_member['as_level'], 'zb4');?>">
<?php echo $rank_sideview; ?>
</td>
<td style="text-align:right; padding-right:20px;"><?php echo number_format($rank_row['mb_point']); ?></td>
</tr>
<?php
}
?>
</table>
참고자료
https://sir.kr/g5_tip/2661
<table style="width:100%;">
<tr>
<td style="text-align:center; background-color:#39F; font-size:1.2em; font-weight:bold; color:#fff; line-height:30px; padding:3px 0;" colspan="3">전체 포인트 Top10</td>
</tr>
<?php
$sql_rank = "SELECT DISTINCT t1.mb_id, t1.mb_point, t1.mb_nick, COUNT(t1.mb_id) AS ranking
FROM {$g5['member_table']} t1, {$g5['member_table']} t2
WHERE (t1.mb_point < t2.mb_point OR t1.mb_id = t2.mb_id) and t1.mb_level<10
GROUP BY t1.mb_id ORDER BY ranking LIMIT 0 , 10
";
//echo $sql_rank;
$result_rank = sql_query($sql_rank);
for($i=1; $row_rank = sql_fetch_array($result_rank); $i++){
$rank_member = sql_fetch("select mb_id, mb_nick, mb_email, mb_homepage from {$g5['member_table']} where mb_id = '".$row_rank['mb_id']."'");
$rank_sideview= get_sideview($tmp_member['mb_id'], cut_str($tmp_member['mb_nick'], $config['cf_cut_name']), $tmp_member['mb_email'], $tmp_member['mb_homepage']);
?>
<tr style="border-bottom:1px dotted #CCC;">
<td style="width:70px; text-align:center; line-height:25px;"><?php echo $i; ?></td>
<td><?php echo $rank_sideview; ?></td>
<td style="text-align:right; padding-right:20px;"><?php echo number_format($row_rank['mb_point']); ?></td>
</tr>
<?php
}
?>
</table>
2. 이번달의 포인트 Top 10
<table width="100%">
<?php
$rank_nowdate = date("Y-m",time()); // 이번달
$rank_sql = "select * , count(B.mb_id) as count, sum(B.po_point) as point from {$g5['member_table']} as A
left join {$g5['point_table']} as B
on (A.mb_id = B.mb_id and A.mb_level < 10 and A.mb_point >= 0)
where date_format(B.po_datetime,'%Y-%m') = '{$rank_nowdate}'
group by B.mb_id order by point desc LIMIT 0, 10
";
$rank_result = sql_query($rank_sql);
//echo $rank_sql;
?>
<tr>
<td colspan="3" style="text-align:center; background-color:#39F; font-size:1.2em; font-weight:bold; color:#fff; line-height:30px; padding:3px 0;">
포인트 순위
<span style="font-size:0.9em;">(<?php echo substr($rank_nowdate, 0, 4)."년"; ?> <?php echo substr($rank_nowdate,5,2)."월"; ?>)</span>
</td>
</tr>
<?php
for ($i=1; $rank_row=sql_fetch_array($rank_result); $i++)
{
$rank_member = sql_fetch("select mb_id, mb_nick, mb_email, mb_homepage from {$g5['member_table']} where mb_id = '".$row_rank['mb_id']."'");
$rank_sideview = get_sideview($tmp_member['mb_id'], cut_str($tmp_member['mb_nick'], $config['cf_cut_name']), $tmp_member['mb_email'], $tmp_member['mb_homepage']);
?>
<tr style="border-bottom:1px dotted #CCC;">
<td style="width:70px; text-align:center; line-height:26px;"><?php echo $i; ?></td>
<td><?php echo $rank_sideview; ?></td>
<td style="text-align:right; padding-right:20px;"><?php echo number_format($rank_row['mb_point']); ?></td>
</tr>
<?php
}
?>
</table>
3. 전체 포인트 Top10 ( 아미나빌더 )
<table style="width:100%;">
<tr>
<td style="text-align:center; background-color:#39F; font-size:1.2em; font-weight:bold; color:#fff; line-height:30px; padding:3px 0;" colspan="3">전체 포인트 Top10</td>
</tr>
<?php
$sql_rank = "SELECT DISTINCT t1.mb_id, t1.mb_point, t1.mb_nick, COUNT(t1.mb_id) AS ranking
FROM {$g5['member_table']} t1, {$g5['member_table']} t2
WHERE (t1.mb_point < t2.mb_point OR t1.mb_id = t2.mb_id) and t1.mb_level<10
GROUP BY t1.mb_id ORDER BY ranking LIMIT 0 , 10
";
//echo $sql_rank;
$result_rank = sql_query($sql_rank);
for($i=1; $row_rank = sql_fetch_array($result_rank); $i++){
$rank_member = sql_fetch("select mb_id, mb_nick, mb_email, mb_homepage, as_level from {$g5['member_table']} where mb_id = '".$row_rank['mb_id']."'");
$rank_sideview = get_sideview($rank_member['mb_id'], cut_str($rank_member['mb_nick'], $config['cf_cut_name']), $rank_member['mb_email'], $rank_member['mb_homepage']);
?>
<tr style="border-bottom:1px dotted #CCC;">
<td style="width:70px; text-align:center; line-height:25px;"><?php echo $i; ?></td>
<td>
<img src="<?php echo xp_icon($rank_member['mb_id'], $rank_member['as_level'], 'zb4');?>">
<?php echo $rank_sideview; ?>
</td>
<td style="text-align:right; padding-right:20px;"><?php echo number_format($row_rank['mb_point']); ?></td>
</tr>
<?php
}
?>
</table>
4. 이번달의 포인트 Top 10 ( 아미나빌더 )
<table width="100%">
<?php
$rank_nowdate = date("Y-m",time()); // 이번달
$rank_sql = "select * , count(B.mb_id) as count, sum(B.po_point) as point from {$g5['member_table']} as A
left join {$g5['point_table']} as B
on (A.mb_id = B.mb_id and A.mb_level < 10 and A.mb_point >= 0)
where date_format(B.po_datetime,'%Y-%m') = '{$rank_nowdate}'
group by B.mb_id order by point desc LIMIT 0, 10
";
$rank_result = sql_query($rank_sql);
//echo $rank_sql;
?>
<tr>
<td colspan="3" style="text-align:center; background-color:#39F; font-size:1.2em; font-weight:bold; color:#fff; line-height:30px; padding:3px 0;">
포인트 순위
<span style="font-size:0.9em;">(<?php echo substr($rank_nowdate, 0, 4)."년"; ?> <?php echo substr($rank_nowdate,5,2)."월"; ?>)</span>
</td>
</tr>
<?php
for ($i=1; $rank_row=sql_fetch_array($rank_result); $i++)
{
$rank_member = sql_fetch("select mb_id, mb_nick, mb_email, mb_homepage, as_level from {$g5['member_table']} where mb_id = '".$rank_row['mb_id']."'");
$rank_sideview = get_sideview($rank_member['mb_id'], cut_str($rank_member['mb_nick'], $config['cf_cut_name']), $rank_member['mb_email'], $rank_member['mb_homepage']);
?>
<tr style="border-bottom:1px dotted #CCC;">
<td style="width:70px; text-align:center; line-height:26px;"><?php echo $i; ?></td>
<td>
<img src="<?php echo xp_icon($rank_member['mb_id'], $rank_member['as_level'], 'zb4');?>">
<?php echo $rank_sideview; ?>
</td>
<td style="text-align:right; padding-right:20px;"><?php echo number_format($rank_row['mb_point']); ?></td>
</tr>
<?php
}
?>
</table>
참고자료
https://sir.kr/g5_tip/2661
댓글목록
등록된 댓글이 없습니다.