• mospia님의 답변 으로 만들어진 게시 팁 게시글입니다.

 

XE 스케치북5 목록형 게시판 기준에서 작성됩니다.

 

 

 

 

 

 

 

 

/modules/board/skins/sketchbook5 경로의  _list_normal.html 를 수정해줍니다.

<!--// Normal -->
<tr loop="$document_list=>$no,$document" class="select"|cond="$document_srl==$document->document_srl">

<!-- 추가되는부분 -->

{@
$ex_fir_name = iconv_substr($document->getTitle(),0,9,"utf-8"); 
$ex_count = iconv_strlen($ex_fir_name,"utf-8");
$ex_count = (int)$ex_count;
$ex_last_name = "*";
for($i=0; $i<$ex_count-8; $i++):
$ex_last_name = $ex_last_name."*";
endfor;
}

 

이렇게 추가한 이후

{$document->getTitle($mi->subject_cut_size)}  를 찾아줍니다.

3개가 찾아질텐데 

2번째로 찾아지는것을 밑의 코드를 넣으시면됩니다.

{iconv_substr($document->getTitle(),0,1,"utf-8")}{$ex_last_name}{iconv_substr($document->getTitle(),2,8,"utf-8")}

 

 

초보라 코드해석을 잘못합니다. 틀린부분이있다면 말씀부탁드립니다..

(1)

{@
$ex_fir_name = iconv_substr($document->getTitle(),0,9,"utf-8");  <!-- 제목은 10글자까지 표시 -->
$ex_count = iconv_strlen($ex_fir_name,"utf-8");
$ex_count = (int)$ex_count;
$ex_last_name = "*";
for($i=0; $i<$ex_count-8; $i++):
$ex_last_name = $ex_last_name."*";
endfor;
}

(2)

{iconv_substr($document->getTitle(),0,1,"utf-8")}{$ex_last_name}

                                          1번째 글씨만제외하고(getTitle(),0,1,) 모두 * 표시를하라({$ex_last_name})

 

{iconv_substr($document->getTitle(),2,9,"utf-8")}

하지만 그이후에 2번을제외하고 9번째글자까지 표시하라(getTitle(),2,8,) 입니다.

*표시를해주는건 {$ex_last_name}  입니다.

 

3번째 글자를 *표시하고싶고 10글자까지 표시하고싶다면

{@
$ex_fir_name = iconv_substr($document->getTitle(),0,10,"utf-8");  <!-- 제목은 9글자까지 표시 -->
$ex_count = iconv_strlen($ex_fir_name,"utf-8");
$ex_count = (int)$ex_count;
$ex_last_name = "*";
for($i=0; $i<$ex_count-8; $i++):
$ex_last_name = $ex_last_name."*";
endfor;
}

{iconv_substr($document->getTitle(),0,2,"utf-8")}{$ex_last_name}{iconv_substr($document->getTitle(),3,10,"utf-8")}

 

이런식으로 하면되겠죠?

저도 방법을 찾아보던중

mospia님이 답변을해주셔셔 이리저리 둘러보다가 이렇게 하면되지않을까해서 해봤더니 잘되더군요 

정말감사합니다. mospia님

                                          

 

  • profile
    추가하자면 부자철님께선 getTitle로 제목을 하셨는데 보통 작성자명에 사용하는경우가 많아서 작성자의 앞글자와 뒷글자만 표기하고 중간글자를 *로 표기하는방법은

    {@
    $ex_fir_name = iconv_substr($document->getUserName(),1,10,"utf-8");
    $ex_count = iconv_strlen($ex_fir_name,"utf-8");
    $ex_count = (int)$ex_count;
    $ex_last_name = "*";
    for($i=0; $i<$ex_count-2; $i++):
    $ex_last_name = $ex_last_name."*";
    endfor;
    }

    {$document->getUserName()} 으로 되어있는 부분을
    {iconv_substr($document->getUserName(),0,1,"utf-8")}{$ex_last_name}{iconv_substr($document->getUserName(),-1,-1,"utf-8")}
    로 변경해주시면됩니다.

    닉네임,이름,제목 등등 원하시는모양으로 변형하여 사용하시면됩니다.
  • profile profile

    좋은답글 감사합니다 ㅎㅎ

  • profile
    ㅎㅎ 좋은 팁 감사합니다 ^^
  • profile
    최신글 불러오는 위젯페이지에서는 아마
    $document 이부분을 $item 으로 변경하셔야 할겁니다.
    어제 해보다가... 해보다가... 에러나서.. 저렇게 바꾸었더니.. 되더라구요 ㅎ
  • profile profile
    좋은답글 감사합니다 다이돌이님 ㅎㅎ