그누보드4 스킨 고치는 거
본문
그누보드4 갤러리 최신글 스킨을 그누보드5로 사용하려고 하는데
다른건 괜찮은데 갤러리 이미지가 안뜨네요 (엑박상태) 제가 고쳐도 안되요 ㅠㅠ
아시는 분 계실까요?
<link rel="stylesheet" href="<?=$latest_skin_path?>/style.css" type="text/css" />
<tr>
<td>
<!--타이틀 시작: 실선 색상을 바꾸려면 215, 215, 215를 고치세요.-->
<table align="center" cellpadding="0" cellspacing="0" width="100%" height="28">
<tr>
<td>
<table cellpadding="0" cellspacing="0" width="100%">
<tr>
<!--타이틀 내의 왼쪽 여백을 늘리시려면 아래의 9를 바꾸세요-->
<td width="9" height="100%"></td>
<!--타이틀 아이콘 : #0E6EB6, #56A0D5, #7ABAE4 를 진한 색 순서대로 수정하세요. -->
<td height="100%" valign="middle" width="3">
<table cellpadding=0 cellspacing=0 width=3 height=12>
<tr><td height=5 bgcolor=#86cc35></td></tr>
<tr><td height=3 bgcolor=#69ae00></td></tr>
<tr><td height=4 bgcolor=#697957></td></tr>
</table>
</td>
<td height="100%" valign="middle">
<a href='<?=$g4[bbs_path]?>/board.php?bo_table=<?=$bo_table?>'><font color="#57697c" ><b><?=$board[bo_subject]?></b></font></a>
</td>
<td width="38" valign="middle"><a href='<?=$g4[bbs_path]?>/board.php?bo_table=<?=$bo_table?>'><img src="<?=$latest_skin_path?>/img/more.gif" border="0"></a></td>
<!--타이틀 내의 오른쪽 여백을 늘리시려면 아래의 12를 바꾸세요-->
<td width="9" height="100%"></td>
</tr>
</table>
</td>
</tr>
</table>
<!--타이틀 끝-->
</td>
</tr>
<!--타이틀 아래 라인-->
<tr>
<td><table cellpadding=0 cellspacing=0 height=4>
<tr><td width=78 height=4><img src="<?=$latest_skin_path?>/img/bgl.gif" border=0></td>
<td width=34 height=4><img src="<?=$latest_skin_path?>/img/bgm.gif" border=0></td>
<td width=238 height=4 background="<?=$latest_skin_path?>/img/bgr.gif"></td></tr>
</td></tr>
</table></td></tr>
<tr><td align='center'>
<table width='95%'>
<tr>
<?
for ($i=0; $i<count($list); $i++)
{
if ($i > 0)
echo '<td width=20> </td>';
$title = get_text($list[$i][wr_subject]);
$content = cut_str(get_text($list[$i][wr_content]), 80);
$img = "$g4[path]/data/file/$bo_table/".urlencode($list[$i][file][0][file]);
if (!file_exists($img) || !$list[$i][file][0][file])
$img = "$latest_skin_path/img/no_image.gif";
$href = "$g4[bbs_path]/board.php?bo_table=$bo_table";
echo <<<HEREDOC
<td width='120' valign='top' align='center'>
<table width='120' border='0' cellpadding='0' cellspacing='0' align='center'>
<tr>
<td width='120' height='5' align='center'></td>
</tr>
<tr>
<td width='120' height='100' align='center'>
<div style='width:120px;height:100px;border:1px solid #CCCCCC;padding:3px' align='center'>
<a href='$g4[bbs_path]/board.php?bo_table=$bo_table&wr_id={$list[$i][wr_id]}'><img src='{$img}' width='120' height='100' border='0' align='absmiddle' title='$title'></a>
</div>
</td>
</tr>
<tr>
<td width='120' height='5' align='center'></td>
</tr>
<tr>
<td width='120' height='20' align='center'><a href='$g4[bbs_path]/board.php?bo_table=$bo_table&wr_id={$list[$i][wr_id]}'>{$list[$i][subject]}</a></td>
</tr>
</table>
</td>
HEREDOC;
}
?>
</tr>
<? if (count($list) == 0) { ?>
<tr><td colspan=2 align='center' height=25>게시물이 없습니다.</td></tr>
<? } ?>
</table>
</td></tr>
</table>
답변 4
뒷집돌쇠님의 답변도 당연히 같이 적용하셔야 합니다.
$g4[path] ==> G5_URL (또는 G5_PATH)
$g4[bbs_path] ==> G5_BBS_URL
$latest_skin_path ==> $latest_skin_url
다시보니 바뀐부분때문에 소스에 문제가 살짝 있군요.
$img = G5_URL."/data/file/$bo_table/".urlencode($list[$i][file][0][file]);
$img2 = G5_PATH."/data/file/$bo_table/".urlencode($list[$i][file][0][file]); // 파일존재여부 체크를 위해 추가
if (!file_exists($img2) || !$list[$i][file][0][file]) // $img2로 변경
$img = "$latest_skin_url/img/no_image.gif"; // $latest_skin_url로 변경
$href = G5_BBS_URL."/board.php?bo_table=$bo_table";
등등 변경해주시면 될듯 합니다.
계속 엑박으로 나오면 그 부분을 우클릭해서 익스라면 속성보기, 그 외에는 요소검사 같은 것을 통해 해당 이미지의 경로가 어떻게 출력되는지 확인해보시는게 좋겠습니다.
부디 이번엔 잘 됐으면 좋겠습니다..
g4스킨을 g5스킨으로 컨버팅하는경우에는 위 코드에서 나오는것처럼
<a href='$g4[bbs_path]/board.php?bo_table=$bo_table&wr_id={$list[$i][wr_id]}'>
같은 기존 그누4 의 경로를 모두 그누5 경로로 수정해야 합니다.
물론 write.skin.php 에서도 저장 경로 역시 그에 맞게 수정이 되어야만 합니다.
<a href='$g4[bbs_path]/board.php?bo_table=$bo_table&wr_id={$list[$i][wr_id]}'>
는 아래와 같이 수정되어야 합니다.
<a href='<?php echo G5_BBS_URL?>/board.php?bo_table=<?php echo $board[bo_table]?>&wr_id={$list[$i][wr_id]}'>
정확한지 기억은 잘 나지 않지만 아마 이런식으로 수정되면 맞을겁니다.
!-->!-->$latest_skin_path 이걸 $latest_skin_url 로 바꿔보세요.
php코드 내에서는 _path를 쓰시고 html부에서는 _url 쓰시는게 좋습니다.
버전5에서 _path 관련 변수나 상수들은 버전4처럼 상대경로가 아닌 절대경로(루트;/로시작)이기 때문에 html쪽(이미지경로/js,css경로등)에서는 접근이 안됩니다.