현재접속자 임의로 추가하는 방법문의.

현재접속자 임의로 추가하는 방법문의.

QA

현재접속자 임의로 추가하는 방법문의.

답변 1

본문

아래소스는 bbs의 current_connect.skin.php인데요.
여기서 현재접속자 임의로 추가하는 방법을 알고 싶습니다.
<?php
include_once('./_common.php');
$g5['title'] = '현재접속자';
include_once('./_head.php');
$list = array();
$sql = " select a.mb_id, b.mb_nick, b.mb_name, 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++) {
    $list[$i] = $row;
    if ($row['mb_id']) {
        $list[$i]['name'] = get_sideview($row['mb_id'], cut_str($row['mb_nick'], $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


....
$name_ary = array('홍길동', '아무개', '김기사', '김여사');
foreach ($name_ary as $name) {
  $num = count($list);
  $list[$num]['num'] = sprintf('%03d',$num+1);
  $list[$num]['name'] = $name;
  $list[$num]['lo_location'] = '그누보드5';
}
include_once($connect_skin_path.'/current_connect.skin.php');
include_once('./_tail.php');

답변을 작성하시기 전에 로그인 해주세요.
QA 내용 검색
질문등록
전체 60,954
© SIRSOFT
현재 페이지 제일 처음으로