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

리스트에서 뷰페이지 내용(wr_content) 글자수 제안하기 알려주세요

· 12년 전 · 2861 · 6
리스트 페이지에서 내용글자수 제안


====
해당페이지 소스


<?
for ($i=0; $i<count($list); $i++) {
if ($i && $i%$mod==0)
echo "</tr><tr>";

$style = "";
$subject = "<span $style>{$list[$i][subject]}</span>";



$comment_cnt = "";
if ($list[$i][comment_cnt])
$comment_cnt = " <a href=\"{$list[$i][comment_href]}\"><span style='font-size:10px;'><font face='Tahoma' color='#EE5A00'>{$list[$i][comment_cnt]}</span></a>";

$list[$i][name] = preg_replace("/<img /", "<img style='display:none;' ", $list[$i][name]);
$list[$i][name] = preg_replace("/> <span/", "><span", $list[$i][name]);
$list[$i][name] = preg_replace("/class='member'/", "", $list[$i][name]);

echo "<td width='{$td_width}%' valign=top style='word-break:break-all; padding:0px;'>";
echo "<table align=center>";
echo "<tr><td height=15></td></tr>";
echo "<tr><td align=left>
<div style='float:left; border:1px solid #ccc; background:#fff; padding-left:5px; padding-top:5px; padding-right:5px; padding-bottom:15px; font-size:0; line-height:0;'>
<a href='{$list[$i][href]}'>".makeThumbs($g4[path]."/data/file/$bo_table", $list[$i][file][0][file], $board[bo_1], $board[bo_2], cut_str($list[$i][subject],20))."</a>



</div>
</td></tr>";
//echo "<tr><td align=center style='font-size:11px; color:#888;'>Date.".$list[$i][datetime2]." / Hit.".$list[$i][wr_hit]."</td></tr>";
echo "<tr><td align=center class=lh>";
if ($is_category) echo "<a href='{$list[$i][ca_name_href]}'>[{$list[$i][ca_name]}]</a> ";
echo "<a href='{$list[$i][href]}'>$subject</a><span class='comment'>{$comment_cnt}</span>";
//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];
echo "</td></tr>";
echo "<tr><td align=left class=lh>{$list[$i][wr_content]}</td></tr>";
echo "<tr><td align=left class=lh>{$list[$i][name]}</td></tr>";
echo "<tr><td align=left class=lh>{$list[$i][wr_good]}{$list[$i][wr_hit]}</td></tr>";
if ($is_checkbox) echo "<tr><td align=center><input type=checkbox name=chk_wr_id[] value='{$list[$i][wr_id]}'></td></tr>";
echo "</table></td>\n";
}

// 나머지 td
$cnt = $i%$mod;
if ($cnt)
for ($i=$cnt; $i<$mod; $i++)
echo "<td width='{$td_width}%'>&nbsp;</td>";
?>


====
echo "<tr><td align=left class=lh> {$list[$i][wr_content]} </td></tr>";


{$list[$i][wr_content]}

위와같이 가져오면 뷰페이지에 있는 내용(글자)을 전부들오어고 있습니다.

글자수를 제안하려면 어떻게 해야 하나요.


===========

다른 게시판에서 보면
<?=cut_str(strip_tags($list[$i][wr_content]),210,"…")?>

댓글 작성

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

로그인하기

댓글 6개

작성하신대로

<?=cut_str(strip_tags($list[$i][wr_content]),210,"…")?>

넣으시면 글자수가 210으로 제한되어잇는데 해보셧나요
이렇게 넣으면 오류메시지가 나오네요~~~
<? ?>안에
{$list[$i][wr_content]} //내용
{$list[$i][name]} //작성자
{$list[$i][wr_hit]} //조회수
이렇게 가져오고 있음
<?=cut_str(strip_tags($list[$i][wr_content]),210,"…")?>에 넣으면

<? <?=cut_str(strip_tags($list[$i][wr_content]),210,"…")?> ?>에 되는거라서 오류가 나오고 있습니다.
for문 다음에다 $subject=cut_str(~~~); 이 코드를 넣고 출력하는 부분에는 $subject를 출력하면 됩니다
죄송하지만 제가 디자이너라서 이렇게 말씀해 주시면 잘 몰라요...

$subject = "<span $style>{$list[$i][subject]}</span>";
아래줄에 집어넣어야 하나요.

위치와 소스 적어주시면 안되나요.
fot문에 $subject 아래 아래 코드추가한다.
$content = cut_str(strip_tags($list[$i][wr_content]),"200","..."); //200글자수 제안

원하는 위치에 $content 삽입한다.
균이님의 흰트를 얻어서 작업하였습니다.

감사합니다.

게시글 목록

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