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

현재 접속자 채택완료

역같아들어가니 6년 전 조회 2,239

/bbs/current_connect.php 에서 

로그인하지 않은 ip 리스트도 죽 나오는데요

로그인 한 회원만 리스트에 나오게 하고 싶습니다.

어떻게 하면 될까요?

이렇게 되어 있는데요,,,

 

$g5['title'] = '현재접속자'; include_once('./_head.php'); $list = array(); $sql = " select a.mb_id, b.mb_nick, b.mb_name, b.mb_level, b.mb_email, b.mb_homepage, b.mb_open, b.mb_point, a.lo_ip, a.lo_location, a.lo_url             from {$g5['login_table']} a left join {$g5['member_table']} b on (a.mb_id = b.mb_id)             where a.mb_id <> '{$config['cf_admin']}'             order by a.lo_datetime desc "; $result = sql_query($sql); for ($i=0; $row=sql_fetch_array($result); $i++) {     $row['lo_url'] = get_text($row['lo_url']);     $list[$i] = $row;

 $list[$i]['mb_name']." ";   

    if ($row['mb_id']) {         $list[$i]['name'] = get_sideview($row['mb_id'], cut_str($row['mb_name'], $config['cf_cut_name']), $row['mb_email'], $row['mb_homepage']);     } else {         if ($is_admin)             $list[$i]['name'] = $row['lo_ip'];         else             $list[$i]['name'] = preg_replace("/([0-9]+).([0-9]+).([0-9]+).([0-9]+)/", G5_IP_DISPLAY, $row['lo_ip']);     }     $list[$i]['num'] = sprintf('%03d',$i+1); } include_once($connect_skin_path.'/current_connect.skin.php'); include_once('./_tail.php');

 

 

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

답변 1개

채택된 답변
+20 포인트
6년 전

</p>

<p>for ($i=0; $row=sql_fetch_array($result); $i++) {

    if (!$row['mb_id'])</p>

<p>       continue;</p>

<p>..</p>

<p>..</p>

<p>}</p>

<p>

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

답변에 대한 댓글 1개

역같아들어가니
6년 전
먼저 새해복 많이 받으세요~

$result = sql_query($sql);
for ($i=0; $row=sql_fetch_array($result); $i++) {
if (!$row['mb_id'])
continue;

$row['lo_url'] = get_text($row['lo_url']);
$list[$i] = $row;

이렇게 했더니 되는거 같은데...로그인한 접속은 6명인데
4명만 출력됩니다. 왜그런지 모르겠습니다..

이제보니 몇개 행이 빠져서 표출되는데...
빈행은 있는데...그 행에서 이름과 접속위치가 나타나지 않는 현상입니다,

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

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

로그인