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

최신글 본문내용 줄바꿈 문제 (소스한번봐주세요..) 채택완료

초얌 6년 전 조회 3,771

안녕하세요. 테마 최신글 notice 기본스킨을 수정하여

글 제목과 본문을 출력하려고 합니다.

아래와 같은 소스로 메인에 뿌리면 본문이 줄바꿈이 되지않고 가로로만 늘여져서 글이 짤립니다.

소스가 잘못된 부분이 있거나 본문글을 줄바꿈을 할 수 있는 방법을 아시는분은 답변 부탁드리겠습니다..

 

</p>

<p><?php

if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가</p>

<p>// add_stylesheet('css 구문', 출력순서); 숫자가 작을 수록 먼저 출력됨

add_stylesheet('<link rel="stylesheet" href="'.$latest_skin_url.'/style.css">', 0);

add_javascript('<script src="'.G5_JS_URL.'/jquery.bxslider.js"></script>', 10);

?></p>

<p><div class="notice">

    <ul>

    <?php for ($i=0; $i<count($list); $i++) {  ?>

        <li>

            <?php

             //echo $list[$i]['icon_reply']." ";

            echo "<a href=\"".$list[$i]['href']."\">";

            if ($list[$i]['is_notice'])

                echo "<strong>".$list[$i]['subject']."</strong>";

            else

                echo $list[$i]['subject'];

            echo "</a>";</p>

<p>            // if ($list[$i]['link']['count']) { echo "[{$list[$i]['link']['count']}]"; }

            // if ($list[$i]['file']['count']) { echo "<{$list[$i]['file']['count']}>"; }</p>

<p>            //if ($list[$i]['icon_file']) echo " <i class=\"fa fa-download\" aria-hidden=\"true\"></i>" ;

            //if ($list[$i]['icon_link']) echo " <i class=\"fa fa-link\" aria-hidden=\"true\"></i>" ;

            //if ($list[$i]['icon_hot']) echo " <i class=\"fa fa-heart\" aria-hidden=\"true\"></i>";

            

            $content = cut_str(preg_replace("@<.*?>@","", $list[$i]['wr_content']),100); // 내용 자르기</p>

<p>            echo "<p class=\"news_text\">".$content;

            echo "</p>"

            ?>

            <span class="lt_date"><?php echo $list[$i]['datetime2'] ?></span>

        </li>

    <?php }  ?>

    <?php if (count($list) == 0) { //게시물이 없을 때  ?>

    <li class="empty_li">게시물이 없습니다.</li>

    <?php }  ?>

    </ul></p>

<p></div>

<?php if (count($list)) { //게시물이 있다면 ?>

<script>

    $('.notice ul').bxSlider({

        hideControlOnEnd: true,

        pager:false,

        nextText: '<i class="fa fa-angle-right" aria-hidden="true"></i>',

        prevText: '<i class="fa fa-angle-left" aria-hidden="true"></i>'

    });

</script>

<?php } ?></p>

<p>

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

답변 4개

채택된 답변
+20 포인트
6년 전

$content = cut_str(preg_replace("@<.*?>@","", $list[$i]['wr_content']),100); // 내용 자르기

해당부분이 100글자가 되면 글을 자르는 부분입니다

cur_str함수를 제거 하시고 css쪽에서 nowrap처리가 되어있는지 확인해보세요

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

답변에 대한 댓글 1개

초얌
6년 전
nowrap이 문제 였네요.. 이렇게 허무할수가,,
답변 감사합니다^^

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

g
3년 전

@조민 님 오~ 감사합니다. 댓글보고 배우고 갑니다.

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

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

6년 전

에디터가 아니라면..

<?php echo $content=conv_content(preg_replace("@<.*?>@","", $list[$i]['wr_content']),0);?>

 

에디터라면...

<?php echo $content=conv_content(preg_replace("@<.*?>@","", $list[$i]['wr_content']),1);?>

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

답변에 대한 댓글 1개

초얌
6년 전
답변 감사합니다^^

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

toqurk
6년 전

해당 css 에서 word-break:break-all; 를 넣어보세요

 

참고하실만한 사이트 남겨놓을게요

 

https://www.codingfactory.net/10658">https://www.codingfactory.net/10658

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

답변에 대한 댓글 1개

초얌
6년 전
답변 감사합니다^^

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

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

로그인