목록에서 글자수 제한 ?? 도와주세요 정보
목록에서 글자수 제한 ?? 도와주세요본문
두가지 질문 드려요~
1. 목록에서 {$list[$i][wr_3]} 부분 글자수 30으로 제한 하려하니 잘 안되네
2. 분류 >> A형|B형|C형|D형 으로 구분해서 글작성 한뒤 해당 분류를 클릭하면
목록이 뿌려지질 않습니다. 기본게시판으로 테스트해도 안되네요. 아무래도 제가
/bbs 파일을 잘못 건드린것 같은데 도움 부탁드립니다.
<?
for ($i=0; $i<count($list); $i++)
{
$title = get_text($list[$i][wr_subject]);
$wr_3 = cut_str(get_text($row[wr_3]),30,"…");
$img = "$g4[path]/data/file/$bo_table/".urlencode($list[$i][file][0][file]);
if (!file_exists($img) || !$list[$i][file][0][file])
$img = "$board_skin_path/img/no_image.gif";
$href = "$g4[bbs_path]/board.php?bo_table=$bo_table&wr_id={$list[$i][wr_id]}&no=1";
$view_href = "";
//if ($is_admin)
$view_href = "<a href='$g4[bbs_path]/board.php?bo_table=$bo_table&wr_id={$list[$i][wr_id]}'>";
$checkbox = "";
if ($is_checkbox)
$checkbox = "<input type=checkbox name=chk_wr_id[] value='{$list[$i][wr_id]}'>";
if($list[$i][wr_2]) $btimg_dc="<img src='$board_skin_path/img/dc.gif' border=0 align=absmiddle>";
else $btimg_dc="";
$tr = "";
if ($i && $i%$board[bo_gallery_cols]==0)
$tr = "</tr><tr>";
echo "$tr";
echo <<<HEREDOC
<td width="{$td_width}%" valign="center" align="center" >
<table width="100%" border="0" cellpadding="2" cellspacing="0" class="dotbox_bg2">
<tr>
<td width="16" align="center" style="padding:5px">
<table width="160" height="150" cellpadding="0" cellspacing="0">
<tr>
<td align="center" valign="middle" style="padding-left:8px">
{$view_href}<img src="{$img}" width="160" height="150" border="0" title="$title"></a></td>
</tr>
</table>
</td>
<td align="left" style="padding-left:25px"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td align="right" style="padding-right:10px">{$view_href}<img src="/skin/board/n_product2/img/but_detail.gif" border="0" ></td>
</tr>
<tr>
<td height="30" align="left" valign="middle" ><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="60%">{$checkbox}{$view_href}<font class="pro_tt01" >{$list[$i][subject]}</font></td>
<td><font class="small" > l </font> <font class="name_org" >{$list[$i][ca_name]}</font></td>
</tr>
</table></td>
</tr>
</tr>
<tr>
<td align="left" class="basic" height="30px">{$list[$i][wr_1]}</td>
</tr>
<tr>
<td align="left" class="small">{$list[$i][wr_3]}</td>
</tr>
</table></td>
</tr>
</table>
<br>
</td><td></td>
HEREDOC;
}
if (count($list) == 0)
echo "<td colspan='$board[bo_gallery_cols]' height=50 align=center>게시물이 없습니다.</td>";
?>
</form>
1. 목록에서 {$list[$i][wr_3]} 부분 글자수 30으로 제한 하려하니 잘 안되네
2. 분류 >> A형|B형|C형|D형 으로 구분해서 글작성 한뒤 해당 분류를 클릭하면
목록이 뿌려지질 않습니다. 기본게시판으로 테스트해도 안되네요. 아무래도 제가
/bbs 파일을 잘못 건드린것 같은데 도움 부탁드립니다.
<?
for ($i=0; $i<count($list); $i++)
{
$title = get_text($list[$i][wr_subject]);
$wr_3 = cut_str(get_text($row[wr_3]),30,"…");
$img = "$g4[path]/data/file/$bo_table/".urlencode($list[$i][file][0][file]);
if (!file_exists($img) || !$list[$i][file][0][file])
$img = "$board_skin_path/img/no_image.gif";
$href = "$g4[bbs_path]/board.php?bo_table=$bo_table&wr_id={$list[$i][wr_id]}&no=1";
$view_href = "";
//if ($is_admin)
$view_href = "<a href='$g4[bbs_path]/board.php?bo_table=$bo_table&wr_id={$list[$i][wr_id]}'>";
$checkbox = "";
if ($is_checkbox)
$checkbox = "<input type=checkbox name=chk_wr_id[] value='{$list[$i][wr_id]}'>";
if($list[$i][wr_2]) $btimg_dc="<img src='$board_skin_path/img/dc.gif' border=0 align=absmiddle>";
else $btimg_dc="";
$tr = "";
if ($i && $i%$board[bo_gallery_cols]==0)
$tr = "</tr><tr>";
echo "$tr";
echo <<<HEREDOC
<td width="{$td_width}%" valign="center" align="center" >
<table width="100%" border="0" cellpadding="2" cellspacing="0" class="dotbox_bg2">
<tr>
<td width="16" align="center" style="padding:5px">
<table width="160" height="150" cellpadding="0" cellspacing="0">
<tr>
<td align="center" valign="middle" style="padding-left:8px">
{$view_href}<img src="{$img}" width="160" height="150" border="0" title="$title"></a></td>
</tr>
</table>
</td>
<td align="left" style="padding-left:25px"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td align="right" style="padding-right:10px">{$view_href}<img src="/skin/board/n_product2/img/but_detail.gif" border="0" ></td>
</tr>
<tr>
<td height="30" align="left" valign="middle" ><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="60%">{$checkbox}{$view_href}<font class="pro_tt01" >{$list[$i][subject]}</font></td>
<td><font class="small" > l </font> <font class="name_org" >{$list[$i][ca_name]}</font></td>
</tr>
</table></td>
</tr>
</tr>
<tr>
<td align="left" class="basic" height="30px">{$list[$i][wr_1]}</td>
</tr>
<tr>
<td align="left" class="small">{$list[$i][wr_3]}</td>
</tr>
</table></td>
</tr>
</table>
<br>
</td><td></td>
HEREDOC;
}
if (count($list) == 0)
echo "<td colspan='$board[bo_gallery_cols]' height=50 align=center>게시물이 없습니다.</td>";
?>
</form>
댓글 전체
1. $wr_3 = cut_str(get_text($row[wr_3]),30,"…"); 사용법이 잘못되었습니다
다음과 같이 수정하세요
$list[$i][wr_3] = cut_str(get_text($list[$i][wr_3]),30,"…");
2. 질문 내용을 모르겠음
다음과 같이 수정하세요
$list[$i][wr_3] = cut_str(get_text($list[$i][wr_3]),30,"…");
2. 질문 내용을 모르겠음
$list[$i][wr_3] = cut_str(get_text($list[$i][wr_3]),30,"…");
혹은
if($list[$i][wr_3]){
$list[$i][wr_3]=conv_subject($list[$i][wr_3],170, "…");
}
하니 되네요. 균이님 답변 감사드립니다.
혹은
if($list[$i][wr_3]){
$list[$i][wr_3]=conv_subject($list[$i][wr_3],170, "…");
}
하니 되네요. 균이님 답변 감사드립니다.
2번째 질문을 다시 설명해 드리자면
게시판설정에서 분류를 적용하고 예) A|B|C|D
해당 분류들 마다 글들을 작성한후 해당게시판(A)을 클릭하면 "게시물이 없습니다." 로 나옴니다.
제가 가로로 뿌려지는 게시판 분류를 적용했습니다. 코드가 잘못된건가 싶어
그누 기본게시판 스킨을 적용해도 그렇습니다. 왜 그럴까요?
게시판설정에서 분류를 적용하고 예) A|B|C|D
해당 분류들 마다 글들을 작성한후 해당게시판(A)을 클릭하면 "게시물이 없습니다." 로 나옴니다.
제가 가로로 뿌려지는 게시판 분류를 적용했습니다. 코드가 잘못된건가 싶어
그누 기본게시판 스킨을 적용해도 그렇습니다. 왜 그럴까요?