From e75c82cd5fd85f4da7a44ad2b5b7446d73778f76 Mon Sep 17 00:00:00 2001 From: inureyes Date: Fri, 31 Dec 2010 01:15:34 +0000 Subject: [PATCH] =?UTF-8?q?=20refs=20#1198,=20#1443=20=20=20*=20Linking=20?= =?UTF-8?q?pages=20to=20slogan=20URL=20=20=20*=20=EC=9D=B4=EC=A0=9C=20?= =?UTF-8?q?=EB=B8=94=EB=A1=9C=EA=B7=B8=20=EC=A3=BC=EC=86=8C=20=EB=81=9D?= =?UTF-8?q?=EC=97=90=20=EC=9E=84=EC=9D=98=EC=9D=98=20URL=EC=9D=84=20?= =?UTF-8?q?=EC=9E=85=EB=A0=A5=ED=95=A0=20=EA=B2=BD=EC=9A=B0=20=EA=B7=B8?= =?UTF-8?q?=EC=97=90=20=ED=95=B4=EB=8B=B9=ED=95=98=EB=8A=94=20page?= =?UTF-8?q?=EC=9D=98=20slogan=EC=9D=B4=20=EC=9E=88=EC=9C=BC=EB=A9=B4=20?= =?UTF-8?q?=EB=B0=94=EB=A1=9C=20=EB=B3=B4=EC=97=AC=EC=A4=8D=EB=8B=88?= =?UTF-8?q?=EB=8B=A4.=20=20=20*=20The=20simplest=20is=20the=20best.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- framework/Dispatcher.php | 7 ++++++- framework/model/URIHandler.php | 2 +- interface/page.php | 34 ++++++++++++++++++++++++++++++++++ 3 files changed, 41 insertions(+), 2 deletions(-) create mode 100644 interface/page.php diff --git a/framework/Dispatcher.php b/framework/Dispatcher.php index 9fcbf35c0..de866d59e 100644 --- a/framework/Dispatcher.php +++ b/framework/Dispatcher.php @@ -168,6 +168,10 @@ private function URIinterpreter() { $interfacePath = 'interface/'.$pathPart.'/index.php'; break; default: + if(!empty($uri['fragment'][0])) { + $pathPart = ''; + $interfacePath = 'interface/page.php'; + } } } @@ -175,9 +179,10 @@ private function URIinterpreter() { if (empty($interfacePath)) $interfacePath = 'interface/'.(empty($pathPart) ? '' : $pathPart.'/').'index.php'; define('PATH', 'interface/'.(empty($pathPart) ? '' : $pathPart.'/')); unset($pathPart); - if (!file_exists($interfacePath)) { + if (!file_exists($interfacePath)) { header("HTTP/1.0 404 Not Found");exit; } + unset($pathPart); $uri['interfacePath'] = $this->interfacePath = $interfacePath; } $this->uri = $uri; diff --git a/framework/model/URIHandler.php b/framework/model/URIHandler.php index d8c5e2a51..adecc5424 100644 --- a/framework/model/URIHandler.php +++ b/framework/model/URIHandler.php @@ -32,7 +32,7 @@ private function __URIParser() { $url = $this->uri['fullpath']; $defaultblogid = Setting::getServiceSetting("defaultBlogId",1,true); - $this->suri = array('url' => $url, 'value' => ''); + $this->suri = array('url' => $url, 'value' => ''); $this->blogid = null; $this->uri['isStrictBlogURL'] = true; $depth = substr_count($this->context->getProperty('path'), '/'); diff --git a/interface/page.php b/interface/page.php new file mode 100644 index 000000000..8340f1b24 --- /dev/null +++ b/interface/page.php @@ -0,0 +1,34 @@ + 0)) { + if (!isset($suri['id']) || (Setting::getBlogSettingGlobal('useSloganOnPost',1) == 1)) { + list($entries, $paging) = getEntryWithPagingBySlogan($blogid, $suri['value'], true); + } else { + list($entries, $paging) = getEntryWithPaging($blogid, $suri['id'], true); + } + fireEvent('OBStart'); + require ROOT . '/interface/common/blog/begin.php'; + + if (empty($entries)) { + header('HTTP/1.1 404 Not Found'); + if (empty($skin->pageError)) { + dress('article_rep', '
' . _text('존재하지 않는 페이지입니다.') . '
', $view); + } else { + dress('article_rep', NULL, $view); + dress('page_error', $skin->pageError, $view); + } + unset($paging); + } else { + require ROOT . '/interface/common/blog/entries.php'; + } + require ROOT . '/interface/common/blog/end.php'; + fireEvent('OBEnd'); +} else { + header("HTTP/1.1 404 Not Found");exit; +} +?>