최근게시물 그림이 안떠요~~ 정보
최근게시물 그림이 안떠요~~본문
링크를 따라가 봤는데요..
http://********/data/file/bd0308/
에서 멈춰 버리네요..(사진이 안떠요..)
이런식으로 뜨네요....
아무래도 $img 경로상의 문제인 것 같은데요....
latest.skin.php // 파일입니다..
<?
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
?>
<?
//스킨제작자
//=========================================
//http://www.soccerdb.co.kr
//=========================================
//사용자가 설정하는 부분입니다!! 이부분만 수정하셔요!!
//=========================================
$cols=3; // 이미지 가로갯수
$imgwidth=110; //표시할 이미지의 가로사이즈
$imgheight=75; //표시할 이미지의 세로사이즈
//=========================================
?>
<table width=100% border=0 cellpadding='0' cellspacing='0' align='center'>
<?
for ($i=0; $i<count($list); $i++) {
$bo_table = $bo_herf[$i];
if($i % $cols == 0 || $i==0){echo "<tr>";} //테이블 열바꿈 관련
$title = get_text($list[$i][wr_subject]);
$content = cut_str(get_text($list[$i][wr_content]), 80);
$img = "$g4[path]/data/file/$bo_table/".$list[$i][file][0][path];
$href = "$g4[bbs_path]/board.php?bo_table=$bo_table";
//이미지 없을때 표시할 이미지 설정.. 일부러 주석 달았어요.. 링크 볼려구요..
// if (!file_exists($img) || !$list[$i][file][0][file])$img = "$latest_skin_path/img/noimage.gif";
echo <<<HEREDOC
<td valign='top' align='center'>
<table width="100%" border='0' cellpadding='0' cellspacing='0' align='center'>
<tr>
<td align='center'><a href='$g4[bbs_path]/board.php?bo_table=$bo_table&wr_id={$list[$i][wr_id]}'><img src='{$img}' width='{$imgwidth}' height='{$imgheight}' border='0' align='absmiddle' title='$title'></a></td>
</tr>
<tr>
<td height='20' align='center' valign='middle'>{$list[$i][subject]}</td>
</tr>
</table>
</td>
HEREDOC;
if($i%$cols == ($cols-1)&& $i>0){ echo "</tr>";} //테이블 열바꿈 관련
}
?>
</tr>
</table>
<? if (count($list) == 0) { ?>
<br>
<center>
등록된 게시물이 없습니다.
</center>
<? } ?>
어디가 어떻게 잘 못 된걸까요....
이 스킨은 총 8개의 게시판을 하나로 보여주는 스킨입니다..
latest2는 하단의 제 글에 있구요..
http://********/data/file/bd0308/
에서 멈춰 버리네요..(사진이 안떠요..)
이런식으로 뜨네요....
아무래도 $img 경로상의 문제인 것 같은데요....
latest.skin.php // 파일입니다..
<?
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
?>
<?
//스킨제작자
//=========================================
//http://www.soccerdb.co.kr
//=========================================
//사용자가 설정하는 부분입니다!! 이부분만 수정하셔요!!
//=========================================
$cols=3; // 이미지 가로갯수
$imgwidth=110; //표시할 이미지의 가로사이즈
$imgheight=75; //표시할 이미지의 세로사이즈
//=========================================
?>
<table width=100% border=0 cellpadding='0' cellspacing='0' align='center'>
<?
for ($i=0; $i<count($list); $i++) {
$bo_table = $bo_herf[$i];
if($i % $cols == 0 || $i==0){echo "<tr>";} //테이블 열바꿈 관련
$title = get_text($list[$i][wr_subject]);
$content = cut_str(get_text($list[$i][wr_content]), 80);
$img = "$g4[path]/data/file/$bo_table/".$list[$i][file][0][path];
$href = "$g4[bbs_path]/board.php?bo_table=$bo_table";
//이미지 없을때 표시할 이미지 설정.. 일부러 주석 달았어요.. 링크 볼려구요..
// if (!file_exists($img) || !$list[$i][file][0][file])$img = "$latest_skin_path/img/noimage.gif";
echo <<<HEREDOC
<td valign='top' align='center'>
<table width="100%" border='0' cellpadding='0' cellspacing='0' align='center'>
<tr>
<td align='center'><a href='$g4[bbs_path]/board.php?bo_table=$bo_table&wr_id={$list[$i][wr_id]}'><img src='{$img}' width='{$imgwidth}' height='{$imgheight}' border='0' align='absmiddle' title='$title'></a></td>
</tr>
<tr>
<td height='20' align='center' valign='middle'>{$list[$i][subject]}</td>
</tr>
</table>
</td>
HEREDOC;
if($i%$cols == ($cols-1)&& $i>0){ echo "</tr>";} //테이블 열바꿈 관련
}
?>
</tr>
</table>
<? if (count($list) == 0) { ?>
<br>
<center>
등록된 게시물이 없습니다.
</center>
<? } ?>
어디가 어떻게 잘 못 된걸까요....
이 스킨은 총 8개의 게시판을 하나로 보여주는 스킨입니다..
latest2는 하단의 제 글에 있구요..
댓글 전체
아놔... 제가 미쳐요.
for ($i=0; $i<count($list); $i++) {
$bo_table = $bo_herf[$i];
$board['bo_table'] = $bo_table; //<!-- 이부분 추가요.
//아마 이 스킨은 다른 쪽에서 못쓸듯요.이름 바꾸고 쓰셔야 할듯요.
for ($i=0; $i<count($list); $i++) {
$bo_table = $bo_herf[$i];
$board['bo_table'] = $bo_table; //<!-- 이부분 추가요.
//아마 이 스킨은 다른 쪽에서 못쓸듯요.이름 바꾸고 쓰셔야 할듯요.
현재.. 어떤 썸네일은 출력이 되고.. 어떤 썸네일은 출력이 안되는 현상이 발생하고 있습니다..
도저히 이유를 모르겠네요ㅠㅠ
썸네일을 출력하는걸로 바꿨습니다.. 이런 방법이 가능할 것 같더라구요..
근데 썸네일도 이미지 출력이 되는게 있고 안되는게 있습니다....
어찌 이런일이 생긴단 말인지.....
링크는 정상적으로 돌아갑니다..
이미지 출력이 왔다갔다 할 뿐입니다ㅠㅠㅠ
만약에 게시판 스킨 문제라면 어떤 스킨을 설치 해야 할까요?ㅠㅠ
<?
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
?>
<?
//스킨제작자
//=========================================
//http://www.soccerdb.co.kr
//=========================================
//사용자가 설정하는 부분입니다!! 이부분만 수정하셔요!!
//=========================================
$cols=3; // 이미지 가로갯수
$imgwidth=110; //표시할 이미지의 가로사이즈
$imgheight=75; //표시할 이미지의 세로사이즈
//=========================================
?>
<table width=100% border=0 cellpadding='0' cellspacing='0' align='center'>
<?
for ($i=0; $i<count($list); $i++) {
$bo_table = $bo_herf[$i];
$board['bo_table'] = $bo_table;
$data_path = $g4[path]."/data/file/$bo_table";
$thumb_path = $data_path.'/thumb'; //썸네일 이미지 생성 디렉토리
$title = get_text($list[$i][wr_subject]);
$content = cut_str(get_text($list[$i][wr_content]), 80);
$href = "$g4[bbs_path]/board.php?bo_table=$bo_table";
if($i % $cols == 0 || $i==0){echo "<tr>";} //테이블 열바꿈 관련
$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 = "$thumb";
}
echo <<<HEREDOC
<td valign='top' align='center'>
<table width="100%" border='0' cellpadding='0' cellspacing='0' align='center'>
<tr>
<td align='center'><a href='$g4[bbs_path]/board.php?bo_table=$bo_table&wr_id={$list[$i][wr_id]}'><img src='{$img}' width='{$imgwidth}' height='{$imgheight}' border='0' align='absmiddle' title='$title'></a></td>
</tr>
<tr>
<td height='20' align='center' valign='middle'>{$list[$i][subject]}</td>
</tr>
</table>
</td>
HEREDOC;
if($i%$cols == ($cols-1)&& $i>0){ echo "</tr>";} //테이블 열바꿈 관련
}
?>
</tr>
</table>
<? if (count($list) == 0) { ?>
<br>
<center>
등록된 게시물이 없습니다.
</center>
<? } ?>
도저히 이유를 모르겠네요ㅠㅠ
썸네일을 출력하는걸로 바꿨습니다.. 이런 방법이 가능할 것 같더라구요..
근데 썸네일도 이미지 출력이 되는게 있고 안되는게 있습니다....
어찌 이런일이 생긴단 말인지.....
링크는 정상적으로 돌아갑니다..
이미지 출력이 왔다갔다 할 뿐입니다ㅠㅠㅠ
만약에 게시판 스킨 문제라면 어떤 스킨을 설치 해야 할까요?ㅠㅠ
<?
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
?>
<?
//스킨제작자
//=========================================
//http://www.soccerdb.co.kr
//=========================================
//사용자가 설정하는 부분입니다!! 이부분만 수정하셔요!!
//=========================================
$cols=3; // 이미지 가로갯수
$imgwidth=110; //표시할 이미지의 가로사이즈
$imgheight=75; //표시할 이미지의 세로사이즈
//=========================================
?>
<table width=100% border=0 cellpadding='0' cellspacing='0' align='center'>
<?
for ($i=0; $i<count($list); $i++) {
$bo_table = $bo_herf[$i];
$board['bo_table'] = $bo_table;
$data_path = $g4[path]."/data/file/$bo_table";
$thumb_path = $data_path.'/thumb'; //썸네일 이미지 생성 디렉토리
$title = get_text($list[$i][wr_subject]);
$content = cut_str(get_text($list[$i][wr_content]), 80);
$href = "$g4[bbs_path]/board.php?bo_table=$bo_table";
if($i % $cols == 0 || $i==0){echo "<tr>";} //테이블 열바꿈 관련
$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 = "$thumb";
}
echo <<<HEREDOC
<td valign='top' align='center'>
<table width="100%" border='0' cellpadding='0' cellspacing='0' align='center'>
<tr>
<td align='center'><a href='$g4[bbs_path]/board.php?bo_table=$bo_table&wr_id={$list[$i][wr_id]}'><img src='{$img}' width='{$imgwidth}' height='{$imgheight}' border='0' align='absmiddle' title='$title'></a></td>
</tr>
<tr>
<td height='20' align='center' valign='middle'>{$list[$i][subject]}</td>
</tr>
</table>
</td>
HEREDOC;
if($i%$cols == ($cols-1)&& $i>0){ echo "</tr>";} //테이블 열바꿈 관련
}
?>
</tr>
</table>
<? if (count($list) == 0) { ?>
<br>
<center>
등록된 게시물이 없습니다.
</center>
<? } ?>
for ($i=0; $i<count($list); $i++) {
$bo_table = $bo_herf[$i];
이부분은 링크에 관련이 있구요.
<?= latest2(..);?>
while(( $row = mysql_fetch_array();
$board['bo_table'] =$row['bo_table'];
$list[$i] = get_list(....
는 이미지와 관련이 있습니다.
$bo_table = $bo_herf[$i];
이부분은 링크에 관련이 있구요.
<?= latest2(..);?>
while(( $row = mysql_fetch_array();
$board['bo_table'] =$row['bo_table'];
$list[$i] = get_list(....
는 이미지와 관련이 있습니다.
링크는 제대로 걸리니깐 문제가 없는거 같은데요..
이미지가 썸네일로 해도 안되는건 뭔가 이상한거 같아서요....
<?
if (!defined('_GNUBOARD_')) exit;
// 최신글 추출
function latest($skin_dir="", $bo_table, $rows=10, $subject_len=40, $options="")
{
global $g4;
if ($skin_dir)
$latest_skin_path = "$g4[path]/skin/latest/$skin_dir";
else
$latest_skin_path = "$g4[path]/skin/latest/basic";
$list = array();
$sql = " select * from $g4[board_table] where bo_table = '$bo_table'";
$board = sql_fetch($sql);
$tmp_write_table = $g4['write_prefix'] . $bo_table; // 게시판 테이블 전체이름
//$sql = " select * from $tmp_write_table where wr_is_comment = 0 order by wr_id desc limit 0, $rows ";
// 위의 코드 보다 속도가 빠름
$sql = " select * from $tmp_write_table where wr_is_comment = 0 order by wr_num limit 0, $rows ";
//explain($sql);
$result = sql_query($sql);
for ($i=0; $row = sql_fetch_array($result); $i++)
$list[$i] = get_list($row, $board, $latest_skin_path, $subject_len);
ob_start();
include "$latest_skin_path/latest.skin.php";
$content = ob_get_contents();
ob_end_clean();
return $content;
}
// By Cysn 2009-06-18 최근게시물에 2개이상의 게시판 을 최근순서대로 불러올때..
function latest2($skin_dir="", $bo_table1,$bo_table2,$bo_table3,$bo_table4,$bo_table5,$bo_table6,$bo_table7,$bo_table8, $rows=10, $subject_len=40, $options="")
//$bo_table1,$bo_table2,$bo_table3,$bo_table4, 는 몇개 불러올지.. 맘대로 늘리시면 됩니다.
{
global $g4;
if ($skin_dir)
$latest_skin_path = "$g4[path]/skin/latest/$skin_dir";
else
$latest_skin_path = "$g4[path]/skin/latest/basic";
$sql_common = " from $g4[board_new_table] a, $g4[board_table] b
where a.bo_table = b.bo_table and a.bo_table in('$bo_table1', '$bo_table2', '$bo_table3', '$bo_table4', '$bo_table5', '$bo_table6', '$bo_table7', '$bo_table8') ";
// '$bo_table1', '$bo_table2', '$bo_table3', '$bo_table4' 역시 몇개 불러올건지.. 위에 맞게 수정하시면 되겠습니다.
$sql_common .= " and a.wr_id = a.wr_parent ";
// 요건 원본글만 불러온다는 말이죠..
$sql_order = " order by a.bn_id desc ";
// 요건 new테이블에 저장된 최근 순서대로..
$sql_select = " b.gr_id, a.bo_table, a.wr_id, a.wr_parent, a.bn_datetime, b.bo_subject ";
$list = array();
$sql = " select $sql_select, b.bo_subject
$sql_common
$sql_order
limit $rows ";
$result = sql_query($sql);
for ($i=0; $row=sql_fetch_array($result); $i++)
{
$tmp_write_table = $g4[write_prefix] . $row[bo_table];
$comment = "";
$comment_link = "";
$row2 = sql_fetch(" select * from $tmp_write_table where wr_id = '$row[wr_id]' ");
$list[$i] = $row2;
$list[$i] = get_list($row2, $board, $latest_skin_path, $subject_len);
$bo_herf[$i] = $row[bo_table];
$bo_name[$i] = $row[bo_subject];
$list[$i][wr_date] = $row2[wr_datetime];
}
ob_start();
include "$latest_skin_path/latest.skin.php";
$content = ob_get_contents();
ob_end_clean();
return $content;
}
?>
이미지가 썸네일로 해도 안되는건 뭔가 이상한거 같아서요....
<?
if (!defined('_GNUBOARD_')) exit;
// 최신글 추출
function latest($skin_dir="", $bo_table, $rows=10, $subject_len=40, $options="")
{
global $g4;
if ($skin_dir)
$latest_skin_path = "$g4[path]/skin/latest/$skin_dir";
else
$latest_skin_path = "$g4[path]/skin/latest/basic";
$list = array();
$sql = " select * from $g4[board_table] where bo_table = '$bo_table'";
$board = sql_fetch($sql);
$tmp_write_table = $g4['write_prefix'] . $bo_table; // 게시판 테이블 전체이름
//$sql = " select * from $tmp_write_table where wr_is_comment = 0 order by wr_id desc limit 0, $rows ";
// 위의 코드 보다 속도가 빠름
$sql = " select * from $tmp_write_table where wr_is_comment = 0 order by wr_num limit 0, $rows ";
//explain($sql);
$result = sql_query($sql);
for ($i=0; $row = sql_fetch_array($result); $i++)
$list[$i] = get_list($row, $board, $latest_skin_path, $subject_len);
ob_start();
include "$latest_skin_path/latest.skin.php";
$content = ob_get_contents();
ob_end_clean();
return $content;
}
// By Cysn 2009-06-18 최근게시물에 2개이상의 게시판 을 최근순서대로 불러올때..
function latest2($skin_dir="", $bo_table1,$bo_table2,$bo_table3,$bo_table4,$bo_table5,$bo_table6,$bo_table7,$bo_table8, $rows=10, $subject_len=40, $options="")
//$bo_table1,$bo_table2,$bo_table3,$bo_table4, 는 몇개 불러올지.. 맘대로 늘리시면 됩니다.
{
global $g4;
if ($skin_dir)
$latest_skin_path = "$g4[path]/skin/latest/$skin_dir";
else
$latest_skin_path = "$g4[path]/skin/latest/basic";
$sql_common = " from $g4[board_new_table] a, $g4[board_table] b
where a.bo_table = b.bo_table and a.bo_table in('$bo_table1', '$bo_table2', '$bo_table3', '$bo_table4', '$bo_table5', '$bo_table6', '$bo_table7', '$bo_table8') ";
// '$bo_table1', '$bo_table2', '$bo_table3', '$bo_table4' 역시 몇개 불러올건지.. 위에 맞게 수정하시면 되겠습니다.
$sql_common .= " and a.wr_id = a.wr_parent ";
// 요건 원본글만 불러온다는 말이죠..
$sql_order = " order by a.bn_id desc ";
// 요건 new테이블에 저장된 최근 순서대로..
$sql_select = " b.gr_id, a.bo_table, a.wr_id, a.wr_parent, a.bn_datetime, b.bo_subject ";
$list = array();
$sql = " select $sql_select, b.bo_subject
$sql_common
$sql_order
limit $rows ";
$result = sql_query($sql);
for ($i=0; $row=sql_fetch_array($result); $i++)
{
$tmp_write_table = $g4[write_prefix] . $row[bo_table];
$comment = "";
$comment_link = "";
$row2 = sql_fetch(" select * from $tmp_write_table where wr_id = '$row[wr_id]' ");
$list[$i] = $row2;
$list[$i] = get_list($row2, $board, $latest_skin_path, $subject_len);
$bo_herf[$i] = $row[bo_table];
$bo_name[$i] = $row[bo_subject];
$list[$i][wr_date] = $row2[wr_datetime];
}
ob_start();
include "$latest_skin_path/latest.skin.php";
$content = ob_get_contents();
ob_end_clean();
return $content;
}
?>
for ($i=0; $row = sql_fetch_array($result); $i++)
$board['bo_table'] =$row['bo_table'];
$list[$i] = get_list($row2, $board, $latest_skin_path, $subject_len);
ob_start();
include "$latest_skin_path/latest.skin.php";
$content = ob_get_contents();
ob_end_clean();
해보시겠어요?
$board['bo_table'] =$row['bo_table'];
$list[$i] = get_list($row2, $board, $latest_skin_path, $subject_len);
ob_start();
include "$latest_skin_path/latest.skin.php";
$content = ob_get_contents();
ob_end_clean();
해보시겠어요?
제대로 한건지 모르겠는데요... 이렇게 하니깐 에러가 나네요^^;;
/////////////////////
<?
if (!defined('_GNUBOARD_')) exit;
// 최신글 추출
function latest($skin_dir="", $bo_table, $rows=10, $subject_len=40, $options="")
{
global $g4;
if ($skin_dir)
$latest_skin_path = "$g4[path]/skin/latest/$skin_dir";
else
$latest_skin_path = "$g4[path]/skin/latest/basic";
$list = array();
$sql = " select * from $g4[board_table] where bo_table = '$bo_table'";
$board = sql_fetch($sql);
$tmp_write_table = $g4['write_prefix'] . $bo_table; // 게시판 테이블 전체이름
//$sql = " select * from $tmp_write_table where wr_is_comment = 0 order by wr_id desc limit 0, $rows ";
// 위의 코드 보다 속도가 빠름
$sql = " select * from $tmp_write_table where wr_is_comment = 0 order by wr_num limit 0, $rows ";
//explain($sql);
$result = sql_query($sql);
for ($i=0; $row = sql_fetch_array($result); $i++)
$list[$i] = get_list($row, $board, $latest_skin_path, $subject_len);
ob_start();
include "$latest_skin_path/latest.skin.php";
$content = ob_get_contents();
ob_end_clean();
return $content;
}
// By Cysn 2009-06-18 최근게시물에 2개이상의 게시판 을 최근순서대로 불러올때..
function latest2($skin_dir="", $bo_table1,$bo_table2,$bo_table3,$bo_table4,$bo_table5,$bo_table6,$bo_table7,$bo_table8, $rows=10, $subject_len=40, $options="")
//$bo_table1,$bo_table2,$bo_table3,$bo_table4, 는 몇개 불러올지.. 맘대로 늘리시면 됩니다.
{
global $g4;
if ($skin_dir)
$latest_skin_path = "$g4[path]/skin/latest/$skin_dir";
else
$latest_skin_path = "$g4[path]/skin/latest/basic";
$sql_common = " from $g4[board_new_table] a, $g4[board_table] b
where a.bo_table = b.bo_table and a.bo_table in('$bo_table1', '$bo_table2', '$bo_table3', '$bo_table4', '$bo_table5', '$bo_table6', '$bo_table7', '$bo_table8') ";
// '$bo_table1', '$bo_table2', '$bo_table3', '$bo_table4' 역시 몇개 불러올건지.. 위에 맞게 수정하시면 되겠습니다.
$sql_common .= " and a.wr_id = a.wr_parent ";
// 요건 원본글만 불러온다는 말이죠..
$sql_order = " order by a.bn_id desc ";
// 요건 new테이블에 저장된 최근 순서대로..
$sql_select = " b.gr_id, a.bo_table, a.wr_id, a.wr_parent, a.bn_datetime, b.bo_subject ";
$list = array();
$sql = " select $sql_select, b.bo_subject
$sql_common
$sql_order
limit $rows ";
$result = sql_query($sql);
for ($i=0; $row=sql_fetch_array($result); $i++)
{
$tmp_write_table = $g4[write_prefix] . $row[bo_table];
$comment = "";
$comment_link = "";
$row2 = sql_fetch(" select * from $tmp_write_table where wr_id = '$row[wr_id]' ");
$list[$i] = $row2;
$board['bo_table'] =$row['bo_table'];
$list[$i] = get_list($row2, $board, $latest_skin_path, $subject_len);
$bo_herf[$i] = $row[bo_table];
$bo_name[$i] = $row[bo_subject];
$list[$i][wr_date] = $row2[wr_datetime];
}
ob_start();
include "$latest_skin_path/latest.skin.php";
$content = ob_get_contents();
ob_end_clean();
return $content;
}
?>
/////////////////////
<?
if (!defined('_GNUBOARD_')) exit;
// 최신글 추출
function latest($skin_dir="", $bo_table, $rows=10, $subject_len=40, $options="")
{
global $g4;
if ($skin_dir)
$latest_skin_path = "$g4[path]/skin/latest/$skin_dir";
else
$latest_skin_path = "$g4[path]/skin/latest/basic";
$list = array();
$sql = " select * from $g4[board_table] where bo_table = '$bo_table'";
$board = sql_fetch($sql);
$tmp_write_table = $g4['write_prefix'] . $bo_table; // 게시판 테이블 전체이름
//$sql = " select * from $tmp_write_table where wr_is_comment = 0 order by wr_id desc limit 0, $rows ";
// 위의 코드 보다 속도가 빠름
$sql = " select * from $tmp_write_table where wr_is_comment = 0 order by wr_num limit 0, $rows ";
//explain($sql);
$result = sql_query($sql);
for ($i=0; $row = sql_fetch_array($result); $i++)
$list[$i] = get_list($row, $board, $latest_skin_path, $subject_len);
ob_start();
include "$latest_skin_path/latest.skin.php";
$content = ob_get_contents();
ob_end_clean();
return $content;
}
// By Cysn 2009-06-18 최근게시물에 2개이상의 게시판 을 최근순서대로 불러올때..
function latest2($skin_dir="", $bo_table1,$bo_table2,$bo_table3,$bo_table4,$bo_table5,$bo_table6,$bo_table7,$bo_table8, $rows=10, $subject_len=40, $options="")
//$bo_table1,$bo_table2,$bo_table3,$bo_table4, 는 몇개 불러올지.. 맘대로 늘리시면 됩니다.
{
global $g4;
if ($skin_dir)
$latest_skin_path = "$g4[path]/skin/latest/$skin_dir";
else
$latest_skin_path = "$g4[path]/skin/latest/basic";
$sql_common = " from $g4[board_new_table] a, $g4[board_table] b
where a.bo_table = b.bo_table and a.bo_table in('$bo_table1', '$bo_table2', '$bo_table3', '$bo_table4', '$bo_table5', '$bo_table6', '$bo_table7', '$bo_table8') ";
// '$bo_table1', '$bo_table2', '$bo_table3', '$bo_table4' 역시 몇개 불러올건지.. 위에 맞게 수정하시면 되겠습니다.
$sql_common .= " and a.wr_id = a.wr_parent ";
// 요건 원본글만 불러온다는 말이죠..
$sql_order = " order by a.bn_id desc ";
// 요건 new테이블에 저장된 최근 순서대로..
$sql_select = " b.gr_id, a.bo_table, a.wr_id, a.wr_parent, a.bn_datetime, b.bo_subject ";
$list = array();
$sql = " select $sql_select, b.bo_subject
$sql_common
$sql_order
limit $rows ";
$result = sql_query($sql);
for ($i=0; $row=sql_fetch_array($result); $i++)
{
$tmp_write_table = $g4[write_prefix] . $row[bo_table];
$comment = "";
$comment_link = "";
$row2 = sql_fetch(" select * from $tmp_write_table where wr_id = '$row[wr_id]' ");
$list[$i] = $row2;
$board['bo_table'] =$row['bo_table'];
$list[$i] = get_list($row2, $board, $latest_skin_path, $subject_len);
$bo_herf[$i] = $row[bo_table];
$bo_name[$i] = $row[bo_subject];
$list[$i][wr_date] = $row2[wr_datetime];
}
ob_start();
include "$latest_skin_path/latest.skin.php";
$content = ob_get_contents();
ob_end_clean();
return $content;
}
?>
<?
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
?>
<?
//스킨제작자
//=========================================
//http://www.soccerdb.co.kr
//=========================================
//사용자가 설정하는 부분입니다!! 이부분만 수정하셔요!!
//=========================================
$cols=3; // 이미지 가로갯수
$img_width=110; //표시할 이미지의 가로사이즈
$img_height=75; //표시할 이미지의 세로사이즈
//=========================================
?>
<table width=100% border=0 cellpadding='0' cellspacing='0' align='center'>
<?
for ($i=0; $i<count($list); $i++) {
$bo_table = $bo_herf[$i];
$data_path = $g4[path]."/data/file/$bo_table";
$thumb_path = $data_path.'/thumb'; //썸네일 이미지 생성 디렉토리
$title = get_text($list[$i][wr_subject]);
$content = cut_str(get_text($list[$i][wr_content]), 80);
$href = "$g4[bbs_path]/board.php?bo_table=$bo_table";
if($i % $cols == 0 || $i==0){echo "<tr>";} //테이블 열바꿈 관련
//이미지 없을때 표시할 이미지 설정
// if (!file_exists($img) || !$list[$i][file][0][file])$img = "$latest_skin_path/img/noimage.gif";
$thumb = $thumb_path.'/'.$list[$i][wr_id];
if (!file_exists($thumb)) {
$file = $list[$i][file][0][path] .'/'. $list[$i][file][0][file];
//echo $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 = "$thumb";
}
echo <<<HEREDOC
<td valign='top' align='center'>
<table width="100%" border='0' cellpadding='0' cellspacing='0' align='center'>
<tr>
<td align='center'><a href='$g4[bbs_path]/board.php?bo_table=$bo_table&wr_id={$list[$i][wr_id]}'><img src='{$img}' width='{$img_width}' height='{$img_height}' border='0' align='absmiddle' title='$title'></a></td>
</tr>
<tr>
<td height='20' align='center' valign='middle'>{$list[$i][subject]}</td>
</tr>
</table>
</td>
HEREDOC;
if($i%$cols == ($cols-1)&& $i>0){ echo "</tr>";} //테이블 열바꿈 관련
}
?>
</tr>
</table>
<? if (count($list) == 0) { ?>
<br>
<center>
등록된 게시물이 없습니다.
</center>
<? } ?>
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
?>
<?
//스킨제작자
//=========================================
//http://www.soccerdb.co.kr
//=========================================
//사용자가 설정하는 부분입니다!! 이부분만 수정하셔요!!
//=========================================
$cols=3; // 이미지 가로갯수
$img_width=110; //표시할 이미지의 가로사이즈
$img_height=75; //표시할 이미지의 세로사이즈
//=========================================
?>
<table width=100% border=0 cellpadding='0' cellspacing='0' align='center'>
<?
for ($i=0; $i<count($list); $i++) {
$bo_table = $bo_herf[$i];
$data_path = $g4[path]."/data/file/$bo_table";
$thumb_path = $data_path.'/thumb'; //썸네일 이미지 생성 디렉토리
$title = get_text($list[$i][wr_subject]);
$content = cut_str(get_text($list[$i][wr_content]), 80);
$href = "$g4[bbs_path]/board.php?bo_table=$bo_table";
if($i % $cols == 0 || $i==0){echo "<tr>";} //테이블 열바꿈 관련
//이미지 없을때 표시할 이미지 설정
// if (!file_exists($img) || !$list[$i][file][0][file])$img = "$latest_skin_path/img/noimage.gif";
$thumb = $thumb_path.'/'.$list[$i][wr_id];
if (!file_exists($thumb)) {
$file = $list[$i][file][0][path] .'/'. $list[$i][file][0][file];
//echo $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 = "$thumb";
}
echo <<<HEREDOC
<td valign='top' align='center'>
<table width="100%" border='0' cellpadding='0' cellspacing='0' align='center'>
<tr>
<td align='center'><a href='$g4[bbs_path]/board.php?bo_table=$bo_table&wr_id={$list[$i][wr_id]}'><img src='{$img}' width='{$img_width}' height='{$img_height}' border='0' align='absmiddle' title='$title'></a></td>
</tr>
<tr>
<td height='20' align='center' valign='middle'>{$list[$i][subject]}</td>
</tr>
</table>
</td>
HEREDOC;
if($i%$cols == ($cols-1)&& $i>0){ echo "</tr>";} //테이블 열바꿈 관련
}
?>
</tr>
</table>
<? if (count($list) == 0) { ?>
<br>
<center>
등록된 게시물이 없습니다.
</center>
<? } ?>
// By Cysn 2009-06-18 최근게시물에 2개이상의 게시판 을 최근순서대로 불러올때..
function latest2($skin_dir="", $bo_table1,$bo_table2,$bo_table3,$bo_table4,$bo_table5,$bo_table6,$bo_table7,$bo_table8, $rows=10, $subject_len=40, $options="")
//$bo_table1,$bo_table2,$bo_table3,$bo_table4, 는 몇개 불러올지.. 맘대로 늘리시면 됩니다.
{
global $g4;
if ($skin_dir)
$latest_skin_path = "$g4[path]/skin/latest/$skin_dir";
else
$latest_skin_path = "$g4[path]/skin/latest/basic";
$sql_common = " from $g4[board_new_table] a, $g4[board_table] b
where a.bo_table = b.bo_table and a.bo_table in('$bo_table1', '$bo_table2', '$bo_table3', '$bo_table4', '$bo_table5', '$bo_table6', '$bo_table7', '$bo_table8') ";
// '$bo_table1', '$bo_table2', '$bo_table3', '$bo_table4' 역시 몇개 불러올건지.. 위에 맞게 수정하시면 되겠습니다.
$sql_common .= " and a.wr_id = a.wr_parent ";
// 요건 원본글만 불러온다는 말이죠..
$sql_order = " order by a.bn_id desc ";
// 요건 new테이블에 저장된 최근 순서대로..
$sql_select = " b.gr_id, a.bo_table, a.wr_id, a.wr_parent, a.bn_datetime, b.bo_subject ";
$list = array();
$sql = " select $sql_select, b.bo_subject
$sql_common
$sql_order
limit $rows ";
$result = sql_query($sql);
for ($i=0; $row=sql_fetch_array($result); $i++)
{
$tmp_write_table = $g4[write_prefix] . $row[bo_table];
$comment = "";
$comment_link = "";
$row2 = sql_fetch(" select * from $tmp_write_table where wr_id = '$row[wr_id]' ");
$list[$i] = $row2;
$board['bo_table'] = $row['bo_table'];
$list[$i] = get_list($row2, $board, $latest_skin_path, $subject_len);
$bo_herf[$i] = $row[bo_table];
$bo_name[$i] = $row[bo_subject];
$list[$i][wr_date] = $row2[wr_datetime];
}
ob_start();
include "$latest_skin_path/latest.skin.php";
$content = ob_get_contents();
ob_end_clean();
return $content;
}
function latest2($skin_dir="", $bo_table1,$bo_table2,$bo_table3,$bo_table4,$bo_table5,$bo_table6,$bo_table7,$bo_table8, $rows=10, $subject_len=40, $options="")
//$bo_table1,$bo_table2,$bo_table3,$bo_table4, 는 몇개 불러올지.. 맘대로 늘리시면 됩니다.
{
global $g4;
if ($skin_dir)
$latest_skin_path = "$g4[path]/skin/latest/$skin_dir";
else
$latest_skin_path = "$g4[path]/skin/latest/basic";
$sql_common = " from $g4[board_new_table] a, $g4[board_table] b
where a.bo_table = b.bo_table and a.bo_table in('$bo_table1', '$bo_table2', '$bo_table3', '$bo_table4', '$bo_table5', '$bo_table6', '$bo_table7', '$bo_table8') ";
// '$bo_table1', '$bo_table2', '$bo_table3', '$bo_table4' 역시 몇개 불러올건지.. 위에 맞게 수정하시면 되겠습니다.
$sql_common .= " and a.wr_id = a.wr_parent ";
// 요건 원본글만 불러온다는 말이죠..
$sql_order = " order by a.bn_id desc ";
// 요건 new테이블에 저장된 최근 순서대로..
$sql_select = " b.gr_id, a.bo_table, a.wr_id, a.wr_parent, a.bn_datetime, b.bo_subject ";
$list = array();
$sql = " select $sql_select, b.bo_subject
$sql_common
$sql_order
limit $rows ";
$result = sql_query($sql);
for ($i=0; $row=sql_fetch_array($result); $i++)
{
$tmp_write_table = $g4[write_prefix] . $row[bo_table];
$comment = "";
$comment_link = "";
$row2 = sql_fetch(" select * from $tmp_write_table where wr_id = '$row[wr_id]' ");
$list[$i] = $row2;
$board['bo_table'] = $row['bo_table'];
$list[$i] = get_list($row2, $board, $latest_skin_path, $subject_len);
$bo_herf[$i] = $row[bo_table];
$bo_name[$i] = $row[bo_subject];
$list[$i][wr_date] = $row2[wr_datetime];
}
ob_start();
include "$latest_skin_path/latest.skin.php";
$content = ob_get_contents();
ob_end_clean();
return $content;
}
Parse error: syntax error, unexpected T_SL in /home/hosting_users/hdz_smileevent/www/skin/latest/gallery/latest.skin.php on line 81
// 위에 두 파일 바꿔봤는데요.. 에러가 뜨네요..ㅠㅠ
// 위에 두 파일 바꿔봤는데요.. 에러가 뜨네요..ㅠㅠ