코맨트수 표시문제 입니다. 정보
코맨트수 표시문제 입니다.본문
아래는 latest.skin.php 의 소스입니다 , 코맨트 수를 표시하려고 다른 최신게시물 스킨들을 살펴보니
넣코자하는곳에 <?=$list[$i][comment_cnt]?> 를 표현해 주면 되더군요 그래서 아래의 스킨도
마잖가지겠거니 했는데 하루종일 별짓다해도 코맨트수가 표기가 안되네요.
$list[$i][icon_file];
$list[$i][name]; 등등은 표현이 잘 되는데 유독 코맨트 수만 표시가 안되네요...
좀 부탁드려봅니다..
해당 스킨링크 : http://www.sir.co.kr/bbs/board.php?bo_table=g4_skin&wr_id=61203&sca=%C3%D6%BD%C5%B1%DB
<?
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
if (!function_exists("imagecopyresampled")) alert("GD 2.0.1 이상 버전이 설치되어 있어야 사용할 수 있는 스킨 입니다.");
$la_content = "100"; //내용길이
$img_w = "100"; //썸네일 가로
$img_h = "55"; //썸네일 세로
$data_path = $g4[path]."/data/file/$bo_table";
$thumb_path = $data_path.'/thumb_'.$img_w.'_'.$img_h;
@mkdir($thumb_path, 0707);
@chmod($thumb_path, 0707);
?>
<style type="text/css">
#photo_v27_img, #photo_v27_list{float:left}
#photo_v27_img{width:100px;border:1px solid #CCCCCC;padding:3px;}
#photo_v27_list{width:340px;height:68px;padding:0 0 0 15px;}
.photo_v27_sub{height:18px;}
</style>
<?
for ($i=0; $i<count($list); $i++) {
//썸네일 코드 시작
$img = "<div style='width:100px;height:55px;'></div>";
$thumb = $thumb_path.'/'.$list[$i][wr_id];
if (!file_exists($thumb))
{
$file = $list[$i][file][0][path] .'/'. $list[$i][file][0][file];
if (preg_match("/\.(jp[e]?g|gif|png)$/i", $file) && file_exists($file))
{
$size = getimagesize($file);
if ($size[2] == 1)
$src = imagecreatefromgif($file);
else if ($size[2] == 2)
$src = imagecreatefromjpeg($file);
else if ($size[2] == 3)
$src = imagecreatefrompng($file);
else
continue;
$rate = $img_w / $size[0];
$height = (int)($size[1] * $rate);
if ($height < $img_h)
$dst = imagecreatetruecolor($img_w, $height);
else
$dst = imagecreatetruecolor($img_w, $img_h);
imagecopyresampled($dst, $src, 0, 0, 0, 0, $img_w, $height, $size[0], $size[1]);
imagejpeg($dst, $thumb_path.'/'.$list[$i][wr_id], 100);
chmod($thumb_path.'/'.$list[$i][wr_id], 0606);
}
}
if (file_exists($thumb))
$img = "<img src='$thumb' align='absmiddle' border='0'>";
$href = "{$list[$i][href]}";
$subject = "<span $style>".cut_str($list[$i][subject],1000)."</span>";
$wr_content = "<span $style>".cut_str(strip_tags($list[$i][wr_content]),$la_content)."</span>";
// 출력
echo <<<HEREDOC
<div>
<div id="photo_v27_img"><a href='{$href}' onfocus='this.blur()'>{$img}</a></div>
<div id="photo_v27_list">
<div class="photo_v27_sub"><img src='$latest_skin_path/img/board_icon.gif' width='9' height='13' align='center'><a href='{$href}' style='color:#A800FF'><strong>{$subject}</strong></a><?=$list[$i][comment_cnt]?></div>
<div><a href='{$href}'>{$wr_content}</a>{$ksk}</div>
</div>
</div>
HEREDOC;
}
?>
<? if (count($list) == 0) { ?>
<div style="height:25px;" align="center">게시물이 없습니다.</div>
<? } ?>
넣코자하는곳에 <?=$list[$i][comment_cnt]?> 를 표현해 주면 되더군요 그래서 아래의 스킨도
마잖가지겠거니 했는데 하루종일 별짓다해도 코맨트수가 표기가 안되네요.
$list[$i][icon_file];
$list[$i][name]; 등등은 표현이 잘 되는데 유독 코맨트 수만 표시가 안되네요...
좀 부탁드려봅니다..
해당 스킨링크 : http://www.sir.co.kr/bbs/board.php?bo_table=g4_skin&wr_id=61203&sca=%C3%D6%BD%C5%B1%DB
<?
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
if (!function_exists("imagecopyresampled")) alert("GD 2.0.1 이상 버전이 설치되어 있어야 사용할 수 있는 스킨 입니다.");
$la_content = "100"; //내용길이
$img_w = "100"; //썸네일 가로
$img_h = "55"; //썸네일 세로
$data_path = $g4[path]."/data/file/$bo_table";
$thumb_path = $data_path.'/thumb_'.$img_w.'_'.$img_h;
@mkdir($thumb_path, 0707);
@chmod($thumb_path, 0707);
?>
<style type="text/css">
#photo_v27_img, #photo_v27_list{float:left}
#photo_v27_img{width:100px;border:1px solid #CCCCCC;padding:3px;}
#photo_v27_list{width:340px;height:68px;padding:0 0 0 15px;}
.photo_v27_sub{height:18px;}
</style>
<?
for ($i=0; $i<count($list); $i++) {
//썸네일 코드 시작
$img = "<div style='width:100px;height:55px;'></div>";
$thumb = $thumb_path.'/'.$list[$i][wr_id];
if (!file_exists($thumb))
{
$file = $list[$i][file][0][path] .'/'. $list[$i][file][0][file];
if (preg_match("/\.(jp[e]?g|gif|png)$/i", $file) && file_exists($file))
{
$size = getimagesize($file);
if ($size[2] == 1)
$src = imagecreatefromgif($file);
else if ($size[2] == 2)
$src = imagecreatefromjpeg($file);
else if ($size[2] == 3)
$src = imagecreatefrompng($file);
else
continue;
$rate = $img_w / $size[0];
$height = (int)($size[1] * $rate);
if ($height < $img_h)
$dst = imagecreatetruecolor($img_w, $height);
else
$dst = imagecreatetruecolor($img_w, $img_h);
imagecopyresampled($dst, $src, 0, 0, 0, 0, $img_w, $height, $size[0], $size[1]);
imagejpeg($dst, $thumb_path.'/'.$list[$i][wr_id], 100);
chmod($thumb_path.'/'.$list[$i][wr_id], 0606);
}
}
if (file_exists($thumb))
$img = "<img src='$thumb' align='absmiddle' border='0'>";
$href = "{$list[$i][href]}";
$subject = "<span $style>".cut_str($list[$i][subject],1000)."</span>";
$wr_content = "<span $style>".cut_str(strip_tags($list[$i][wr_content]),$la_content)."</span>";
// 출력
echo <<<HEREDOC
<div>
<div id="photo_v27_img"><a href='{$href}' onfocus='this.blur()'>{$img}</a></div>
<div id="photo_v27_list">
<div class="photo_v27_sub"><img src='$latest_skin_path/img/board_icon.gif' width='9' height='13' align='center'><a href='{$href}' style='color:#A800FF'><strong>{$subject}</strong></a><?=$list[$i][comment_cnt]?></div>
<div><a href='{$href}'>{$wr_content}</a>{$ksk}</div>
</div>
</div>
HEREDOC;
}
?>
<? if (count($list) == 0) { ?>
<div style="height:25px;" align="center">게시물이 없습니다.</div>
<? } ?>
댓글 전체

