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

그룹최신글 질문드립니다.. 답변좀 부탁드려요 채택완료

맹구맹구 11년 전 조회 4,773
그룹최신글 함수 적용해서 불러오는것 까지는 되었는데요..
링크시 각각의 게시판으로 링크가 안되요.. 고수님 도와주세요
 
최신글 함수-팁자료실에서 보고 적용했어요
</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>
 
 
최신글 소스 lastet.skin.php
</div>
<div><?
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가 </div>
<div>if(!$options) $options=3;</div>
<div>$cols  = "1"; //  이미지 가로갯수 //  이미지 세로 갯수는 메인에서 지정(총 이미지 수)
$image_h  = 0; // 이미지 상하 간격</div>
<div>$col_width = (int)(99 / $cols);</div>
<div>$thumb_path = $data_path.'/thumb';
?></div>
<div><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; }</div>
<div>.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></div>
<div><table width=100% border=0  valign="middle"  cellpadding=0 cellspacing=0  style="padding-top:8px;"></div>
<div>  <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"></div>
<div>    <!-- 이미지보이는 부분 시작 -->
    <table  cellpadding="0" cellspacing="0" width="100%" border="0">
    <tr><td></div>
<div>       <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></div>
<div>           <? 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>"; } 
           ?> </div>
<div>           <td width="<?=$col_width?>%" valign='top'></div>
<div>           <?
           $image = $list[$i][file][0][file]; //원본
           $img=$data_path. "/".$image;  //썸네일이 없을경우 원본출력
           $thumb = $thumb_path. "/". $list[$i][wr_id];</div>
<div>             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']})";</div>
<div>            $bg = "";  //새글? 
            if ($list[$i][icon_new])
             $bg="la_top_2.gif";
             else
             $bg="la_top_1.gif";</div>
<div>             echo $list[$i][icon_reply] . " ";</div>
<div>             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=$board[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></div>
<div>
 
 
저희사이트
두번째줄 광고란부분에 적용했습니다.
 
부탁드립니다. 몇날을 찾고 해메도 디자이너라서 그런지  
코드 머리가 안돌아가요.ㅠㅠ
 
 
댓글을 작성하려면 로그인이 필요합니다.

답변 5개

채택된 답변
+20 포인트
11년 전
</div>
<div><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=\"{$list[$i]['href']}&wr_id=$wr_id\" onFocus=\"this.blur();\" title=\"{$list[$i][subject]}\">".cut_str(strip_tags($list[$i][wr_subject]),61,"…")."</a> </span></td></div>
<div>
 
이렇게 수정하니까 됐어요..ㅎㅎㅎ
 
로그인 후 평가할 수 있습니다

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

7년 전

많은 도움이 되었습니다. 감사합니다.

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

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

11년 전
답변주셔서 감사합니다.

바꿔봤는데요.. 다른 글도 안들어가져요..

array [bo_table] 로 주소가 잡혀요....ㅠㅠ


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

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

11년 전
맨아래글은 다른 게시판인데 제대로 안가요 ㅠㅠ
로그인 후 평가할 수 있습니다

답변에 대한 댓글 1개

A
ATGC
11년 전
[code]
<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>&nbsp;<a href=\"$g4[bbs_path]/board.php?bo_table=$board[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>
[/code]

아래 문서에서 중간에 이 부분을요..

[code]
<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>&nbsp;<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> </span></td>
[/code]

이렇게 바꿔보세요.. bo_table 값이 잘못 들어가있네요./

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

A
11년 전
누르면 해당글로 가는데요..


[]안에 들어가있는 카테고리명 누르면 해당되는 글만 보이는거 말씀하시는건가요..
로그인 후 평가할 수 있습니다

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

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

로그인