최신글 겔러리형(답사기 이미지 노출력 패치) 정보
그누호환 최신글 겔러리형(답사기 이미지 노출력 패치)
본문
답사기의 경우 최신이미지경우 출력이 되지 않습니다.
이 버그를 잡아 답사기의 별도의 latest.lib.php를 만들지 않고 통합한 버젼입니다.
lib/latest.lib.php파일 입니다.
<?
if (defined(__FILE__)) return;
define(__FILE__, TRUE);
//==============================================================================
// 최신글 관련 함수
//==============================================================================
// 최신글 추출
function latest($skin_dir='', $bo_table, $rows=10, $len=40)
{
global $latest_skin, $cfg;
$tmp_latest_skin = $latest_skin;
// 스킨디렉토리값이 넘어왔다면
if ($skin_dir) {
$latest_skin = "./bbs/skin/latest/$skin_dir";
}
$bo_yn = sql_fetch(" select bo_table from $cfg[table_board] where bo_table = '$bo_table' ");
if ($bo_yn[bo_table] != $bo_table) {
echo "<br><br><br><center><font color=#FF0000>{$bo_table}은 존재하지 않는 게시판입니다. 관리자 페이지에서 생성하세요!</font></center>";
} else {
$sql = " select * from $cfg[table_board] where bo_table = '$bo_table' ";
$bo = sql_fetch($sql);
$bo_subject = $bo[bo_subject];
$sql = " select *
from {$cfg[write_table_prefix]}{$bo_table}
where wr_comment = 0
order by wr_id desc limit 0, $rows ";
$result = sql_query($sql);
for ($i=0; $row = mysql_fetch_array($result); $i++) {
$list[$i] = $row;
$list[$i][href] = "./?doc=bbs/gnuboard.php&bo_table=$bo_table&wr_id=$row[wr_id]";
// 코멘트 카운트
$list[$i][commentcnt] = "";
if ($row[wr_commentcnt] > 0) {
$list[$i][commentcnt] = "($row[wr_commentcnt])";
}
$list[$i][name] = gblayer($row[mb_id], cut_str($row[wr_name],10), $row[wr_email], $row[wr_homepage]);
$list[$i][subject] = conv_subject($row[wr_subject], $len,"…");
$list[$i][content] = get_text($row[wr_content]);
$list[$i][date] = substr($row[wr_datetime],2,8);
$list[$i][icon_new] = "";
if ($row[wr_datetime] >= date("Y-m-d H:i:s", time() - $bo[bo_new] * 3600)) {
$list[$i][icon_new] = "<img src='$latest_skin/icon_new.gif' align=absmiddle> ";
}
for ($k=1; $k<=$cfg[file_count]; $k++) {
if (@preg_match($cfg[image_extension], $row["wr_file".$k])) {
$list[$i]["file_image".$k] = "./data/file/$bo_table/" . $row["wr_file".$k];
}
}
//########### 답사기에러처리용 2005.03.24 ⓒⓒⓒ 추가
if (!$list[$i]["file_image1"]) {
if (@preg_match($cfg[image_extension], sprintf("%05d", $row[wr_id])."_s.jpg")) {
$list[$i]["file_image1"] = "./data/file/$bo_table/" . sprintf("%05d", $row[wr_id])."_000_s.jpg";
}
}
for ($k=1; $k<=$cfg[link_count]; $k++) {
if ($row["wr_link".$k]) {
$link[$i]["link".$k] = set_http(get_text(cut_str($row["wr_link".$k], 255)));
$link[$i]["link_href".$k] = "./?doc=bbs/gblink.php&$qstr&wr_id=$row[wr_id]&index=$k";
}
}
}
mysql_free_result($result);
include "$latest_skin/latest.skin.php";
}
$latest_skin = $tmp_latest_skin;
}
?>
이 버그를 잡아 답사기의 별도의 latest.lib.php를 만들지 않고 통합한 버젼입니다.
lib/latest.lib.php파일 입니다.
<?
if (defined(__FILE__)) return;
define(__FILE__, TRUE);
//==============================================================================
// 최신글 관련 함수
//==============================================================================
// 최신글 추출
function latest($skin_dir='', $bo_table, $rows=10, $len=40)
{
global $latest_skin, $cfg;
$tmp_latest_skin = $latest_skin;
// 스킨디렉토리값이 넘어왔다면
if ($skin_dir) {
$latest_skin = "./bbs/skin/latest/$skin_dir";
}
$bo_yn = sql_fetch(" select bo_table from $cfg[table_board] where bo_table = '$bo_table' ");
if ($bo_yn[bo_table] != $bo_table) {
echo "<br><br><br><center><font color=#FF0000>{$bo_table}은 존재하지 않는 게시판입니다. 관리자 페이지에서 생성하세요!</font></center>";
} else {
$sql = " select * from $cfg[table_board] where bo_table = '$bo_table' ";
$bo = sql_fetch($sql);
$bo_subject = $bo[bo_subject];
$sql = " select *
from {$cfg[write_table_prefix]}{$bo_table}
where wr_comment = 0
order by wr_id desc limit 0, $rows ";
$result = sql_query($sql);
for ($i=0; $row = mysql_fetch_array($result); $i++) {
$list[$i] = $row;
$list[$i][href] = "./?doc=bbs/gnuboard.php&bo_table=$bo_table&wr_id=$row[wr_id]";
// 코멘트 카운트
$list[$i][commentcnt] = "";
if ($row[wr_commentcnt] > 0) {
$list[$i][commentcnt] = "($row[wr_commentcnt])";
}
$list[$i][name] = gblayer($row[mb_id], cut_str($row[wr_name],10), $row[wr_email], $row[wr_homepage]);
$list[$i][subject] = conv_subject($row[wr_subject], $len,"…");
$list[$i][content] = get_text($row[wr_content]);
$list[$i][date] = substr($row[wr_datetime],2,8);
$list[$i][icon_new] = "";
if ($row[wr_datetime] >= date("Y-m-d H:i:s", time() - $bo[bo_new] * 3600)) {
$list[$i][icon_new] = "<img src='$latest_skin/icon_new.gif' align=absmiddle> ";
}
for ($k=1; $k<=$cfg[file_count]; $k++) {
if (@preg_match($cfg[image_extension], $row["wr_file".$k])) {
$list[$i]["file_image".$k] = "./data/file/$bo_table/" . $row["wr_file".$k];
}
}
//########### 답사기에러처리용 2005.03.24 ⓒⓒⓒ 추가
if (!$list[$i]["file_image1"]) {
if (@preg_match($cfg[image_extension], sprintf("%05d", $row[wr_id])."_s.jpg")) {
$list[$i]["file_image1"] = "./data/file/$bo_table/" . sprintf("%05d", $row[wr_id])."_000_s.jpg";
}
}
for ($k=1; $k<=$cfg[link_count]; $k++) {
if ($row["wr_link".$k]) {
$link[$i]["link".$k] = set_http(get_text(cut_str($row["wr_link".$k], 255)));
$link[$i]["link_href".$k] = "./?doc=bbs/gblink.php&$qstr&wr_id=$row[wr_id]&index=$k";
}
}
}
mysql_free_result($result);
include "$latest_skin/latest.skin.php";
}
$latest_skin = $tmp_latest_skin;
}
?>
추천
0
0
댓글 전체
Good
음.. 이것은 관리자님께서 올리신 초기버전 멀티 갤러리 용이군요.
추가하신 다음소스를 보면 확장자가 jpg만 처리하도록 되는군요.
> //########### 답사기에러처리용 2005.03.24 ⓒⓒⓒ 추가
> if (!$list[$i]["file_image1"]) {
> if (@preg_match($cfg[image_extension], sprintf("%05d", $row[wr_id])."_s.jpg")) {
> $list[$i]["file_image1"] = "./data/file/$bo_table/" . "0000$row[wr_id]_000_s.jpg";
> }
> }
제가 관리자님의 버전을 수정해서 올린 다음 버전에서는 적용이 불가능할듯하군요.
"멀티 갤러리(답사기) png,gif,jpg 처리버전"
http://www.sir.co.kr/?doc=bbs/gnuboard.php&bo_table=skin3&wr_id=9574
이왕이면 둘다 처리가능한 버전이 나와야 할듯 하군요.
추가하신 다음소스를 보면 확장자가 jpg만 처리하도록 되는군요.
> //########### 답사기에러처리용 2005.03.24 ⓒⓒⓒ 추가
> if (!$list[$i]["file_image1"]) {
> if (@preg_match($cfg[image_extension], sprintf("%05d", $row[wr_id])."_s.jpg")) {
> $list[$i]["file_image1"] = "./data/file/$bo_table/" . "0000$row[wr_id]_000_s.jpg";
> }
> }
제가 관리자님의 버전을 수정해서 올린 다음 버전에서는 적용이 불가능할듯하군요.
"멀티 갤러리(답사기) png,gif,jpg 처리버전"
http://www.sir.co.kr/?doc=bbs/gnuboard.php&bo_table=skin3&wr_id=9574
이왕이면 둘다 처리가능한 버전이 나와야 할듯 하군요.