{$list[$i][comment_cnt]} 라고 혀보세요~
{$list[$i][comment_cnt]} 이것두 해보구요 {$list[$i]['comment_cnt']} 이것두 해보구
( )로도 마무리해보고 그런데 echo $list[$i][comment_cnt]; 이걸 해보니까 값이 비었는지 맹탕이어요
암것두 표시 없습니다,,,,??
( )로도 마무리해보고 그런데 echo $list[$i][comment_cnt]; 이걸 해보니까 값이 비었는지 맹탕이어요
암것두 표시 없습니다,,,,??
아...왜그런데요???
저럴 이유가 없는데 왜그런데요???
쟈가 저러면 안되는데....왜그러지???
참 기가막히네요.....어디에 문제가 있을까요???
저럴 이유가 없는데 왜그런데요???
쟈가 저러면 안되는데....왜그러지???
참 기가막히네요.....어디에 문제가 있을까요???

<?=$list[$i]['wr_comment']?>
엑스엠엘님(나의 사부님...^^) 그런데 안됩니다.
미치겠습니다....
안써도 되지만 꼭 알고싶어요
왜 그런지~
미치겠습니다....
안써도 되지만 꼭 알고싶어요
왜 그런지~
두분 감사합니다, 원인은 미궁속으로 빠져들것 같아요.....
제 실력으로 밝혀낼수가 없내요...
벌래가 어디 숨었는지 도저히 모르겠어요....
벌래야 잘 살아라~~~
바바이~
제 실력으로 밝혀낼수가 없내요...
벌래가 어디 숨었는지 도저히 모르겠어요....
벌래야 잘 살아라~~~
바바이~

