mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-05-01 00:02:21 +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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue