그룹최신글에서 함수입력 그리고 출력까지는 되는데요 링크에서 안되네요.
본문
메인 최신글 아래 9개 블럭중
최신교회소식을
관리자페이지에서 그룹으로 묶고
그누보드팁에서 그룹함수.lib.php 파일 만들어서 lib폴더에 넣은후
메인에 2개 게시판에서 뽑아오는것까지 했는데요...
메인에서 글링크하면 삭제되었거나 없는글이라고 나와요
한개 게시판은 정상 링크되는데요..
다른 게시판 하나가 주소가 잘못되서 링크가 안되요
방법좀 알려주세요.. 고수님들 부탁드려요~!
<?
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
if(!$options) $options=3;
$cols = "1"; // 이미지 가로갯수 // 이미지 세로 갯수는 메인에서 지정(총 이미지 수)
$image_h = 0; // 이미지 상하 간격
$image_h = 0; // 이미지 상하 간격
$col_width = (int)(99 / $cols);
$thumb_path = $data_path.'/thumb';
?>
<style>
.add_font_03 {font-size:13px; line-height:20px; }
.add_font_03 a {font:12px "NanumGothic", "RixGoB"; color:#777575;text-decoration:none; line-height:20px; }
.add_font_03 a:hover {color:#07a8e6;text-decoration:underline; line-height:20px; }
.add_font_03 {font-size:13px; line-height:20px; }
.add_font_03 a {font:12px "NanumGothic", "RixGoB"; color:#777575;text-decoration:none; line-height:20px; }
.add_font_03 a:hover {color:#07a8e6;text-decoration:underline; line-height:20px; }
.main1_font_03 {font-size:12px; line-height:20px; color:#3d8d91;}
.main1_font_03 a {"NanumGothic", "RixGoB"; color:#3d8d91; text-decoration:none; line-height:20px; }
.main1_font_03 a:hover {color:#666666; text-decoration:underline; line-height:20px; }
</style>
.main1_font_03 a {"NanumGothic", "RixGoB"; color:#3d8d91; text-decoration:none; line-height:20px; }
.main1_font_03 a:hover {color:#666666; text-decoration:underline; line-height:20px; }
</style>
<table width=100% border=0 valign="middle" cellpadding=0 cellspacing=0 style="padding-top:8px;">
<tr>
<td valign="middle" >
<!--타이틀-->
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td valign="top" >
<table width=100% border=0 cellpadding=0 cellspacing=0>
<tr>
<td valign="middle" ><table width="100%" border="0" cellspacing="0" cellpadding="0">
<td valign="middle" >
<!--타이틀-->
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td valign="top" >
<table width=100% border=0 cellpadding=0 cellspacing=0>
<tr>
<td valign="middle" ><table width="100%" border="0" cellspacing="0" cellpadding="0">
<!-- 이미지보이는 부분 시작 -->
<table cellpadding="0" cellspacing="0" width="100%" border="0">
<tr><td>
<table cellpadding="0" cellspacing="0" width="100%" border="0">
<tr><td>
<table width="98%" border="0" cellspacing="0" cellpadding="0">
<tr><td ></td></tr>
<tr>
<td >
<table width="98%" border="0" cellspacing="0" cellpadding="0">
<tr>
<tr><td ></td></tr>
<tr>
<td >
<table width="98%" border="0" cellspacing="0" cellpadding="0">
<tr>
<? for ($i=0; $i<count($list); $i++) {
if ($i>0 && $i%$cols==0) { echo "</tr><tr><td colspan='$cols' height='$image_h'></td></tr><tr>"; }
?>
if ($i>0 && $i%$cols==0) { echo "</tr><tr><td colspan='$cols' height='$image_h'></td></tr><tr>"; }
?>
<td width="<?=$col_width?>%" valign='top'>
<?
$image = $list[$i][file][0][file]; //원본
$img=$data_path. "/".$image; //썸네일이 없을경우 원본출력
$thumb = $thumb_path. "/". $list[$i][wr_id];
$image = $list[$i][file][0][file]; //원본
$img=$data_path. "/".$image; //썸네일이 없을경우 원본출력
$thumb = $thumb_path. "/". $list[$i][wr_id];
if ( file_exists($thumb) )
$img = $thumb;
$style = "";
if ($list[$i][icon_new]) {
}
$subject = "$list[$i][subject]"; //제목 글자수 자르기
$wr_hit = $list[$i]['wr_hit'];
$wr_id = $list[$i]['wr_id'];
// if ($list[$i]['comment_cnt']) //코
// $cmt = "({$list[$i]['comment_cnt']})";
$img = $thumb;
$style = "";
if ($list[$i][icon_new]) {
}
$subject = "$list[$i][subject]"; //제목 글자수 자르기
$wr_hit = $list[$i]['wr_hit'];
$wr_id = $list[$i]['wr_id'];
// if ($list[$i]['comment_cnt']) //코
// $cmt = "({$list[$i]['comment_cnt']})";
$bg = ""; //새글?
if ($list[$i][icon_new])
$bg="la_top_2.gif";
else
$bg="la_top_1.gif";
if ($list[$i][icon_new])
$bg="la_top_2.gif";
else
$bg="la_top_1.gif";
echo $list[$i][icon_reply] . " ";
echo "<table cellpadding='0' cellspacing='0' border='0'>
<tr>
<td valign='top' width='98%' align='left' style='padding-top:0px; padding-left:20px;'><span class='add_font_03'><span class='main1_font_03' >[{$list[$i]['ca_name']}]</span> <a href=\"$g4[bbs_path]/board.php?bo_table=$bo_table&wr_id=$wr_id\" onFocus=\"this.blur();\" title=\"{$list[$i][subject]}\">".cut_str(strip_tags($list[$i][wr_subject]),61,"…")."</a></span></td>
</tr>
<tr>
<td align='center' style=' padding-left:1px;'><img src='{$g4['path']}/image/bord_line.png' width='330'></td>
</tr>
</table>
";
?>
</td>
<? } ?>
<?
$cnt = ($i%$cols);
for ($k=$cnt; $k<$cols && $cnt; $k++) {
echo "<td width=$col_width%> </td>";
}
?>
<? if ($i+1 < count($list)) { echo "</tr><tr><td colspan='$cols' height='$image_h'></td></tr><tr>"; } ?>
<? if (count($list) == 0) { echo "<td height=80 align=center>게시물이 없습니다.</td>"; } ?>
</tr>
</table>
</td>
</tr>
</table>
</td></tr>
</table>
<!-- 이미지보이는 부분 끝 -->
</table>
</table>
<tr>
</tr>
</table>
<tr>
<td valign='top' width='98%' align='left' style='padding-top:0px; padding-left:20px;'><span class='add_font_03'><span class='main1_font_03' >[{$list[$i]['ca_name']}]</span> <a href=\"$g4[bbs_path]/board.php?bo_table=$bo_table&wr_id=$wr_id\" onFocus=\"this.blur();\" title=\"{$list[$i][subject]}\">".cut_str(strip_tags($list[$i][wr_subject]),61,"…")."</a></span></td>
</tr>
<tr>
<td align='center' style=' padding-left:1px;'><img src='{$g4['path']}/image/bord_line.png' width='330'></td>
</tr>
</table>
";
?>
</td>
<? } ?>
<?
$cnt = ($i%$cols);
for ($k=$cnt; $k<$cols && $cnt; $k++) {
echo "<td width=$col_width%> </td>";
}
?>
<? if ($i+1 < count($list)) { echo "</tr><tr><td colspan='$cols' height='$image_h'></td></tr><tr>"; } ?>
<? if (count($list) == 0) { echo "<td height=80 align=center>게시물이 없습니다.</td>"; } ?>
</tr>
</table>
</td>
</tr>
</table>
</td></tr>
</table>
<!-- 이미지보이는 부분 끝 -->
</table>
</table>
<tr>
</tr>
</table>
답변 5
히어1님 userfunction.lib.php 이거 팁자료실에서 구해서
적용한거에요... 감사합니다..
<?
if (!defined('_GNUBOARD_')) exit;
// 함수 정의 시작
// 최신글 추출 - 선택한 그룹별로 원하는 게시판을 제외하고 원하는 수만큼 보여줌
function latest_group($skin_dir="", $gr_id, $rows=10, $subject_len=40, $no_table="", $category="", $orderby="")
{
global $config;
global $g4;
$list = array(); $limitrows = $rows;
$sqlgroup = " select bo_table, bo_subject from $g4[board_table] where gr_id = '$gr_id' ";
// 제거할 테이블들
if ($no_table) {
$t_flag = serialize($no_table);
if ($t_flag[0] == "a") { //Array이면
for ($ic=0; $ic<count($no_table); $ic++) {
$sqlgroup .= " and bo_table != '$no_table[$ic]' ";
}
} else if ($t_flag[0] == "s") { //String이면
$sqlgroup .= " and bo_table != '$no_table' ";
}
}
$sqlgroup .= " and bo_use_search=1 order by bo_order_search ";
$rsgroup = sql_query($sqlgroup);
if ($skin_dir)
$latest_skin_path = "$g4[path]/skin/latest/$skin_dir";
else
$latest_skin_path = "$g4[path]/skin/latest/$config[cf_latest_skin]";
for ($j=0, $k=0; $rowgroup=sql_fetch_array($rsgroup); $j++) {
$bo_table = $rowgroup[bo_table];
// 테이블 이름구함
$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 ";
$sql .= (!$category) ? "" : " and ca_name = '$category' ";
$sql .= (!$orderby) ? " order by wr_id desc " : " order by $orderby desc, wr_id desc ";
$sql .= " limit $limitrows";
$result = sql_query($sql);
for ($i=0; $row = sql_fetch_array($result); $i++, $k++) {
if(!$orderby) $op_list[$k] = $row[wr_datetime];
else {
$op_list[$k] = is_string($row[$orderby]) ? sprintf("%-256s", $row[$orderby]) : sprintf("%016d", $row[$orderby]);
$op_list[$k] .= $row[wr_datetime];
}
$list[$k] = get_list($row, $board, $latest_skin_path, $subject_len);
$list[$k][bo_table] = $board[bo_table];
$list[$k][bo_subject] = $board[bo_subject];
$list[$k][bo_wr_subject] = cut_str($board[bo_subject] . $list[$k][wr_subject], $subject_len);
}
}
if($k>0) array_multisort($op_list, SORT_DESC, $list);
if($k>$rows) array_splice($list, $rows);
ob_start();
include "$latest_skin_path/latest.skin.php";
$content = ob_get_contents();
ob_end_clean();
return $content;
}
/// 함수 정의 끝
?>
<a href=\"$g4[bbs_path]/board.php?bo_table=$bo_table&wr_id=$wr_id\" onFocus=\"this.blur();\" title=\"{$list[$i][subject]}\">".cut_str(strip_tags($list[$i][wr_subject]),61,"…")."</a>
게시판 테이블을 못잡는것 같은데요......
<a href=\"$g4[bbs_path]/board.php?bo_table=$list[$i][bo_table]&wr_id=$wr_id\" onFocus=\"this.blur();\" title=\"{$list[$i][subject]}\">".cut_str(strip_tags($list[$i][wr_subject]),61,"…")."</a>
해보세요.....
히어1님 답변해주셔서 감사합니다.
해봤는데.. 아직도 해결이 안되고 있어요..
한번만 더 답변부탁려도 될까요?
부탁드려요~~
변수를 k로 바꿔도 안되요ㅠㅠ
신경써주셔서 감사합니다..
요즘 저도 그런 느낌이 들때가 있어요.
답변을 작성하시기 전에 로그인 해주세요.