사이드뷰 사용법 문의

사이드뷰 사용법 문의

QA

사이드뷰 사용법 문의

본문


<?php
include_once("./_common.php");
?>
<style type="text/css">
.pl_rank{clear:both;position:relative;margin:0 auto;width:190px;padding:10px 0 10px}
.pl_rank2:after {display:block;visibility:hidden;clear:both;content:""}
.pl_rank h2{padding:0 10px;height:28px;line-height:2.4em;border:1px solid #cdd6de;background:#f2f5fc;color:#494a4a}
.pl_rank_ul{padding:3px 0 0}
.pl_rank_ul ul{float:left;width:190px;margin:0;padding:0;overflow:hidden;list-style:none}
.pl_rank_ul ul li{position:relative;line-height:18px;margin:5px 0}
.pl_rank_ul ul li .rank_bg{display:inline-block;width:17px;height:17px;margin-right:8px;border:1px solid #b3b8c0;text-align:center;color:#b3b8c0;text-indent:-1px}
.pl_rank_ul ul li .rank_bg1{border:1px solid #ed2525;color:#ed2525}
.pl_rank_ul ul li .rank_bg2{border:1px solid #3452be;color:#3452be}
.pl_rank_ul ul li .rank_point{display:inline-block;position:absolute;top:0;right:2px;font-family:verdana;color:#d83d44;font-size:10px;font-weight:bold}
</style>
<div class="pl_rank">
<h3>전체 포인트 순위</h3>
<div class="pl_rank_ul">
<ul>
<?php
$sql_common = " and mb_id != '{$config['cf_admin']}' ";
$rank_rows = 10; //출력 수
$sql = " select * from {$g5['member_table']} where mb_point > '{$row['mb_point']}' {$sql_common} order by mb_point desc, mb_today_login desc limit {$rank_rows} ";
$result = sql_query($sql);
for ($i=0; $row=sql_fetch_array($result); $i++) {
    $rank = number_format($i + 1);
    $rank_name = get_sideview($row['mb_id'], $row['mb_nick'], $row['mb_email'], $row['mb_homepage']);  //사이드뷰가 안됨
    //$rank_name = $row['mb_nick'];
    $point = number_format($row['mb_point']);
    if ($rank == 1) {
        $rank_bg = ' rank_bg1';
    } else if ($rank <= 3) {
        $rank_bg = ' rank_bg2';
    } else {
        $rank_bg = '';
    }
?>
    <li><span class="rank_bg<?php echo $rank_bg; ?>"><?php echo $rank; ?></span><?php echo $rank_name; ?><span class="rank_point"><?php echo $point; ?></span></li>
<?php } ?>
</ul>
</div>
</div>

 

위 코드는 https://gnustudy.com/bbs/board.php?bo_table=gnu_pds&wr_id=9  포인트순위를 보여주는 코드인데요

 

사이드 뷰를 사용하려고 

    //$rank_name = $row['mb_nick'];    주석처리하고  아래 코드의 주석을 지웠는데

    $rank_name = get_sideview($row['mb_id'], $row['mb_nick'], $row['mb_email'], $row['mb_homepage']); 

 

아래 사진처럼 사이드뷰가 아니라 뿌려버리네요..

그누보드 5.4.5.5 사용중입니다.

get_sideview 함수 사용법이 이전 버전하곤 달라서 이러는건지..  어떻게 해야합니까.

 


 

3556550771_1643973603.6829.png

이 질문에 댓글 쓰기 :

답변 8

get_sideview 함수 사용 방법이 바뀐 적은 없습니다.

원본 기준으로 올려주신 코드 그대로 복사해서 해봤는데 그런 에러는 발생하지 않던데요.

get_sideview 함수를 못불러와서 그런 것같은데요...

get_sideview 함수에 대한 파일을 인클루드해야 할 것같은데...

어디있더라...ㅠㅡㅠ;;;

아. 그렇군요..

개별적으로 바로 불러와서 저런 일이 발생했네요.
index.php  안에다 넣으니 제대로 동작하네요...

저는 별도 페이지로 전체 회원의 포인트 랭킹을 보여주고 싶었는데..
버튼하나 만들어서 링크걸었더니 안되네요.

혹시 방법이 없을까요?  include로 불러오는거 말고..  새창으로 보여주고 싶은데...

출처: https://sir.kr/g5_tip/697

 

/css/admin.css 와 default.css 의 소스는 다음과 같습니다.
관리자와 사용자 모드를 분리해 두었지만 스타일은 같은 스타일이 적용되어 있으니, 편의에 따라 수정하여 사용하실 수 있습니다.

 


.sv_wrap {display:inline-block;position:relative;font-weight:normal} .sv_wrap .sv {z-index:1000;display:none;margin:5px 0 0;border:1px solid #283646;background:#111} .sv_wrap .sv a {display:inline-block !important;margin:0 !important;padding:3px !important;width:94px;border-bottom:1px solid #283646;color:#fff !important} .sv_wrap a:focus, .sv_wrap a:hover, .sv_wrap a:active {text-decoration:none !important} .sv_on {display:block !important;position:absolute;top:10px;left:20px;width:auto;height:auto !important} .sv_nojs .sv {display:block}

스타일에 넣으시면 될 거에요...

https://sir.kr/g5_tip/697

 

[style]

.sv_wrap {display:inline-block;position:relative;font-weight:normal} .sv_wrap .sv {z-index:1000;display:none;margin:5px 0 0;border:1px solid #283646;background:#111} .sv_wrap .sv a {display:inline-block !important;margin:0 !important;padding:3px !important;width:94px;border-bottom:1px solid #283646;color:#fff !important} .sv_wrap a:focus, .sv_wrap a:hover, .sv_wrap a:active {text-decoration:none !important} .sv_on {display:block !important;position:absolute;top:10px;left:20px;width:auto;height:auto !important} .sv_nojs .sv {display:block}

[/style]

 

 

기존 정의된 스타일을 모두 지우고, 다시 직접 스타일 추가하세요.

죄송합니다.
기존 정의된 스타일이란게 뭘 말씀하시는지 ...
point_rank10.php에서 모아비즈님임 알려주신 스타일만 남겨놓고 다 지워봤지만
사이드뷰가 나오지 않습니다.

CSS충돌이 의심되니, 아래 스타일 정의된 것들 다 지운 후 하나하나 확인하면서 다시 스타일 입혀보시라는 말씀입니다.

<style type="text/css">
.pl_rank{clear:both;position:relative;margin:0 auto;width:190px;padding:10px 0 10px}
.pl_rank2:after {display:block;visibility:hidden;clear:both;content:""}
.pl_rank h2{padding:0 10px;height:28px;line-height:2.4em;border:1px solid #cdd6de;background:#f2f5fc;color:#494a4a}
.pl_rank_ul{padding:3px 0 0}
.pl_rank_ul ul{float:left;width:190px;margin:0;padding:0;overflow:hidden;list-style:none}
.pl_rank_ul ul li{position:relative;line-height:18px;margin:5px 0}
.pl_rank_ul ul li .rank_bg{display:inline-block;width:17px;height:17px;margin-right:8px;border:1px solid #b3b8c0;text-align:center;color:#b3b8c0;text-indent:-1px}
.pl_rank_ul ul li .rank_bg1{border:1px solid #ed2525;color:#ed2525}
.pl_rank_ul ul li .rank_bg2{border:1px solid #3452be;color:#3452be}
.pl_rank_ul ul li .rank_point{display:inline-block;position:absolute;top:0;right:2px;font-family:verdana;color:#d83d44;font-size:10px;font-weight:bold}
</style>

include_once(G5_THEME_PATH.'/head.php');

include_once(G5_THEME_PATH.'/tail.php');

두가지 모두 불러와야 사이드뷰가 뜨네요.

새로운 페이지에 랭킹만 보여주고 싶은데  안되는군요.

아이디 클릭하면 자기소개를 보여주고 싶었는데 포기해야겠네요


 
<?php
include_once("_common.php");
include_once(G5_PATH.'/head.sub.php');
?>
<style type="text/css">
.pl_rank{clear:both;position:relative;margin:0 auto;width:190px;padding:10px 0 10px}
.pl_rank2:after {display:block;visibility:hidden;clear:both;content:""}
.pl_rank h2{padding:0 10px;height:28px;line-height:2.4em;border:1px solid #cdd6de;background:#f2f5fc;color:#494a4a}
.pl_rank_ul{padding:3px 0 0}
.pl_rank_ul ul{float:left;width:190px;margin:0;padding:0;overflow:hidden;list-style:none}
.pl_rank_ul ul li{position:relative;line-height:18px;margin:5px 0}
.pl_rank_ul ul li .rank_bg{display:inline-block;width:17px;height:17px;margin-right:8px;border:1px solid #b3b8c0;text-align:center;color:#b3b8c0;text-indent:-1px}
.pl_rank_ul ul li .rank_bg1{border:1px solid #ed2525;color:#ed2525}
.pl_rank_ul ul li .rank_bg2{border:1px solid #3452be;color:#3452be}
.pl_rank_ul ul li .rank_point{display:inline-block;position:absolute;top:0;right:2px;font-family:verdana;color:#d83d44;font-size:10px;font-weight:bold}
.sv_wrap {display:inline-block;position:relative;font-weight:normal}
.sv_wrap .sv {z-index:1000;display:none;margin:5px 0 0;border:1px solid #283646;background:#111}
.sv_wrap .sv a {display:inline-block !important;margin:0 !important;padding:3px !important;width:94px;border-bottom:1px solid #283646;color:#fff !important}
.sv_wrap a:focus,
.sv_wrap a:hover,
.sv_wrap a:active {text-decoration:none !important}
.sv_on {display:block !important;position:absolute;top:10px;left:20px;width:auto;height:auto !important}
.sv_nojs .sv {display:block}
</style>
<div class="pl_rank">
<h3>전체 포인트 순위</h3>
<div class="pl_rank_ul">
<ul>
<?php
$sql_common = " and mb_id != '{$config['cf_admin']}' ";
$rank_rows = 10; //출력 수
$sql = " select * from {$g5['member_table']} where mb_point > '{$row['mb_point']}' {$sql_common} order by mb_point desc, mb_today_login desc limit {$rank_rows} ";
$result = sql_query($sql);
for ($i=0; $row=sql_fetch_array($result); $i++) {
    $rank = number_format($i + 1);
    $rank_name = get_sideview($row['mb_id'], $row['mb_nick'], $row['mb_email'], $row['mb_homepage']);  //사이드뷰가 안됨
    //$rank_name = $row['mb_nick'];
    $point = number_format($row['mb_point']);
    if ($rank == 1) {
        $rank_bg = ' rank_bg1';
    } else if ($rank <= 3) {
        $rank_bg = ' rank_bg2';
    } else {
        $rank_bg = '';
    }
?>
    <li><span class="rank_bg<?php echo $rank_bg; ?>"><?php echo $rank; ?></span><?php echo $rank_name; ?><span class="rank_point"><?php echo $point; ?></span></li>
<?php } ?>
</ul>
</div>
</div>
 
답변을 작성하시기 전에 로그인 해주세요.
전체 0 | RSS
QA 내용 검색
  • 개별 목록 구성 제목 답변작성자조회작성일
  • 질문이 없습니다.

회원로그인

(주)에스아이알소프트 / 대표:홍석명 / (06211) 서울특별시 강남구 역삼동 707-34 한신인터밸리24 서관 1404호 / E-Mail: admin@sir.kr
사업자등록번호: 217-81-36347 / 통신판매업신고번호:2014-서울강남-02098호 / 개인정보보호책임자:김민섭(minsup@sir.kr)
© SIRSOFT