// 출력
echo <<<HEREDOC
이렇게 감싸는 부분에는 <?=$list[$i]['필드']?> 이렇게 변수 쓰면 안 먹고,
아래처럼 해줘야 합니다.
{$list[$i]['필드']}
코멘트 카운트는 $list[$i]['wr_comment'] 를 사용하면 출력 됩니다.
echo <<<HEREDOC
이렇게 감싸는 부분에는 <?=$list[$i]['필드']?> 이렇게 변수 쓰면 안 먹고,
아래처럼 해줘야 합니다.
{$list[$i]['필드']}
코멘트 카운트는 $list[$i]['wr_comment'] 를 사용하면 출력 됩니다.
답변감사해요...이 스킨을 꼭 스고싶네요...
말씀대로 했는데 $list[$i]['wr_comment'] 결과는 Array['wr_comment'] 이렇게 나옵니다.
사실 echo <<<HEREDOC 밖에서도 해보고 별짓을 다했는데 왜그런지몰겠어요
<?=latest("red_latest_v27", "02_3", 5, 50, "H", "20", "", "0");?> 이렇게 하면 되거든요
<?=latest_num("red_latest_v27", "02_3", 5, 50, "H", "20", "", "0");?> 이렇게하면 안되는 이유가
뭔지 모르겠네요 ..다시한번만 봐주시면 고맙겠습니다.
{$list[$i]['wr_comment']} 하면 Array['wr_comment'] 문구는 안나오지만 아무것도 출력되지 않습니다
말씀대로 했는데 $list[$i]['wr_comment'] 결과는 Array['wr_comment'] 이렇게 나옵니다.
사실 echo <<<HEREDOC 밖에서도 해보고 별짓을 다했는데 왜그런지몰겠어요
<?=latest("red_latest_v27", "02_3", 5, 50, "H", "20", "", "0");?> 이렇게 하면 되거든요
<?=latest_num("red_latest_v27", "02_3", 5, 50, "H", "20", "", "0");?> 이렇게하면 안되는 이유가
뭔지 모르겠네요 ..다시한번만 봐주시면 고맙겠습니다.
{$list[$i]['wr_comment']} 하면 Array['wr_comment'] 문구는 안나오지만 아무것도 출력되지 않습니다

이렇게 한번 해보실래요~
$comment = $list[$i]['wr_comment'];
echo <<<HEREDOC
{$comment}
HEREDOC;
}
$comment = $list[$i]['wr_comment'];
echo <<<HEREDOC
{$comment}
HEREDOC;
}
지속적인 관심 감사드립니다....
.
.
.
안됩니다, 값이 비어있어요....흐흑
사실 그런식으로도 해봤거든요....
$comment = $list[$i][wr_comment];
$comment = $list[$i]['wr_comment'];
echo $list[$i]['wr_comment'];
echo $list[$i][wr_comment];
모두 값이 없네요...
$list[$i][icon_file];
$list[$i][name]; 등등은 표현이 잘 됩니다...
.
.
.
안됩니다, 값이 비어있어요....흐흑
사실 그런식으로도 해봤거든요....
$comment = $list[$i][wr_comment];
$comment = $list[$i]['wr_comment'];
echo $list[$i]['wr_comment'];
echo $list[$i][wr_comment];
모두 값이 없네요...
$list[$i][icon_file];
$list[$i][name]; 등등은 표현이 잘 됩니다...
latest.num.lib.php 에 영향을 받는지요?
<?=latest("red_latest_v27", "02_3", 5, 50, "H", "20", "", "0");?> 이렇게 하면 되거든요
<?=latest_num("red_latest_v27", "02_3", 5, 50, "H", "20", "", "0");?>
이 두가지 차이점이 뭔지알면 될것 같은데....
<?=latest("red_latest_v27", "02_3", 5, 50, "H", "20", "", "0");?> 이렇게 하면 되거든요
<?=latest_num("red_latest_v27", "02_3", 5, 50, "H", "20", "", "0");?>
이 두가지 차이점이 뭔지알면 될것 같은데....

latest.num.lib.php
$sql = " select wr_id, wr_subject, wr_content, wr_name, wr_hit, wr_datetime from $tmp_write_table
이넘을 아래처럼 바꾸세요.
$sql = " select * from $tmp_write_table
불필요한 필드는 셀렉트 안 하게 해서 ㄷ_ㄷ
$sql = " select wr_id, wr_subject, wr_content, wr_name, wr_hit, wr_datetime from $tmp_write_table
이넘을 아래처럼 바꾸세요.
$sql = " select * from $tmp_write_table
불필요한 필드는 셀렉트 안 하게 해서 ㄷ_ㄷ
유아원님 감사합니다, 잘됩니다....^^
늦은시간 까지 이렇게 답변 달아주신점 잊지 않겠습니다....
감사합니다...항상 행복하세요~
늦은시간 까지 이렇게 답변 달아주신점 잊지 않겠습니다....
감사합니다...항상 행복하세요~