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

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

· 13년 전 · 908 · 2
현재접속자를 접속을 안해도 임의로 집어넣고 싶은데요.

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");
?>

댓글 작성

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

로그인하기

댓글 2개

$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");
?>

게시글 목록

번호 제목
284508
284499
284492
284490
284484
284481
284478
284476
284474
284472
284470
284458
284457
284454
284453
284447
284446
284444
284441
284440