초보자의 질문입니다. 최근겔러리 댓글 숫자문제 정보
초보자의 질문입니다. 최근겔러리 댓글 숫자문제관련링크
http://www.chungil.or.kr
45회 연결
본문
오류가 나는곳의 주소를 알려주시면 더 빠르고 정확하게 답변 받을 수 있습니다.
오류 주소 :
안녕하세요
최근글 출력에 댓글을 달면 숫자가 나오잖아요.
예컨데 "홍길동(2)" 이런식으로요
겔러리의 썸네일로 메인 화면에 최근 이미지가 나옵니다.
그리고 그 밑에 제목이 나옵니다.
제목 옆에 댓글 숫자도 함께 나오도록 할려면 어떻게 해야 하는지 궁금합니다.
여러분의 도움을 기다리겠습니다.
참고로 홈피의 주소는 링크를 보시면 되고
맨 밑의 이미지가 있고, 그 밑에 제목이 있고, 제목과 함께 댓글 달린 숫자도 함께 나오도록 하고 싶습니다.
감사합니다.
오류 주소 :
안녕하세요
최근글 출력에 댓글을 달면 숫자가 나오잖아요.
예컨데 "홍길동(2)" 이런식으로요
겔러리의 썸네일로 메인 화면에 최근 이미지가 나옵니다.
그리고 그 밑에 제목이 나옵니다.
제목 옆에 댓글 숫자도 함께 나오도록 할려면 어떻게 해야 하는지 궁금합니다.
여러분의 도움을 기다리겠습니다.
참고로 홈피의 주소는 링크를 보시면 되고
맨 밑의 이미지가 있고, 그 밑에 제목이 있고, 제목과 함께 댓글 달린 숫자도 함께 나오도록 하고 싶습니다.
감사합니다.
댓글 전체
제목 출력 소스 부분 이후에
<?
if ($list[$i][wr_comment]) echo " <span class='comment'>({$list[$i][wr_comment]})</span>";
?>
<?
if ($list[$i][wr_comment]) echo " <span class='comment'>({$list[$i][wr_comment]})</span>";
?>
답변에 주셔서 감사합니다.
위의 소스를 어느 부분에 삽입한가요?
skin < latest < 겔러리 < latest.skin.php 가 있던데 이 부분에서 하면 된가요?
위의 소스를 어느 부분에 삽입한가요?
skin < latest < 겔러리 < latest.skin.php 가 있던데 이 부분에서 하면 된가요?
겔러리의 latest.skin.php 부분을 열었을 때 다음과 같은 소스 입니다.
어느 부분에 수정을 해야하는지 알려 주시면 고맙겠습니다.
<?
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
$cols = 90; // 이미지 가로갯수 // 이미지 세로 갯수는 메인에서 지정(총 이미지 수)
$image_h = 2; // 이미지 상하 간격
$col_width = (int)(99 / $cols);
$img_width = 105; //썸네일 가로길이
$img_height = 70; //썸네일 세로길이
$img_quality = 60; //퀼리티 100이하로 설정
if (!function_exists("imagecopyresampled")) alert("GD 2.0.1 이상 버전이 설치되어 있어야 사용할 수 있는 갤러리 게시판 입니다.");
$data_path = $g4[path]."/data/file/$bo_table";
$thumb_path = $data_path.'/thumb105'; //썸네일 이미지 생성 디렉토리
@mkdir($thumb_path, 0707);
@chmod($thumb_path, 0707);
?>
<table width="80%" border="0" cellspacing="0" cellpadding="0">
<tr>
<? for ($i=0; $i<count($list); $i++) {
if ($i>0 && $i%$cols==0) { echo "<td colspan='$cols' height='$image_h'></td><tr>"; }
$img = "<img src='$g4_path/img/noimage.gif' border=1 width='$img_width' height='$img_height' title='이미지 없음' align=center style='margin-right:5px; border:1 #222222 solid;'>";
$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
break;
$rate = $img_width / $size[0];
$height = (int)($size[1] * $rate);
// 계산된 썸네일 이미지의 높이가 설정된 이미지의 높이보다 작다면
if ($height < $img_height)
// 계산된 이미지 높이로 복사본 이미지 생성
$dst = imagecreatetruecolor($img_width, $height);
else
// 설정된 이미지 높이로 복사본 이미지 생성
$dst = imagecreatetruecolor($img_width, $img_height);
imagecopyresampled($dst, $src, 0, 0, 0, 0, $img_width, $height, $size[0], $size[1]);
imagepng($dst, $thumb_path.'/'.$list[$i][wr_id], $img_quality);
chmod($thumb_path.'/'.$list[$i][wr_id], 0606);
}
}
if (file_exists($thumb))
$img = "<img src='$thumb' border=1 align=left style='margin-right:5px; border:1 #222222 solid;'>";
?>
<?
$datetime = substr($list[$i][wr_datetime],0,10);
$datetime2 = $list[$i][wr_datetime];
if ($list[$i]['wr_datetime'] >= date("Y-m-d H:i:s", $g4['server_time'] - ($row['bo_new'] * 3600))) $comment_new = "new";
if ($datetime == $g4[time_ymd])
$datetime2 = substr($datetime2,11,5);
else
$datetime2 = substr($datetime2,5,5);
$list[$i][datetime] = $datetime;
$list[$i][datetime2] = $datetime2;
$a[$i] = array(
"wr_date"=>$datetime2,
);
?>
<?
$rw_subject = cut_str(stripslashes($list[$i][subject]),$subject_size,'..');
$a_link="<a href='{$list[$i][href]}'>$rw_subject</a>";
$a_img="<a href='{$list[$i][href]}'>$img</a>";
$a_comment="<a href=\"{$list[$i][comment_href]}\"><span class='commentFont'>{$list[$i]['comment_cnt']}</span></a>";
$rw_content = cut_str(stripslashes($list[$i][wr_content]),$content_size,' ..more');
$rw_content = strip_tags($rw_content);
?>
<td align=center valign="top">
<table width="<?=$col_width?>%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td align="center"><?=$a_img?></td>
</tr>
<tr>
<td align="center"><nobr style='display:block; overflow:hidden; width:<?=$img_width?>px;'><a href='<?=$list[$i][href]?>'><font color=#666666></font></a></td>
</tr>
</table>
</td>
<? } $cnt = ($i%$cols); for ($k=$cnt; $k<$cols && $cnt; $k++) ?>
</tr>
</table>
<script language="javascript">
function popupImage(imageURL){
imageHandle=open("","popupForImage","toolbar=no,location=no,status=no,manubar=no,scrollbars=no,resizable=no,width=100,height=100,top=0,left=0");
imageHandle.document.write("<title> </title>");
imageHandle.document.write("<style>");
imageHandle.document.write("*{margin:0;padding:0;border:0;}");
imageHandle.document.write("</style>");
imageHandle.document.write("<img src=\""+imageURL+"\" onload=\"window.resizeTo(this.width+6,this.height+55);\" onclick=\"self.close();\" style=\"cursor:hand;\" title=\"클릭하면 닫힙니다.\">");
}
</script>
어느 부분에 수정을 해야하는지 알려 주시면 고맙겠습니다.
<?
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
$cols = 90; // 이미지 가로갯수 // 이미지 세로 갯수는 메인에서 지정(총 이미지 수)
$image_h = 2; // 이미지 상하 간격
$col_width = (int)(99 / $cols);
$img_width = 105; //썸네일 가로길이
$img_height = 70; //썸네일 세로길이
$img_quality = 60; //퀼리티 100이하로 설정
if (!function_exists("imagecopyresampled")) alert("GD 2.0.1 이상 버전이 설치되어 있어야 사용할 수 있는 갤러리 게시판 입니다.");
$data_path = $g4[path]."/data/file/$bo_table";
$thumb_path = $data_path.'/thumb105'; //썸네일 이미지 생성 디렉토리
@mkdir($thumb_path, 0707);
@chmod($thumb_path, 0707);
?>
<table width="80%" border="0" cellspacing="0" cellpadding="0">
<tr>
<? for ($i=0; $i<count($list); $i++) {
if ($i>0 && $i%$cols==0) { echo "<td colspan='$cols' height='$image_h'></td><tr>"; }
$img = "<img src='$g4_path/img/noimage.gif' border=1 width='$img_width' height='$img_height' title='이미지 없음' align=center style='margin-right:5px; border:1 #222222 solid;'>";
$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
break;
$rate = $img_width / $size[0];
$height = (int)($size[1] * $rate);
// 계산된 썸네일 이미지의 높이가 설정된 이미지의 높이보다 작다면
if ($height < $img_height)
// 계산된 이미지 높이로 복사본 이미지 생성
$dst = imagecreatetruecolor($img_width, $height);
else
// 설정된 이미지 높이로 복사본 이미지 생성
$dst = imagecreatetruecolor($img_width, $img_height);
imagecopyresampled($dst, $src, 0, 0, 0, 0, $img_width, $height, $size[0], $size[1]);
imagepng($dst, $thumb_path.'/'.$list[$i][wr_id], $img_quality);
chmod($thumb_path.'/'.$list[$i][wr_id], 0606);
}
}
if (file_exists($thumb))
$img = "<img src='$thumb' border=1 align=left style='margin-right:5px; border:1 #222222 solid;'>";
?>
<?
$datetime = substr($list[$i][wr_datetime],0,10);
$datetime2 = $list[$i][wr_datetime];
if ($list[$i]['wr_datetime'] >= date("Y-m-d H:i:s", $g4['server_time'] - ($row['bo_new'] * 3600))) $comment_new = "new";
if ($datetime == $g4[time_ymd])
$datetime2 = substr($datetime2,11,5);
else
$datetime2 = substr($datetime2,5,5);
$list[$i][datetime] = $datetime;
$list[$i][datetime2] = $datetime2;
$a[$i] = array(
"wr_date"=>$datetime2,
);
?>
<?
$rw_subject = cut_str(stripslashes($list[$i][subject]),$subject_size,'..');
$a_link="<a href='{$list[$i][href]}'>$rw_subject</a>";
$a_img="<a href='{$list[$i][href]}'>$img</a>";
$a_comment="<a href=\"{$list[$i][comment_href]}\"><span class='commentFont'>{$list[$i]['comment_cnt']}</span></a>";
$rw_content = cut_str(stripslashes($list[$i][wr_content]),$content_size,' ..more');
$rw_content = strip_tags($rw_content);
?>
<td align=center valign="top">
<table width="<?=$col_width?>%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td align="center"><?=$a_img?></td>
</tr>
<tr>
<td align="center"><nobr style='display:block; overflow:hidden; width:<?=$img_width?>px;'><a href='<?=$list[$i][href]?>'><font color=#666666></font></a></td>
</tr>
</table>
</td>
<? } $cnt = ($i%$cols); for ($k=$cnt; $k<$cols && $cnt; $k++) ?>
</tr>
</table>
<script language="javascript">
function popupImage(imageURL){
imageHandle=open("","popupForImage","toolbar=no,location=no,status=no,manubar=no,scrollbars=no,resizable=no,width=100,height=100,top=0,left=0");
imageHandle.document.write("<title> </title>");
imageHandle.document.write("<style>");
imageHandle.document.write("*{margin:0;padding:0;border:0;}");
imageHandle.document.write("</style>");
imageHandle.document.write("<img src=\""+imageURL+"\" onload=\"window.resizeTo(this.width+6,this.height+55);\" onclick=\"self.close();\" style=\"cursor:hand;\" title=\"클릭하면 닫힙니다.\">");
}
</script>