테스트 사이트 - 개발 중인 베타 버전입니다

그룹최신글에서 함수입력 그리고 출력까지는 되는데요 링크에서 안되네요. 채택완료

맹구맹구 11년 전 조회 6,433
 
메인 최신글 아래 9개 블럭중
최신교회소식을 
 
관리자페이지에서 그룹으로 묶고
 
그누보드팁에서 그룹함수.lib.php 파일 만들어서 lib폴더에 넣은후
 
메인에 2개 게시판에서 뽑아오는것까지 했는데요...
 
메인에서 글링크하면 삭제되었거나 없는글이라고 나와요
한개 게시판은 정상 링크되는데요..
다른 게시판 하나가 주소가 잘못되서 링크가 안되요
방법좀 알려주세요.. 고수님들 부탁드려요~!
 
 
if(!$options) $options=3;
$cols  = "1"; //  이미지 가로갯수 //  이미지 세로 갯수는 메인에서 지정(총 이미지 수) $image_h  = 0; // 이미지 상하 간격
$col_width = (int)(99 / $cols);
$thumb_path = $data_path.'/thumb';
?>
 
     
                         
                                     
              
    
                                                    
                      
           0 && $i%$cols==0) { echo "
"; }            ?>
           
                        ";            }            ?>             "; } ?>             게시물이 없습니다."; } ?>                       
           
             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']})";
            $bg = "";  //새글?             if ($list[$i][icon_new])              $bg="la_top_2.gif";              else              $bg="la_top_1.gif";
             echo $list[$i][icon_reply] . " ";
             echo "                               [{$list[$i]['ca_name']}] ".cut_str(strip_tags($list[$i][wr_subject]),61,"…")."                                                                                                                   
";            ?>            
         
    
                                      
     
 
 
댓글을 작성하려면 로그인이 필요합니다.

답변 5개

채택된 답변
+20 포인트
11년 전
히어1님  userfunction.lib.php 이거 팁자료실에서 구해서
적용한거에요... 감사합니다..
 
</div>
<div><?
if (!defined('_GNUBOARD_')) exit;
// 함수 정의 시작</div>
<div>// 최신글 추출 - 선택한 그룹별로 원하는 게시판을 제외하고 원하는 수만큼 보여줌
function latest_group($skin_dir="", $gr_id, $rows=10, $subject_len=40, $no_table="", $category="", $orderby="")
{
 global $config;
 global $g4;</div>
<div> $list = array(); $limitrows = $rows;</div>
<div> $sqlgroup = " select bo_table, bo_subject from $g4[board_table] where gr_id = '$gr_id' ";</div>
<div> // 제거할 테이블들
 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' ";
  }
 }</div>
<div> $sqlgroup .= " and bo_use_search=1 order by bo_order_search ";
 $rsgroup = sql_query($sqlgroup);</div>
<div> if ($skin_dir)
  $latest_skin_path = "$g4[path]/skin/latest/$skin_dir";
 else
  $latest_skin_path = "$g4[path]/skin/latest/$config[cf_latest_skin]";</div>
<div> for ($j=0, $k=0; $rowgroup=sql_fetch_array($rsgroup); $j++) {
  $bo_table = $rowgroup[bo_table];</div>
<div>  // 테이블 이름구함
  $sql = " select * from {$g4[board_table]} where bo_table = '$bo_table'";
  $board = sql_fetch($sql);</div>
<div>  $tmp_write_table = $g4[write_prefix] . $bo_table; // 게시판 테이블 실제이름</div>
<div>  // 옵션에 따라 정렬
  $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";</div>
<div>  $result = sql_query($sql);</div>
<div>  for ($i=0; $row = sql_fetch_array($result); $i++, $k++) {</div>
<div>   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];
   }</div>
<div>   $list[$k] = get_list($row, $board, $latest_skin_path, $subject_len);</div>
<div>   $list[$k][bo_table] = $board[bo_table];
   $list[$k][bo_subject] = $board[bo_subject];</div>
<div>   $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);</div>
<div> ob_start();
 include "$latest_skin_path/latest.skin.php";
 $content = ob_get_contents();
 ob_end_clean();
 return $content;
}
/// 함수 정의 끝
?></div>
<div>
 
로그인 후 평가할 수 있습니다

답변에 대한 댓글 1개

히어1
11년 전
<a href=\"$g4[bbs_path]/board.php?bo_table=$list[$k][bo_table]&wr_id=$wr_id\" onFocus=\"this.blur();\" title=\"{$list[$i][subject]}\">".cut_str(strip_tags($list[$i][wr_subject]),61,"…")."</a>

이렇게 한번 해보세요......될지는 모르겟어요......

댓글을 작성하려면 로그인이 필요합니다.

7년 전

요즘 저도 그런 느낌이 들때가 있어요.

로그인 후 평가할 수 있습니다

댓글을 작성하려면 로그인이 필요합니다.

11년 전
변수를 k로 바꿔도 안되요ㅠㅠ
신경써주셔서 감사합니다..
로그인 후 평가할 수 있습니다

댓글을 작성하려면 로그인이 필요합니다.

11년 전
히어1님 답변해주셔서 감사합니다.
 
해봤는데.. 아직도 해결이 안되고 있어요..
 
한번만 더 답변부탁려도 될까요?
 
부탁드려요~~
로그인 후 평가할 수 있습니다

답변에 대한 댓글 1개

히어1
11년 전
lib.php 를 올려보세요

댓글을 작성하려면 로그인이 필요합니다.

11년 전
 
게시판 테이블을 못잡는것 같은데요......
 
 
해보세요.....
로그인 후 평가할 수 있습니다

댓글을 작성하려면 로그인이 필요합니다.

답변을 작성하려면 로그인이 필요합니다.

로그인