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

추천인 리스트에서 특정 레벨 회원만 리스트 출력 (예제 있음)

hk아이템 5년 전 조회 3,636

</p>

<p> <ul class="recommend_list">

           <?php 

           for ($i=0; $i<count($list); $i++) { </p>

<p>                $_mb_nick = get_sideview($list[$i]['mb_id'], get_text($list[$i]['mb_nick']), $list[$i]['mb_email'], $list[$i]['mb_homepage']);

                $_mb_name = get_sideview($list[$i]['mb_id'], get_text($list[$i]['mb_name']), $list[$i]['mb_email'], $list[$i]['mb_homepage']);

                $_mb_id = get_sideview($list[$i]['mb_id'], get_text($list[$i]['mb_id']), $list[$i]['mb_email'], $list[$i]['mb_homepage']);

        ?>

        <li><b>

            <span class="recommend_cate"><div><i class="fas fa-ghost" aria-hidden="true"></i> ID: <?php echo get_text($list[$i]['mb_id']); // 아이디 ?> </div></span>

            <span class="recommend_cate"><div><i class="fa fa-user" aria-hidden="true"></i> NAME: <?php echo get_text($list[$i]['mb_nick']); // 이름 ?></div></span>

            <span class="recommend_cate"><div><i class="fas fa-phone" aria-hidden="true"></i> 휴대 전화 : <?php echo get_text($list[$i]['mb_hp']); // 번호 ?></div></span>

            <span class="recommend_cate"><font color="yellow"><i class="fa fa-database" aria-hidden="true"></i> 포인트: <?php echo number_format($list[$i]['mb_point']); ?></font></span>

            <span class="recommend_cate2"><i class="far fa-money-bill-alt" aria-hidden="true"></i><a href="<?php echo G5_BBS_URL; ?>/point_member.php?mb_id=<?php echo get_text($list[$i]['mb_id']); // 아이디 ?>" target="_blank"><font color="white"> 포인트 내역</font></a></span>

            <span class="recommend_level"><i class="fas fa-shield-alt" aria-hidden="true"></i> 등급: <?php echo $list[$i]['mb_level']; ?></span>

        </li></b>

        <?php }  ?></p>

<p>        <?php if ($i == 0) echo "<li class=\"empty_li\">자료가 없습니다.</li>";  ?>

    </ul></p>

<p>    <?php echo get_paging(G5_IS_MOBILE ? $config['cf_mobile_pages'] : $config['cf_write_pages'], $page, $total_page, $_SERVER['SCRIPT_NAME'].'?'.$qstr.'&amp;page='); ?></p>

<p>    <div class="win_btn">

        <button type="button" onclick="window.close();" class="btn_close">창닫기</button>

    </div>

</div></p>

<p>

 

 

다음과 같은 코드로 recommend_list (추천인 / 하부회원) 리스트를 출력하고 있습니다.

다만, 여기서 조건으로 날 추천한 추천인 리스트 중에 레벨 3이상의 회원만을 출력하거나

특정 레밸 (5)의 회원만 추천인 리스트로 출력하는 방법이 궁금합니다

 

항상 고맙습니다. 다들 좋은 한주 보내시길 바라며 소중한 조언 주시는 분 복 받으실 겁니다.

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

답변 1개

e
5년 전

원래는 $list 를 불러오는 부분에 query 를 수정해야하는데요.

그 부분은 소소가 없으니, 해당 소스에서 처리하는 방법으로 알려드리면,

</p>

