[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,644건 6 페이지
  • RSS
기술자료 목록
2544
PHP   3632  2022-10-06 12:20 ~ 2022-10-06 12:29  
2543
MySQL   5200  2022-09-29 00:24 ~ 2022-09-29 00:25  
2542
SQL   4412  2022-09-27 18:26  
2541
SQL   5526  2022-09-26 11:12  
2540
APP   6059  2022-09-21 16:09 ~ 2022-09-21 16:22  
2539
APP   5686  2022-09-21 16:03 ~ 2022-09-21 16:17  
2538
APP   7333  2022-09-15 13:28 ~ 2022-11-08 19:27  
2537
Search   5105  2022-09-03 15:15  
2536
MySQL   9156  2022-07-29 19:40 ~ 2022-07-29 19:49  
2535
JavaScript   8272  2022-07-28 16:08 ~ 2022-07-28 16:13  
2534
전자결제   4860  2022-07-11 15:56 ~ 2022-07-11 15:56  
2533
전자결제   4468  2022-06-17 15:29  
2532
영카트   5032  2022-06-17 00:07 ~ 2022-06-17 00:08  
2531
그누보드   4660  2022-06-11 00:52  
2530
그누보드   4114  2022-05-27 11:42 ~ 2022-05-27 11:44  
2529
일반   5191  2022-05-26 15:30  
2528
도메인   4559  2022-05-24 17:48 ~ 2022-05-24 19:00  
2527
PHP   4680  2022-05-20 12:09 ~ 2024-03-21 15:12  
2526
Adobe   7749  2022-03-21 15:11 ~ 2022-11-11 16:08  
2525
PHP   7703  2022-02-27 03:45 ~ 2022-03-05 01:33  

검색

해피정닷컴 정보

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

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