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

칸을 띄우고 싶은데 이럴때는 어떻게 해줘야 간격을 줄 수 있을까요..??

· 15년 전 · 1564 · 2
아래와 같이 되어 있는 부분이 있습니다.
아이디나 닉네임이 길경우 해당 중이 밀려버리는데요. 어디를 봐도 넓이를 조절하는 숫자를 못찾겠네요..어찌해야 조절할 수 있을까요..??
echo ($i+1)."\t$row[ip]\t$row[visit]\t".substr($row[date],5)."\t$row[who]\t$row[mb_id]\t$row[mb_nick]\t$row[mb_name]\n";


----------------------원본 전체---------
<?
$sub_menu = "400950";
include_once("./_common.php");

auth_check($auth[$sub_menu], "r");
$g4[title] = "IP별 방문통계";
include_once("./admin.head.php");


if (!$sdate) $sdate=date("Y-m-d");

$dir="$g4[path]/data/visit/$sdate";
$afile=array();
if (is_dir($dir)) {
if ($dh = @opendir($dir)) {
while (($file = readdir($dh)) !== false) {
if (substr($file,0,3)!="ip.") continue;
$ip=str_replace(".txt","",substr($file,3));
$filename="$dir/$file";
$visit=file_get_contents($filename);
$afile[$ip]=$visit;
}
closedir($dh);
}
}
arsort($afile);

$i=0;
$list=array();
foreach($afile as $ip=>$visit) {
$filename="$dir/ip.$ip.txt";
$mtime=filemtime($filename);
$list[$i][ip]=$ip;
$list[$i][visit]=$visit;
$list[$i][filename]=$filename;
$list[$i][mtime]=$mtime;
$list[$i][date]=date("Y-m-d H:i:s",$mtime);

$row=sql_fetch("select * from $g4[visit_table] where vi_ip='$ip' limit 1");
//방문자가 누구인가 파악
if (!$row) $list[$i][who] = '-';
else if (preg_match("/bot|slurp/i", $row[vi_agent])) $list[$i][who] = 'rob';
else if (strstr($g4[ip],"211.172.253.19")) $list[$i][who] = 'rob'; //다음
else if (strstr($g4[ip],"222.231.40.")) $list[$i][who] = 'rob'; //다음
else if (strstr($g4[ip],"121.254.193.")) $list[$i][who] = 'rob'; //다음 121.254.193.211
else if (strstr($g4[ip],"116.125.142.")) $list[$i][who] = 'rob'; //네이트 116.125.142.201
else if(preg_match("/windows nt 6\.0/i", $row[vi_agent])) $list[$i][who] = "vis";
else if(preg_match("/windows nt 6\.1/i", $row[vi_agent])) $list[$i][who] = "win7";
else if(preg_match("/windows nt 5\.1/i", $row[vi_agent])) $list[$i][who] = "xp";
else if(preg_match("/windows/i", $row[vi_agent])) $list[$i][who] = "win";
else if(preg_match("/mozilla/i", $row[vi_agent])) $list[$i][who] = "moz";
else $list[$i][who] = "etc";

if (strstr($row[vi_agent],"MSIE 9.0;")) $list[$i][who].=" IE9";
else if (strstr($row[vi_agent],"MSIE 8.0;")) $list[$i][who].=" IE8";
else if (strstr($row[vi_agent],"MSIE 7.0;")) $list[$i][who].=" IE7";
else if (strstr($row[vi_agent],"MSIE 6.0;")) $list[$i][who].=" IE6";

$row2=sql_fetch("select * from $g4[login_table] where lo_ip='$ip' limit 1");
if ($row2[mb_id]) $list[$i][mb_id]=$row2[mb_id];

if ($list[$i][mb_id]) $row3=sql_fetch("select * from $g4[member_table] where mb_id = '{$list[$i][mb_id]}' limit 1");
else {
$row3[out]='*';
$row3=sql_fetch("select * from $g4[member_table] where mb_login_ip = '$ip' limit 1");
}

$list[$i][mb_id]=$row3[mb_id]?$row3[out].$row3[mb_id]:"-";
$list[$i][mb_nick]=$row3[mb_nick]?$row3[mb_nick]:"-";
$list[$i][mb_name]=$row3[mb_name]?$row3[mb_name]:"-";
$i++;
}

echo "<form method=get><input name='sdate' value='$sdate' size=10></form>";
echo "<pre>";
foreach($list as $i=>$row) {
echo ($i+1)."\t$row[ip]\t$row[visit]\t".substr($row[date],5)."\t$row[who]\t$row[mb_id]\t$row[mb_nick]\t$row[mb_name]\n";
}
echo "</pre>";

include_once("./admin.tail.php");
?>

댓글 작성

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

로그인하기

댓글 2개

echo ($i+1)."\t$row[ip]\t$row[visit]\t".substr($row[date],5)."\t$row[who]\t$row[mb_id]\t$row[mb_nick]\t$row[mb_name]\n";

요 부분만 보시면..
\t 는 탭입니다. 탭단위로 조절하므로 길이조정이 안될테고요..
\t 를 &nbsp; (공백단위)로 바꾸셔서 조절해보세요
아이디 닉네임 길이가 다 다르니 &nbsp; 이걸로 하면 더 들쭉날쭉해지네요..
정렬을 깔끔하게 하고 싶은데 안되네요..
** 그리고 현재는 페이지조회순으로 출력되는데 이름순으로 출력되게 하려면 어찌해야 하는지요..??

게시글 목록

번호 제목
284348
284336
284333
284332
284320
284318
284316
284313
284307
284306
284303
284298
284296
284290
284286
284280
284277
284272
284261
284259