모바일페이지에서 제목 제대로 표시 안되는 문제 수정.

코드에 있던 의미없는 띄어쓰기 지움.

git-svn-id: http://xe-core.googlecode.com/svn/sandbox@6352 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
misol 2009-05-22 05:24:06 +00:00
parent 3c8d07f26b
commit d671abf949
5 changed files with 24 additions and 15 deletions

View file

@ -16,13 +16,16 @@
* @brief hdml 헤더 출력 * @brief hdml 헤더 출력
**/ **/
function printHeader() { function printHeader() {
print("<html>\n"); print("<html><head>\n");
if($this->totalPage > $this->mobilePage) $titlePageStr = sprintf("(%d/%d)",$this->mobilePage, $this->totalPage);
printf("<title>%s%s</title></head><body>\n", htmlspecialchars($this->title),htmlspecialchars($titlePageStr));
} }
// 제목을 출력 // 제목을 출력
function printTitle() { function printTitle() {
if($this->totalPage > $this->mobilePage) $titlePageStr = sprintf("(%d/%d)",$this->mobilePage, $this->totalPage); if($this->totalPage > $this->mobilePage) $titlePageStr = sprintf("(%d/%d)",$this->mobilePage, $this->totalPage);
printf('&lt;%s%s&gt;<br>%s', $this->title,$titlePageStr,"\n"); $this->title = str_replace(array('$','\'','_'), array('$$','&apos;','&shy;'), $this->title);
printf('&lt;%s%s&gt;<br>%s', htmlspecialchars($this->title),htmlspecialchars($titlePageStr),"\n");
} }
/** /**
@ -64,7 +67,7 @@
// 푸터 정보를 출력 // 푸터 정보를 출력
function printFooter() { function printFooter() {
print("</html>\n"); print("</body></html>\n");
} }
} }
?> ?>

View file

@ -220,7 +220,9 @@
* @brief title 지정 * @brief title 지정
**/ **/
function setTitle($title) { function setTitle($title) {
$oModuleController = &getController('module');
$this->title = $title; $this->title = $title;
$oModuleController->replaceDefinedLangCode($this->title);
} }
/** /**
@ -235,11 +237,8 @@
* HTML 컨텐츠에서 텍스트와 링크만 추출하는 기능 * HTML 컨텐츠에서 텍스트와 링크만 추출하는 기능
**/ **/
function setContent($content) { function setContent($content) {
// 링크/줄바꿈을 임의의 문자열로 변경하고 태그 모두 제거 // 링크/ 줄바꿈, 강조만 제외하고 모든 태그 제거
$content = strip_tags(preg_replace('/<(\/?)(a|br)/i','[$1$2', $content)); $content = strip_tags($content, '<a><br><b>');
// 링크/줄바꿈을 다시 원위치
$content = preg_replace('/\[(\/?)(a|br)/i','<$1$2', $content);
// 탭 여백 제거 // 탭 여백 제거
$content = str_replace("\t", "", $content); $content = str_replace("\t", "", $content);
@ -247,11 +246,15 @@
// 2번 이상 반복되는 공백과 줄나눔을 제거 // 2번 이상 반복되는 공백과 줄나눔을 제거
$content = preg_replace('/( ){2,}/s', '', $content); $content = preg_replace('/( ){2,}/s', '', $content);
$content = preg_replace("/([\r\n]+)/s", "\r\n", $content); $content = preg_replace("/([\r\n]+)/s", "\r\n", $content);
$content = str_replace(array("<A","<BR","<Br","<br>","<BR>","<br />"), array("<a","<br","<br","<br/>","<br/>","<br/>"), $content); $content = preg_replace(array("/<a/i","/<\/a/i","/<b/i","/<\/b/i","/<br/i"),array('<a','</a','<b','</b','<br'),$content);
$content = str_replace(array("<br>","<br />"), array("<br/>","<br/>"), $content);
while(strpos($content, '<br/><br/>')) { while(strpos($content, '<br/><br/>')) {
$content = str_replace('<br/><br/>','<br/>',$content); $content = str_replace('<br/><br/>','<br/>',$content);
} }
$content = str_replace(array('$','\'','_'), array('$$','&apos;','&shy;'), $content);
// 모바일의 경우 한 덱에 필요한 사이즈가 적어서 내용을 모두 페이지로 나눔 // 모바일의 경우 한 덱에 필요한 사이즈가 적어서 내용을 모두 페이지로 나눔
$contents = array(); $contents = array();
while($content) { while($content) {
@ -368,7 +371,7 @@
// 변환 후 출력 // 변환 후 출력
if(strtolower($this->charset) == 'utf-8') print $content; if(strtolower($this->charset) == 'utf-8') print $content;
else print iconv('UTF-8',$this->charset, $content); else print iconv('UTF-8',$this->charset."//TRANSLIT", $content);
exit(); exit();
} }

View file

@ -18,8 +18,10 @@
function printHeader() { function printHeader() {
header("Content-Type: text/vnd.wap.wml"); header("Content-Type: text/vnd.wap.wml");
header("charset: ".$this->charset); header("charset: ".$this->charset);
if($this->totalPage > $this->mobilePage) $titlePageStr = sprintf("(%d/%d)",$this->mobilePage, $this->totalPage);
print("<?xml version=\"1.0\" encoding=\"".$this->charset."\"?><!DOCTYPE wml PUBLIC \"-//WAPFORUM//DTD WML 1.1//EN\" \"http://www.wapforum.org/DTD/wml_1.1.xml\">\n"); print("<?xml version=\"1.0\" encoding=\"".$this->charset."\"?><!DOCTYPE wml PUBLIC \"-//WAPFORUM//DTD WML 1.1//EN\" \"http://www.wapforum.org/DTD/wml_1.1.xml\">\n");
print("<wml>\n<card>\n<p>\n"); // 카드제목
printf("<wml>\n<card title=\"%s%s\">\n<p>\n",htmlspecialchars($this->title),htmlspecialchars($titlePageStr));
} }
/** /**
@ -27,7 +29,8 @@
**/ **/
function printTitle() { function printTitle() {
if($this->totalPage > $this->mobilePage) $titlePageStr = sprintf("(%d/%d)",$this->mobilePage, $this->totalPage); if($this->totalPage > $this->mobilePage) $titlePageStr = sprintf("(%d/%d)",$this->mobilePage, $this->totalPage);
printf('&lt;%s%s&gt;<br/>%s', $this->title,$titlePageStr,"\n"); $this->title = str_replace(array('$','\'','_'), array('$$','&apos;','&shy;'), $this->title);
printf('&lt;%s%s&gt;<br/>%s', htmlspecialchars($this->title),htmlspecialchars($titlePageStr),"\n");
} }
/** /**

View file

@ -41,7 +41,7 @@
$oComment->setAttribute($val); $oComment->setAttribute($val);
if(!$oComment->isAccessible()) continue; if(!$oComment->isAccessible()) continue;
$content .= "<b>".$oComment->getNickName()."</b> (".$oComment->getRegdate("Y-m-d").")<br>\r\n".$oComment->getContent(false,false)."<br>\r\n"; $content .= "<b>".$oComment->getNickName()."</b> (".$oComment->getRegdate("Y-m-d").")<br>\r\n".$oComment->getContent(false,false)."<br>\r\n";
} }
} }
// 내용 설정 // 내용 설정

View file

@ -33,12 +33,12 @@
</p> </p>
<!--@end--> <!--@end-->
<p class="save"> <p class="save">
<input type="checkbox" name="keep_signed" id="keepid" value="Y" onclick="if(this.checked) return confirm(keep_signed_msg);"/> <input type="checkbox" name="keep_signed" id="keepid" value="Y" onclick="if(this.checked) return confirm(keep_signed_msg);" />
<label for="keepid">{$lang->keep_signed}</label> <label for="keepid">{$lang->keep_signed}</label>
<!--@if($member_config->enable_openid=='Y')--> <!--@if($member_config->enable_openid=='Y')-->
<br /> <br />
<input name="use_open_id" id="use_open_id" type="checkbox" value="Y" onclick="toggleLoginForm(this); return false;"/> <input name="use_open_id" id="use_open_id" type="checkbox" value="Y" onclick="toggleLoginForm(this); return false;" />
<label for="use_open_id">Open ID</label> <label for="use_open_id">Open ID</label>
<!--@end--> <!--@end-->
</p> </p>