<p>for ($i=0; $i<count($list); $i++) { </p>

<p>  if($list[$i]['mb_recommend'] == "내아이디" && $list[$i]['mb_level'] >= 3) {</p>

<p>

  

로그인 후 평가할 수 있습니다

답변에 대한 댓글 5개

h
hk아이템
5년 전
안녕하세요 소중한 조언 감사드립니다 ! :D 보내주신 소르로 처리 해보고 있는데 <php 안에 어찌 적용하든 흰 백지 페이지로 정상 작동을 하지 않습니다 ㅠㅠ "내 아이디" 부분을 회원의 아이디로 불러 오는 것도 궁금하긴 한데 그건 $mb_id로 불러와 질 것 같고, 저 부분을 admin이나 기타 실존 아이디로 넣고 적용하더라도 백지 입니다. 초보라서 무례하지만 혹시 어디에 적용 하면 될지 여쭈어 봐도 되겠나요 ?
h
hk아이템
5년 전
전체 코드 첨부합니다.

[code]

<?php
if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가

// add_stylesheet('css 구문', 출력순서); 숫자가 작을 수록 먼저 출력됨
add_stylesheet('<link rel="stylesheet" href="'.$member_skin_url.'/style.css">', 0);

// 추천인 사용
if($config['cf_use_recommend']) {
$sql = " SELECT COUNT(*) AS cnt FROM {$g5['member_table']} WHERE mb_recommend = '".escape_trim($member['mb_id'])."' ";
$mb_rec = sql_fetch($sql);
}
?>

<div id="point" class="new_win">
<h1 id="win_title"><?php echo $g5['title'] ?></h1>
<?php if ($config['cf_use_recommend']) { // 추천인 사용 ?>
<div class="new_win_con2">
<ul class="point_all">
<li class="full_li">
<i class="fa fa-group" aria-hidden="true"></i> 하부 회원 :
<span> <?php echo $mb_rec['cnt']; ?> 명</span>
</li>
<li class="full_li">
<i class="fas fa-won-sign" aria-hidden="true"></i> 정산 금액 :
<span> <?php echo number_format($member['mb_point']); ?> 원</span>
</li>
<li class="full_li">
<i class="fas fa-percent" aria-hidden="true"></i> 요율 :
<span> 1%</span>
</li>
<li class="full_li">
<a onclick="this.nextSibling.style.display=(this.nextSibling.style.display=='none')?'block':'none';" href="javascript:void(0)">
<i class="fas fa-biohazard" aria-hidden="true"></i> 정산 안내
</a><div style="DISPLAY: none">
1. 요율 <b><font color = "red">실시간</font></b>정산<br>
2. 일괄 <b>지연 없이</b> 실시간 <b>일괄</b> 지급 됩니다.<br>
</span>
<li class="full_li">
<b><font color="red"><i class="fas fa-chart-pie" aria-hidden="true"></i> <a href="/bbs/recommend4.php">정산 내역 바로가기</font></b></a>

</li>



</ul>
</div>

<?php } ?>

</ul>


<div id="point_gift" class="new_win">
<div class="win_total">
<font color="red"> 상위 : <?php echo $member['mb_recommend'] ? $member['mb_recommend'].'('.get_text($mb_recommend_row['mb_name']).')' : '본 코드는 지사 코드'; ?> </font>
</div>
<h1 id="win_title"><i class="fas fa-person-booth" aria-hidden="true"></i> 지점 목록</h1>


<div id="recommend" class="new_win">


</h1>
<ul class="recommend_list">
<?php
for ($i=0; $i<count($list); $i++) {

$_mb_nick = get_sideview($list[$i]['mb_id'], get_text($list[$i]['mb_nick']), $list[$i]['mb_email'], $list[$i]['mb_homepage']);
$_mb_name = get_sideview($list[$i]['mb_id'], get_text($list[$i]['mb_name']), $list[$i]['mb_email'], $list[$i]['mb_homepage']);
$_mb_id = get_sideview($list[$i]['mb_id'], get_text($list[$i]['mb_id']), $list[$i]['mb_email'], $list[$i]['mb_homepage']);
if($list[$i]['mb_recommend'] == "admin" && $list[$i]['mb_level'] >= 3) {
?>

<li><b>
<span class="recommend_cate"><div><i class="fas fa-ghost" aria-hidden="true"></i> ID: <?php echo get_text($list[$i]['mb_id']); // 아이디 ?> </div></span>
<span class="recommend_cate"><div><i class="fa fa-user" aria-hidden="true"></i> NAME: <?php echo get_text($list[$i]['mb_nick']); // 이름 ?></div></span>
<span class="recommend_cate"><div><i class="fas fa-phone" aria-hidden="true"></i> 휴대 전화 : <?php echo get_text($list[$i]['mb_hp']); // 번호 ?></div></span>
<span class="recommend_cate"><font color="yellow"><i class="fa fa-database" aria-hidden="true"></i> 보유 포인트 <?php echo number_format($list[$i]['mb_point']); ?></font></span>
<span class="recommend_cate2"><i class="far fa-money-bill-alt" aria-hidden="true"></i><a href="<?php echo G5_BBS_URL; ?>/point_member.php?mb_id=<?php echo get_text($list[$i]['mb_id']); // 아이디 ?>" target="_blank"><font color="white"> 원화 변동 내역</font></a></span>
<span class="recommend_level"><i class="fas fa-shield-alt" aria-hidden="true"></i> 등급: <?php echo $list[$i]['mb_level']; ?></span>
</li></b>
<?php } ?>

<?php if ($i == 0) echo "<li class=\"empty_li\">데이터가 없습니다.</li>"; ?>
</ul>

<?php echo get_paging(G5_IS_MOBILE ? $config['cf_mobile_pages'] : $config['cf_write_pages'], $page, $total_page, $_SERVER['SCRIPT_NAME'].'?'.$qstr.'&amp;page='); ?>





<div class="win_btn">
<button type="button" onclick="window.close();" class="btn_close">창닫기</button>
</div>
</div>

[/code]

무례하고 염치 없지만 조금 만더 어드아비스를 부탁드립니다
늦은 밤 감사합니다 !
e
eyekiss
5년 전
위에 소스 추가하시고..
아래 부분에 닫아주세요..
<?php } } ?>
h
hk아이템
5년 전
아무리 적용 해보려 노력해도 제 실력으로는 백지로만 출려됩니다.
혹시 예제로 알려주실 수 있나요 ? 죄송합니다..
e
eyekiss
5년 전
<?php } ?>
<?php } ?>

<?php if ($i == 0) echo "<li class=\"empty_li\">데이터가 없습니다.</li>"; ?>

이렇게 추가해보세요..

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

답변을 작성하려면 로그인이 필요합니다.

로그인