이건 인덱스에 최신글 위치 나타내는 소스입니다.
Copy
<div id="notice" ><img src="img/notice_t.gif" alt="" style="cursor:pointer;" onclick="javascript:window.location.href='/bbs/board.php?bo_table=notice'"/><br /><?=latest("basic","notice",4,40)?></div>
제가 알기로는 lastes 뒤에(최신글스킨,게시판테이블,줄수,제목길이) 이렇게 인걸로 아는데 제목길이40을 아무리 줄려도 최신글 제목이 모두 출력 되어서 두줄루 나옵니다 ㅠ_ㅠ
아래는 최신글 스킨의 lastest.skin이고
Copy
<?if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가 ?><table width=100% cellpadding=0 cellspacing=0><? for ($i=0; $i<count($list); $i++) { ?><tr> <td colspan=4 align=left> <table width=310 cellpadding=0 cellspacing=0> <tr> <td height=22><img src='<?=$latest_skin_path?>/img/latest_icon.gif' align=absmiddle> <!--카테고리 뿌리기--> <? if ($list[$i]['ca_name']) { echo "<a href='{$list[$i][ca_name_href]}'><b><font color='#2e8613'>[".$list[$i]['ca_name']."]</font></b></a> "; } ?> <? echo $list[$i]['icon_reply'] . " "; echo "<a href='{$list[$i]['href']}'>"; if ($list[$i]['is_notice']) echo "<font style='font-family:돋움; font-size:9pt; color:#2C88B9;'><strong>{$list[$i]['wr_subject']}</strong></font>"; else echo "<font style='font-family:돋움; font-size:9pt; color:#6A6A6A;'>{$list[$i]['wr_subject']}</font>"; echo "</a>"; if ($list[$i]['comment_cnt']) echo " <a href=\"{$list[$i]['comment_href']}\"><span style='font-family:돋움; font-size:8pt; color:#9A9A9A;'>{$list[$i]['comment_cnt']}</span></a>"; // if ($list[$i]['link']['count']) { echo "[{$list[$i]['link']['count']}]"; } // if ($list[$i]['file']['count']) { echo "<{$list[$i]['file']['count']}>"; } echo " " . $list[$i]['icon_new']; echo " " . $list[$i]['icon_file']; echo " " . $list[$i]['icon_link']; echo " " . $list[$i]['icon_hot']; echo " " . $list[$i]['icon_secret']; ?></td></tr> </table></td></tr><? } ?><? if (count($list) == 0) { ?><tr><td colspan=4 align=center height=50><font color=#6A6A6A>게시물이 없습니다.</a></td></tr><? } ?></table>
도움 부탁드리겠습니다. 제목컷이 도대체 왜 안될까요? ㅠㅠ
답변 3개 / 댓글 1개
채택된 답변
+20 포인트
2014-07-07 (월) 15:45:01
일단은 오류가 없는거 같은데, 그래도 안되신다면 출력 부분 latest.skin.php 에 가셔서
<?=cut_str($list[$i][wr_subject, 20, '...');?>
이렇게 한번 해보세요.
답변에 대한 댓글 1개
Copy
// 최신글 추출function latest($skin_dir="", $bo_table, $rows=10, $subject_len=40, $options=""){ global $g4; if ($skin_dir) $latest_skin_path = "$g4[path]/skin/latest/$skin_dir"; else $latest_skin_path = "$g4[path]/skin/latest/basic"; $list = array(); $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 order by wr_id desc limit 0, $rows "; // 위의 코드 보다 속도가 빠름 $sql = " select * from $tmp_write_table where wr_is_comment = 0 order by wr_num limit 0, $rows "; //explain($sql); $result = sql_query($sql); for ($i=0; $row = sql_fetch_array($result); $i++) $list[$i] = get_list($row, $board, $latest_skin_path, $subject_len); ob_start(); include "$latest_skin_path/latest.skin.php"; $content = ob_get_contents(); ob_end_clean(); return $content;}
말씀해주신 소스입니다. 도움 부탁드리겠습니다.
2014-07-07 (월) 15:04:41
출력하는 부분의 소스가 아닌
latest.lib.php 소스롤 보여주셔야 합니다.
답변을 작성하려면 로그인이 필요합니다.