Skip to content

Commit

Permalink
refs #1198, #1443
Browse files Browse the repository at this point in the history
  * Linking pages to slogan URL
  * 이제 블로그 주소 끝에 임의의 URL을 입력할 경우 그에 해당하는 page의 slogan이 있으면 바로 보여줍니다.
  * The simplest is the best.
  • Loading branch information
inureyes committed Dec 31, 2010
1 parent 1c0359c commit e75c82c
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 2 deletions.
7 changes: 6 additions & 1 deletion framework/Dispatcher.php
Original file line number Diff line number Diff line change
Expand Up @@ -168,16 +168,21 @@ private function URIinterpreter() {
$interfacePath = 'interface/'.$pathPart.'/index.php';
break;
default:
if(!empty($uri['fragment'][0])) {
$pathPart = '';
$interfacePath = 'interface/page.php';
}
}
}

}
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;
Expand Down
2 changes: 1 addition & 1 deletion framework/model/URIHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -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'), '/');
Expand Down
34 changes: 34 additions & 0 deletions interface/page.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<?php
/// Copyright (c) 2004-2010, Needlworks / Tatter Network Foundation
/// All rights reserved. Licensed under the GPL.
/// See the GNU General Public License for more details. (/documents/LICENSE, /documents/COPYRIGHT)
require ROOT . '/library/preprocessor.php';

define('__TEXTCUBE_PAGE__',true);
if (isset($suri['id']) || (isset($suri['value']) && strlen($suri['value']) > 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', '<div class="TCwarning">' . _text('존재하지 않는 페이지입니다.') . '</div>', $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;
}
?>

0 comments on commit e75c82c

Please # to comment.