그누보드4용 최신글을 그누보드5에 맞게... 채택완료
아래는 예전에 사용하던 그누보드4용 최신글입니다. 이걸 그누보드5에서도 사용하고 싶어서 아래 내용을 latest.skin.php이라고 넣었는데 메인페이지가 깨져서 나오네요. 어느 부분을 그누보드5에 맞게 수정해야할지 그리고 어떻게 호출을 해야할지 도움주시면 감사하겠습니다.
</p>
<p><?
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
?>
<!-- start -->
<table width="100%" cellpadding="0" cellspacing="8px" class="top_box back_dgrey">
<tr>
<td>
<table width="100%" border="0" cellpadding="0" cellspacing="0" class="back_white">
<tr><td>
<table width="100%" border="0" cellpadding="0" cellspacing="10px" class="head_in_box" height="100px">
<tr><td>
<? if (count($list) == 0) echo "게시물이 없습니다.";
else { ?>
<table width="100%" cellpadding="0" cellspacing="0">
<tr><td colspan="2" style="padding-bottom: 5px;"><div class="nkhead02"><?=$list[0][0]['subject']?></div></td></tr>
<tr valign="top">
<?
$bo_table = $list[0]['bo_table'];
$image = urlencode($list[0][0][file][0][file]); // 첫번째 파일이 이미지라면
if (preg_match("/\.(gif|jpg|png)$/i", $image) && file_exists("$g4[path]/data/file/$bo_table/$image"))
{
echo "<td width='270'><a href='{$list[0][0][href]}'><img src='{$g5[path]}/data/file/{$bo_table}/{$image}' width='270' height='190' style='border:1 #E7E7E7 solid'></a></td>";
}
else
{
$pattern = '/<\s*img [^\>]*src\s*=\s*[\""\']?([^\""\'\s>]*)/i';
preg_match_all($pattern, $list[0][0]['wr_content'], $matches);
$inner_img = $matches[1][0];
if($inner_img!='')
echo "<td width='270'><a href='{$list[0][0][href]}'><img src='$inner_img' width='270' height='190' style='border:1 #E7E7E7 solid'></a></td>";
}
?>
<td style="padding-left: 10px;">
<a href="<?=$list[0][0]['href']?>">
<?
$con_length = 286; //숫자는 최근글에 뽑을 본문길이
if ($list[0][0]['wr_1']) { ?>
<div class="subtitle" style="padding-bottom:7px "><?=$list[0][0]['wr_1']?></div>
<?
$sub_length = strlen($list[0][0]['wr_1']);
$line_length = ((int) ($sub_length/20));
$con_length -= ($line_length*26);</p>
<p> } ?>
<?
$wr_content = preg_replace("/<(.*?)\>/","",$list[0][0]['wr_content']);
$wr_content = preg_replace("/ /","",$wr_content);
$wr_content = cut_str(get_text($wr_content),$con_length);
echo $wr_content;
?>
<span class="dateFont"> <?=substr($list[0][0]['wr_datetime'], 5, 11)?></span></a></td>
</tr>
</table>
<? } ?>
</td>
</tr>
</table></p>
<p>
</td></tr>
</table>
</td>
</tr>
</table>
<!-- end -->
</p>
<p>
답변 4개
https://www.happyjung.com:6001/lecture/1640">https://www.happyjung.com:6001/lecture/1640
이걸로 참고하시는 게 좋을 것 같아요.
댓글을 작성하려면 로그인이 필요합니다.
댓글을 작성하려면 로그인이 필요합니다.
눈에 띠는 몇가지만 적어봅니다.
file_exists("$g4[path]/data/
를 아래와 같이 변경
file_exists(G5_DATA_PATH."/
댓글을 작성하려면 로그인이 필요합니다.
내용이 출력되는데 레이아웃이 깨지는 것이라면 버전차이가 아니라 css 문제가 아닐까 합니다.
내용이 출력되지 않는다면 버전차이일수 있습니다.
댓글을 작성하려면 로그인이 필요합니다.
답변을 작성하려면 로그인이 필요합니다.
로그인