현재접속자 임의로 추가하는 방법을 알고싶습니다. > 그누4 질문답변

그누4 질문답변

그누보드4 관련 질문은 QA 로 이전됩니다. QA 그누보드4 바로가기
기존 게시물은 열람만 가능합니다.

현재접속자 임의로 추가하는 방법을 알고싶습니다. 정보

현재접속자 임의로 추가하는 방법을 알고싶습니다.

본문

현재접속자를 접속을 안해도 임의로 집어넣고 싶은데요.

current_connect.php 파일에서 수정하는거 같은데 어떻게 수정해야 할가요?

current_connect.php파일.

<?
include_once("./_common.php");

$g4[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 $g4[login_table] a left join $g4[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], $row[mb_nick], $row[mb_email], $row[mb_homepage]);
        $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]+)/", "\\1.♡.\\3.\\4", $row[lo_ip]);
    }

    $list[$i][num] = sprintf("%03d",$i+1);
}

$write_pages = get_paging($config[cf_write_pages], $page, $total_page, "?gr_id=$gr_id&page=");

echo "<script type=\"text/javascript\" src=\"$g4[path]/js/sideview.js\"></script>\n";

$connect_skin_path = "$g4[path]/skin/connect/$config[cf_connect_skin]";
include_once("$connect_skin_path/current_connect.skin.php");

include_once("./_tail.php");
?>
  • 복사

댓글 전체

$list = array();

$virtual_user = array('user1','user2','user3');  // 항상 접속하게 할 사용자

for($uc = 0; $uc<count($virtual_user);$uc++){
   
  $check_sql = "select count(*) as total from $g4[login_table] where mb_id = '".$virtual_user[$uc]."' ";
 
 $check_result = sql_fetch($check_sql);
 if($check_result['total']<1){
 
      $insert_sql = " insert into $g4[login_table]
                        set mb_id            = '$virtual_user[$uc]',
                            lo_datetime          = '$g4[time_ymdhis]',
                            lo_location = '$lo_location'',
                            lo_url = '$lo_url',
                            lo_ip            = '000,000,000,000' ";
      sql_query($insert_sql);
}

}
뽈찌님 올려주신 소스가 아래처럼 넣는건가요?그리고 user1에는 아이디를 넣나요?

<?
include_once("./_common.php");

$g4[title] = "현재접속자";
include_once("./_head.php");

$list = array();

$virtual_user = array('mania','user2','user3');  // 항상 접속하게 할 사용자

for($uc = 0; $uc<count($virtual_user);$uc++){
   
  $check_sql = "select count(*) as total from $g4[login_table] where mb_id = '".$virtual_user[$uc]."' ";
 
 $check_result = sql_fetch($check_sql);
 if($check_result['total']<1){
 
      $insert_sql = " insert into $g4[login_table]
                        set mb_id            = '$virtual_user[$uc]',
                            lo_datetime          = '$g4[time_ymdhis]',
                            lo_location = '$lo_location'',
                            lo_url = '$lo_url',
                            lo_ip            = '000,000,000,000' ";
      sql_query($insert_sql);
}

}

$write_pages = get_paging($config[cf_write_pages], $page, $total_page, "?gr_id=$gr_id&page=");

echo "<script language=\"javascript\" src=\"$g4[path]/js/sideview.js\"></script>\n";

$connect_skin_path = "$g4[path]/skin/connect/$config[cf_connect_skin]";
include_once("$connect_skin_path/current_connect.skin.php");

include_once("./_tail.php");
?>
© SIRSOFT
현재 페이지 제일 처음으로