최신글 클릭시 리스트이동 질문이요
본문
아래의 구문중에
$list[$i]['href'] 이부분이 두개인데 여기에서 $list[$i]['wr_link1'] 요래 바꿔주면
링크1로 바로 이동하는건 알겠습니다.
근데 게시판 리스트로의 이동은 어떻게 설정해 주어야 하나요?
아래 보면 $list[$i]['href'] 요 구문이 4개라서 어디어디를 바꿔야 할지 모르겠어요ㅠㅠ
<?
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
/*
* latest.skin Gallery for Gnuboard4
* latest.skin.php
*
* Copyright 2011 Man Hyung, cho
*
* File encoding: Korean(EUC-KR)
*
*/
$cols = 8; // 이미지 가로갯수 // 이미지 세로 갯수는 메인에서 지정(총 이미지 수)
$image_h = 30; // 이미지 상하 간격
$is_crop = 2;
// $is_crop : 세로 높이가 $height를 넘을 때 crop 할 것인지를 결정
// 0 : crop 하지 않습니다
// 1 : 기본 crop
// 2 : 중간을 기준으로 crop
$col_width = (int)(99 / $cols);
//불당썸---------------------------------------------------------------//
$img_width = 94; //표시할 이미지의 가로사이즈
$img_height = 120; //표시할 이미지의 세로사이즈
//언샾마스트 퀄리티(썸 노이즈바지)
$filter[type] = 99;
$filter[arg1] = 100;
$filter[arg2] = 1;
$filter[arg3] = 2;
$data_path = $g4[path]."/data/file/$bo_table";
$thumb_path = $data_path.'/thumb';
$no_img = $latest_skin_path."/img/no_img.gif";
// 불당썸을 include
include_once("$g4[path]/lib/thumb.lib.php");
//불당썸---------------------------------------------------------------//
// $list_content = "40"; //내용길이
?>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td height='30' colspan="<?=$cols?>">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr bgcolor="#FFFFFF">
<td align="center"></span></a></td>
</tr>
<tr><td colspan="2" height="1" bgcolor="#FFFFFF"></td></tr>
<tr><td colspan="2" height="5" bgcolor="#FFFFFF"></td></tr>
</table>
</td>
</tr>
<? for ($i=0; $i<count($list); $i++) {
if ($i>0 && $i%$cols==0) {
echo "<tr><td colspan='$cols' height='$image_h'></td></tr><tr>";
}
?>
<td width="<?=$col_width?>%" align="center" valign='middle'>
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse:collapse">
<tr>
<td>
<?
//썸네일 생성
$thumfile = "";
$thumb = $thumb_path.'/'.$list[$i][wr_id];
//$file = "$g4[path]/data/file/$bo_table/".urlencode($list[$i][file][0][file]);
$file = $list[$i][file][0][path] .'/'. $list[$i][file][0][file];
//$noimg = "$latest_skin_path/img/noimg.gif";
// 업로드된 파일이 이미지라면
//if (preg_match("/\.(gif|jp[e]?g|png|bmp)$/i", $file) && file_exists($file)) {
if (preg_match("/\.(jpg|gif|png|bmp)$/i", $file) && file_exists($file)) {
//$img=thumbnail($data_path. "/".$image, $imgwidth, $imgheight, 0, 1); //썸네일이 없을경우 원본출력
$thumb = thumbnail($file, $img_width, $img_height, 0, $is_crop, 90, 0, "", $filter, $noimg); //언샾마스크추가
} else { //에디터에서 삽입한 이미지
$edit_img = $list[$i]['wr_content'];
if (eregi("data/cheditor4[^<>]*\.(gif|jp[e]?g|png|bmp)", $edit_img, $tmp)) { // data/cheditor------
$file = $g4[path].'/' . $tmp[0]; // 파일명
$thumb=thumbnail($file, $img_width, $img_height, 0, $is_crop, 90, 0, "", $filter, $noimg); //언샾마스크추가
}
}
//if (file_exists($thumb)) {
//$thumfile = "<img src='{$thumb}' width='{$img_width}' height='{$img_height}' border='0' style='border:1px #ccc solid'></a>";
if (preg_match("/\.(jpg|gif|png|bmp)$/i", $thumb) && file_exists($thumb)) {
echo "<table border='0' cellpadding='0' cellspacing='0'>";
echo "<tr><td width='{$img_width}' height='{$img_height}' align='center' valign='middle'>";
echo "<a href='{$list[$i]['href']}'><img src='$thumb' border='0' align='absmiddle'></a>";
echo "</td></tr>";
echo "<tr><td width='{$img_width}' align='center' valign='middle' style='padding:2px 0;>";
echo "<a href='{$list[$i]['href']}'><span style='font-size:8pt;'>{$list[$i]['subject']}</span>";
echo "</td></tr></table>";
}
else if (!file_exists($list[$i][file_image0])){ // no img
echo "<table style='border: 0px solid #e7e7e7; padding:0; margin:0; border-collapse:collapse'>";
echo "<tr><td width='{$img_width}' height='{$img_height}' align='center' valign='middle' style='border: 1px solid #e7e7e7;'>";
echo "<a href='{$list[$i]['href']}'><img src='$no_img' border='0' align='absmiddle'>";
echo "</td></tr>";
echo "<tr><td width='{$img_width}' align='center' valign='middle' style='padding:2px 0;>";
echo "<a href='{$list[$i]['href']}'><span style='font-size:8pt;'>{$list[$i]['subject']}</span>";
echo "</td></tr></table>";
}
?>
</td>
</tr>
</table>
</td>
<? } ?>
<?
$cnt = ($i%$cols);
for ($k=$cnt; $k<$cols && $cnt; $k++) {
echo "<td width=$col_width%> </td>";
}
?>
<? if (count($list) == 0) { echo "<td align=center height=50>게시물이 없습니다.</td>"; } ?>
</td>
</tr>
</table>
답변 2
<a href='<?=$list[$i]['href']?>'> <?=$list[$i]['subject']?></a>
최근게시글에서 클릭시 해당게시판 리스트 이동
<a href='<?=$g4[bbs_path]?>/board.php?bo_table=<?=$bo_table?>'><?=$board[bo_subject]?></a>
4군데 나오면 4군데 모두 바꿔야 하지만 그럴 필요는 없습니다
for문 다음 줄에 아래처럼 한줄만 추가하면 됩니다
<? for ($i=0; $i<count($list); $i++) {
$list[$i][href]="$g4[bbs_path]/board.php?bo_table=$bo_table";