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

첫글내용이 나오는 공지사항 스킨 문의드립니다.

· 15년 전 · 1488 · 3
첫글이 내용이 나오는 공지사항을 사용하고 있습니다.

제가 다운 받은 자료는 링크에 걸어놨습니다.

스킨적용은 잘됩니다..그런데 내용이 100자든 1000자든 모두 출력이 된다는게 문제네요..

불러올 페이지에는 <?=latest("freeboard", "notice", 6, 25)?> 이렇게 적용했습니다..
스킨다운페이지에는 사용법이 없어 그냥 일반 게시물불러올때 처럼 이용하고 있습니다.

아래 소스에서 어떻게 하면 내용을 줄일수가 있나요?
그리고 첫글이 나오는 내용박스는 테두리를 입히고 싶은데.. 고수님들 부탁드리겠습니다..

소스 수정 좀 부탁드릴께요..정말 저한테는 중요한 작업이라 5,000포인트 드립니다...


---------------------소스시작---------------------
<?
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
?>
<table width="100%" border="0" cellpadding="0" cellspacing="0" bgcolor="#F4F4F4">
<tr>
<td width="100%" height="1" bgcolor="e5e5e5" colspan="2"></td>
</tr>
<tr>
<td width="100%" height="2" colspan="2"></td>
</tr>

<tr>
<td width="100%" height="2" colspan="2"></td>
</tr>
<tr>
<td width="100%" height="1" bgcolor="f4f4f4" colspan="2"></td>
</tr>
<? for ($j=0; $j<1; $j++) { ?>
<tr>
<td width="1063" style="padding-left: 10px; padding-top: 12px; padding-bottom: 9px; line-height: 20px;"><b><a href='<?=$list[$j][href]?>'><?=$list[$j][wr_subject]?></a><?=$list[$i][subject]?></b><br><?=nl2br(stripslashes($list[$j][wr_content]))?></td>
<td width="148" style="line-height:10px; padding-top:12px; padding-bottom:9px; padding-left:0px;"><span style="font-family:Tahoma;font-size:7pt"><?=$list[$j][datetime2]?></span></td>
</tr>
<? } ?>
<? for ($i=1; $i<count($list); $i++) { ?>
<tr>
<td width="100%" height="1" bgcolor="f4f4f4" colspan="2"></td>
</tr>
<tr>
<td width="1073" height="25" style="padding-top: 4px;" OnMouseOver="this.style.backgroundColor='#f4f4f4';" OnMouseOut="this.style.backgroundColor='#FFFFFF'">&nbsp;&nbsp;<img src="<?=$latest_skin_path?>/img/arrow.jpg" align="absmiddle" width="7" height="7">&nbsp;<a href='<?=$list[$i][href]?>'><?=$list[$i][subject]?></a></td>
<td width="158" height="25" style="padding-top:4px;"><a href='<?=$list[$i][href]?>'><span style="font-family:Tahoma;font-size:7pt"><?=$list[$i][datetime2]?></span></a></td>
</tr>
<? } ?>
<tr>
<td width="100%" height="1" bgcolor="f4f4f4" colspan="2"></td>
</tr>
</table>

댓글 작성

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

로그인하기

댓글 3개

bbs/common.lib.php 에보시면
cut_str($str, $len, $suffix="…") 함수와 get_text($str, $html=0) 함수가 있습니다
1. cut_str 풀이하자면 $str(내용) $len(몇글자까지보이기) $suffix(끝에 원하는거 붙이기)
2. get_text 풀이하자면 $str(내용) $html(내용을 텍스트로 html로 출력)


<?=nl2br(stripslashes($list[$j][wr_content]))?> 을 다음과 같이하시면됩니다.
<?=cut_str(nl2br(stripslashes($list[$j][wr_content])),30)?>

그럼..
15년 전
답변감사합니다..죄송하지만 그럼 제목란에 코멘트를 나오게 할려면 어떻게 해야하나요??
코멘트수인지.. ^^

bbs/common.lib.php 에서 get_list 함수를 살펴보시면됩니다만.
다음과 같이 되어있습니다.

$list['comment_cnt'] = "";
if ($list['wr_comment'])
$list['comment_cnt'] = "($list[wr_comment])";


수정한다면..
<?
for ($i=1; $i<count($list); $i++) {

$list[$i][comment_cnt] ="";
if ($list[$i][wr_comment])
$list[$i][comment_cnt] = "($list[$i][wr_comment])";
?>





위와같이 하고

$list[$i][comment_cnt] 을 원하시는곳에 붙이시면..

게시글 목록

번호 제목
284508
284499
284492
284490
284484
284481
284478
284476
284474
284472
284470
284458
284457
284454
284453
284447
284446
284444
284441
284440