mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-07 18:51:41 +09:00
댓글 링크 문제 수정/ 휴대전화에서도 문단을 구분하기 쉽도록 첫줄 들여쓰기 함.
git-svn-id: http://xe-core.googlecode.com/svn/sandbox@6354 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
a67bc73eb3
commit
9b13392e59
2 changed files with 18 additions and 10 deletions
|
|
@ -237,8 +237,12 @@
|
|||
* HTML 컨텐츠에서 텍스트와 링크만 추출하는 기능
|
||||
**/
|
||||
function setContent($content) {
|
||||
|
||||
$allow_tag_array = array('<a>','<br>','<p>','<b>','<i>','<u>','<em>','<small>','<strong>','<big>','<table>','<tr>','<td>');
|
||||
|
||||
|
||||
// 링크/ 줄바꿈, 강조만 제외하고 모든 태그 제거
|
||||
$content = strip_tags($content, '<a><br><b><i><u><em><small><strong><big><table><tr><td>');
|
||||
$content = strip_tags($content, implode($allow_tag_array));
|
||||
|
||||
// 탭 여백 제거
|
||||
$content = str_replace("\t", "", $content);
|
||||
|
|
@ -253,7 +257,7 @@
|
|||
$content = str_replace('<br/><br/>','<br/>',$content);
|
||||
}
|
||||
|
||||
$content = str_replace(array('$','\'','_'), array('$$',''','­'), $content);
|
||||
$content = str_replace(array('$','\''), array('$$','''), $content);
|
||||
|
||||
// 모바일의 경우 한 덱에 필요한 사이즈가 적어서 내용을 모두 페이지로 나눔
|
||||
$contents = array();
|
||||
|
|
@ -264,11 +268,15 @@
|
|||
|
||||
//$content = str_replace(array('&','<','>','"','&nbsp;'), array('&','<','>','"',' '), $content);
|
||||
|
||||
$tag_open_pos = strpos($content, '<a');
|
||||
$tag_close_pos = strpos($content, '</a>');
|
||||
if($tag_open_pos!==false && $tag_close_pos || $tag_close_pos < $tag_open_pos) {
|
||||
$contents[count($contents)-1] .= substr($content, 0, $tag_close_pos+4);
|
||||
$content = substr($content, $tag_close_pos+4);
|
||||
foreach($allow_tag_array as $tag) {
|
||||
if($tag == '<br>') continue;
|
||||
$tag_open_pos = strpos($content, str_replace('>','',$tag));
|
||||
$tag_close_pos = strpos($content, str_replace('<','</',$tag));
|
||||
|
||||
if($tag_open_pos!==false && $tag_close_pos || $tag_close_pos < $tag_open_pos) {
|
||||
$contents[count($contents)-1] .= substr($content, 0, $tag_close_pos + strlen($tag) + 1);
|
||||
$content = substr($content, $tag_close_pos + strlen($tag) + 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -54,12 +54,12 @@
|
|||
} else {
|
||||
|
||||
// 내용 지정 (태그를 모두 제거한 내용을 설정)
|
||||
$content = strip_tags($oDocument->getContent(false,false,false));
|
||||
$content = strip_tags(str_replace('<p>','<br> ',$oDocument->getContent(false,false,false)),'<br><b><i><u><em><small><strong><big>');
|
||||
|
||||
|
||||
// 내용 상단에 정보 출력 (댓글 보기 링크 포함)
|
||||
$content = Context::getLang('replies').' : <a href="'.getUrl('act','dispBoardContentCommentList').'">'.$oDocument->getCommentCount().'</a><br>'."\r\n".$content;
|
||||
$content = '<b>'.$oDocument->getNickName()."</b> (".$oDocument->getRegdate("Y-m-d").")<br>\r\n".$content;
|
||||
$content = '<b>'.$oDocument->getNickName().'</b> ('.$oDocument->getRegdate("Y-m-d").")<br>\r\n".$content;
|
||||
|
||||
// 내용 설정
|
||||
$oMobile->setContent( $content );
|
||||
|
|
@ -90,7 +90,7 @@
|
|||
$obj = null;
|
||||
$obj['href'] = $val->getPermanentUrl();
|
||||
|
||||
$title = $val->getTitleText();
|
||||
$title = htmlspecialchars($val->getTitleText());
|
||||
if($val->getCommentCount()) $title .= ' ['.$val->getCommentCount().']';
|
||||
$obj['link'] = $obj['text'] = '['.$val->getNickName().'] '.$title;
|
||||
$childs[] = $obj;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue