[G5] 이번달 포인트 순위 보이기 > 기술자료 | 해피정닷컴

[G5] 이번달 포인트 순위 보이기 > 기술자료

본문 바로가기

사이트 내 전체검색

[G5] 이번달 포인트 순위 보이기 > 기술자료

그누보드 [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

댓글목록

등록된 댓글이 없습니다.


Total 2,634건 19 페이지
  • RSS
기술자료 목록
2274
MySQL   7522  2018-10-02 22:55 ~ 2018-10-02 22:58  
2273
PHP   10795  2018-09-30 15:07 ~ 2018-09-30 15:53  
2272
그누보드   9626  2018-09-27 23:56 ~ 2022-10-22 17:56  
열람
그누보드   8287  2018-09-27 22:01 ~ 2018-09-27 22:40  
2270
그누보드   12283  2018-09-22 01:04 ~ 2023-04-13 16:11  
2269
그누보드   8055  2018-09-21 19:28  
2268
그누보드   9494  2018-09-15 08:08 ~ 2022-04-21 03:02  
2267
전자결제   19463  2018-09-14 05:59 ~ 2020-09-08 23:29  
2266
전자결제   8705  2018-09-14 04:57 ~ 2018-09-14 04:58  
2265
전자결제   9125  2018-09-12 14:17 ~ 2019-03-21 17:04  
2264
일반   11770  2018-08-31 18:10 ~ 2018-09-14 20:50  
2263
HTML   7782  2018-08-30 15:47 ~ 2022-02-08 12:07  
2262
그누보드   7944  2018-08-30 10:41 ~ 2018-08-30 10:48  
2261
PHP   6589  2018-08-29 03:21 ~ 2018-08-29 17:13  
2260
JavaScript   11404  2018-08-28 18:49 ~ 2022-06-13 22:38  
2259
HTML   11069  2018-08-27 14:33 ~ 2021-07-25 18:16  
2258
HTML   13800  2018-08-26 14:07  
2257
일반   8308  2018-08-22 13:17  
2256
PHP   9114  2018-08-20 15:51  
2255
HTML   8844  2018-08-18 05:37  

검색

해피정닷컴 정보

회사소개 회사연혁 협력사 오시는길 서비스 이용약관 개인정보 처리방침

회사명: 해피정닷컴   대표: 정창용   전화: 070-7600-3500   팩스: 042-670-8272
주소: (34368) 대전시 대덕구 대화로 160 대전산업용재유통단지 1동 222호
개인정보보호책임자: 정창용   사업자번호: 119-05-36414
통신판매업신고: 제2024-대전대덕-0405호 [사업자등록확인]  
Copyright 2001~2024 해피정닷컴. All Rights Reserved.