왜 이부분이 문제를 일으키는 것이죠 ??? 정보
왜 이부분이 문제를 일으키는 것이죠 ???본문
그누보드에서는 잘 되는거 같은... 하단부 빨간색 글씨로 된 부분이 있으니까 클럽에서 include한 것이
나오지 않더군요. 그래서 그부분을 지우니까 정상동작... 뭐가 문제였을까요??? ㅠ..ㅠ
문제를 해결은 했지만 이유가 너무나도 궁금해요.
// 현재 접속자수
function cb_connect($cb_name, $skin_dir="")
{
global $config, $g4, $member, $is_admin, $nc;
if ($cb_name == "")
alert("cb_name이 전달되지 않았습니다.");
// 회원, 방문객 카운트
$sql = " select sum(IF(mb_id<>'',1,0)) as mb_cnt, count(*) as total_cnt
from $g4[login_table]
where mb_id <> '$config[cf_admin]' and lo_location like '$cb_name - 클럽%' ";
$row2 = sql_fetch($sql);
$list = array();
//회원 이름 정보출력
$sql2 = " select a.mb_id, mb_sex, b.mb_level, b.mb_nick, b.mb_name, b.mb_email, b.mb_homepage, b.mb_open, 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]' and lo_location like '$cb_name - 클럽%' order by a.lo_datetime desc";
$result = sql_query($sql2);
for ($i=0; $row=sql_fetch_array($result); $i++) {
$list[$i] = $row;
if ($row[mb_id])
$list[$i][name] = "<b>"."$row[mb_nick]"."</b>"." "."$level_icon"." "."$sex_icon";
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);
}
echo "<script language=\"javascript\" src=\"$g4[path]/js/sideview.js\"></script>\n";
if ($skin_dir)
$connect_skin_path = "$nc[cb_path]/skin/connect/$skin_dir";
else
$connect_skin_path = "$nc[cb_path]/skin/connect/default";
// $connect_skin_path = "$nc[cb_path]/skin/connect/$config[cf_connect_skin]";
ob_start();
include_once ("$connect_skin_path/current_connect.skin.php");
$content = ob_get_contents();
ob_end_clean();
return $content;
}
function cb_connect($cb_name, $skin_dir="")
{
global $config, $g4, $member, $is_admin, $nc;
if ($cb_name == "")
alert("cb_name이 전달되지 않았습니다.");
// 회원, 방문객 카운트
$sql = " select sum(IF(mb_id<>'',1,0)) as mb_cnt, count(*) as total_cnt
from $g4[login_table]
where mb_id <> '$config[cf_admin]' and lo_location like '$cb_name - 클럽%' ";
$row2 = sql_fetch($sql);
$list = array();
//회원 이름 정보출력
$sql2 = " select a.mb_id, mb_sex, b.mb_level, b.mb_nick, b.mb_name, b.mb_email, b.mb_homepage, b.mb_open, 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]' and lo_location like '$cb_name - 클럽%' order by a.lo_datetime desc";
$result = sql_query($sql2);
for ($i=0; $row=sql_fetch_array($result); $i++) {
$list[$i] = $row;
if ($row[mb_id])
$list[$i][name] = "<b>"."$row[mb_nick]"."</b>"." "."$level_icon"." "."$sex_icon";
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);
}
echo "<script language=\"javascript\" src=\"$g4[path]/js/sideview.js\"></script>\n";
if ($skin_dir)
$connect_skin_path = "$nc[cb_path]/skin/connect/$skin_dir";
else
$connect_skin_path = "$nc[cb_path]/skin/connect/default";
// $connect_skin_path = "$nc[cb_path]/skin/connect/$config[cf_connect_skin]";
ob_start();
include_once ("$connect_skin_path/current_connect.skin.php");
$content = ob_get_contents();
ob_end_clean();
return $content;
}
댓글 전체

ob_start() 함수가 무슨 작용을 하는지 찾아보면 이유를 아실 수 있습니다.
http://au3.php.net/manual/kr/function.ob-start.php
ob_start();
....출력문......
$content = ob_get_contents();
ob_end_clean();
위 코드는 출력되는 결과를 실제 출력하지않고 $content 변수에 담아두는 역할을 합니다.
http://au3.php.net/manual/kr/function.ob-start.php
ob_start();
....출력문......
$content = ob_get_contents();
ob_end_clean();
위 코드는 출력되는 결과를 실제 출력하지않고 $content 변수에 담아두는 역할을 합니다.
아~ 그렇군요. 뭔 의미인지 이제 알겠습니다. 감사드립니다.
사용할 때 <?= 와 <? 의 차이... ㅎㅎ
사용할 때 <?= 와 <? 의 차이... ㅎㅎ