mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-30 00:29:58 +09:00
git-svn-id: http://xe-core.googlecode.com/svn/trunk@1491 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
efa943ac26
commit
6221f0a444
14 changed files with 68 additions and 46 deletions
18
.htaccess
18
.htaccess
|
|
@ -1,13 +1,7 @@
|
||||||
RewriteEngine On
|
RewriteEngine On
|
||||||
|
|
||||||
# rss
|
# page
|
||||||
RewriteRule ^([a-zA-Z0-9_]+)/rss$ ./index.php?mid=$1&act=dispRss [L]
|
RewriteRule ^([a-zA-Z0-9_]+)/([[:digit:]]+)page$ ./index.php?mid=$1&page=$2 [L]
|
||||||
|
|
||||||
# trackback
|
|
||||||
RewriteRule ^([[:digit:]]+)/trackback$ ./index.php?module=trackback&act=procTrackbackReceive&document_srl=$1 [L]
|
|
||||||
|
|
||||||
# blog api permanent link
|
|
||||||
RewriteRule ^([a-zA-Z0-9_]+)/api$ ./index.php?act=blogapi&mid=$1 [L]
|
|
||||||
|
|
||||||
# administrator page
|
# administrator page
|
||||||
RewriteRule ^admin$ ./index.php?module=admin [L]
|
RewriteRule ^admin$ ./index.php?module=admin [L]
|
||||||
|
|
@ -15,8 +9,14 @@ RewriteRule ^admin$ ./index.php?module=admin [L]
|
||||||
# document permanent link
|
# document permanent link
|
||||||
RewriteRule ^([[:digit:]]+)$ ./index.php?document_srl=$1 [L]
|
RewriteRule ^([[:digit:]]+)$ ./index.php?document_srl=$1 [L]
|
||||||
|
|
||||||
# module + document permanent link
|
# document + act permanent link
|
||||||
|
RewriteRule ^([[:digit:]]+)/([a-zA-Z0-9_]+)$ ./index.php?document_srl=$1&act=$2 [L]
|
||||||
|
|
||||||
|
# mid + document permanent link
|
||||||
RewriteRule ^([a-zA-Z0-9_]+)/([[:digit:]]+)$ ./index.php?mid=$1&document_srl=$2 [L]
|
RewriteRule ^([a-zA-Z0-9_]+)/([[:digit:]]+)$ ./index.php?mid=$1&document_srl=$2 [L]
|
||||||
|
|
||||||
|
# mid + act permanent link
|
||||||
|
RewriteRule ^([a-zA-Z0-9_]+)/([a-zA-Z0-9_]+)$ ./index.php?mid=$1&act=$2 [L]
|
||||||
|
|
||||||
# module permanent link
|
# module permanent link
|
||||||
RewriteRule ^([a-zA-Z0-9_]+)(/){0,1}$ ./index.php?mid=$1 [L]
|
RewriteRule ^([a-zA-Z0-9_]+)(/){0,1}$ ./index.php?mid=$1 [L]
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,5 @@
|
||||||
<?php
|
<?php
|
||||||
if(!defined("__ZBXE__")) exit();
|
if(!defined("__ZBXE__")) exit();
|
||||||
//debugPrint($GLOBALS['HTTP_RAW_POST_DATA']);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @file blogapicounter.addon.php
|
* @file blogapicounter.addon.php
|
||||||
|
|
@ -12,7 +11,7 @@
|
||||||
**/
|
**/
|
||||||
|
|
||||||
// called_position가 before_module_proc일때 실행
|
// called_position가 before_module_proc일때 실행
|
||||||
if($called_position != 'before_module_proc' || $_REQUEST['act'] != 'blogapi') return;
|
if($called_position != 'before_module_proc' || $_REQUEST['act'] != 'api') return;
|
||||||
|
|
||||||
// 관련 func 파일 읽음
|
// 관련 func 파일 읽음
|
||||||
require_once('./addons/blogapi/blogapi.func.php');
|
require_once('./addons/blogapi/blogapi.func.php');
|
||||||
|
|
@ -151,6 +150,8 @@
|
||||||
$obj->content = str_replace($this->mid.'/{UPLOADED_PATH}',sprintf('./files/attach/images/%s/%s/%s', $this->module_srl, $document_srl, $filename), $obj->content);
|
$obj->content = str_replace($this->mid.'/{UPLOADED_PATH}',sprintf('./files/attach/images/%s/%s/%s', $this->module_srl, $document_srl, $filename), $obj->content);
|
||||||
|
|
||||||
$oDocumentController = &getController('document');
|
$oDocumentController = &getController('document');
|
||||||
|
$obj->allow_comment = 'Y';
|
||||||
|
$obj->allow_trackback = 'Y';
|
||||||
$output = $oDocumentController->insertDocument($obj);
|
$output = $oDocumentController->insertDocument($obj);
|
||||||
|
|
||||||
if(!$output->toBool()) {
|
if(!$output->toBool()) {
|
||||||
|
|
|
||||||
|
|
@ -26,7 +26,8 @@
|
||||||
var $html_header = NULL; ///< @brief display시에 사용하게 되는 <head>..</head>내의 스크립트. 거의 사용할 일은 없음
|
var $html_header = NULL; ///< @brief display시에 사용하게 되는 <head>..</head>내의 스크립트. 거의 사용할 일은 없음
|
||||||
var $html_footer = NULL; ///< @brief display시에 사용하게 되는 </body> 바로 앞에 추가될 코드
|
var $html_footer = NULL; ///< @brief display시에 사용하게 되는 </body> 바로 앞에 추가될 코드
|
||||||
|
|
||||||
var $rewrite = false;
|
var $allow_rewrite = false;
|
||||||
|
var $path = '';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief 언어 정보
|
* @brief 언어 정보
|
||||||
|
|
@ -89,6 +90,12 @@
|
||||||
$this->_set('is_logged', false);
|
$this->_set('is_logged', false);
|
||||||
$this->_set('logged_info', NULL);
|
$this->_set('logged_info', NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// rewrite 모듈사용 상태 체크
|
||||||
|
if(in_array('mod_rewrite',apache_get_modules())) $this->allow_rewrite = true;
|
||||||
|
|
||||||
|
// 상대 경로 설정
|
||||||
|
$this->path = $this->getRequestUri();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -353,19 +360,6 @@
|
||||||
if($this->_getRequestMethod() == 'XMLRPC') return;
|
if($this->_getRequestMethod() == 'XMLRPC') return;
|
||||||
if(!count($_REQUEST)) return;
|
if(!count($_REQUEST)) return;
|
||||||
|
|
||||||
if($_SERVER['REDIRECT_QUERY_STRING']) {
|
|
||||||
$this->rewrite = true;
|
|
||||||
$tmp_str = substr($_SERVER['REQUEST_URI'], strpos($_SERVER['REQUEST_URI'],'?')+1);
|
|
||||||
if($tmp_str) {
|
|
||||||
$tmp_arr = explode('&',$tmp_str);
|
|
||||||
$tmp_cnt = count($tmp_arr);
|
|
||||||
for($i=0;$i<$tmp_cnt;$i++) {
|
|
||||||
list($key, $val) = explode('=', $tmp_arr[$i]);
|
|
||||||
if($key && $val) $this->_set($key, $val);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
foreach($_REQUEST as $key => $val) {
|
foreach($_REQUEST as $key => $val) {
|
||||||
if(is_array($val)) {
|
if(is_array($val)) {
|
||||||
for($i=0;$i<count($val);$i++) {
|
for($i=0;$i<count($val);$i++) {
|
||||||
|
|
@ -463,32 +457,50 @@
|
||||||
* @brief 요청받은 url에 args_list를 적용하여 return
|
* @brief 요청받은 url에 args_list를 적용하여 return
|
||||||
**/
|
**/
|
||||||
function _getUrl($num_args, $args_list) {
|
function _getUrl($num_args, $args_list) {
|
||||||
if(!is_object($this->get_vars) || $args_list[0]=='') {
|
if(!$this->get_vars || $args_list[0]=='') {
|
||||||
$get_vars = null;
|
$get_vars = null;
|
||||||
if($args_list[0]=='') {
|
if($args_list[0]=='') {
|
||||||
array_shift($args_list);
|
array_shift($args_list);
|
||||||
$num_args = count($args_list);
|
$num_args = count($args_list);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
$get_vars = clone($this->get_vars);
|
$get_vars = get_object_vars($this->get_vars);
|
||||||
}
|
}
|
||||||
|
|
||||||
for($i=0;$i<$num_args;$i=$i+2) {
|
for($i=0;$i<$num_args;$i=$i+2) {
|
||||||
$key = $args_list[$i];
|
$key = $args_list[$i];
|
||||||
$val = $args_list[$i+1];
|
$val = trim($args_list[$i+1]);
|
||||||
$get_vars->{$key} = trim($val);
|
if(!$val) unset($get_vars[$key]);
|
||||||
|
else $get_vars[$key] = $val;
|
||||||
}
|
}
|
||||||
|
|
||||||
$var_count = count(get_object_vars($get_vars));
|
$var_count = count($get_vars);
|
||||||
if(!$var_count) return;
|
if(!$var_count) return '';
|
||||||
|
|
||||||
|
// rewrite모듈을 사용하고 인자의 값이 2개 이하일 경우
|
||||||
|
if($this->allow_rewrite && $var_count < 3) {
|
||||||
|
$var_keys = array_keys($get_vars);
|
||||||
|
|
||||||
|
if($var_count == 1) {
|
||||||
|
if($var_keys[0]=='mid') return $this->path.$get_vars['mid'];
|
||||||
|
elseif($var_keys[0]=='document_srl') return $this->path.$get_vars['document_srl'];
|
||||||
|
} elseif($var_count == 2) {
|
||||||
|
asort($var_keys);
|
||||||
|
$target = implode('.',$var_keys);
|
||||||
|
if($target=='act.mid' && !ereg('([A-Z]+)',$get_vars['act'])) return sprintf('%s%s/%s',$this->path,$get_vars['mid'],$get_vars['act']);
|
||||||
|
elseif($target=='document_srl.mid') return sprintf('%s%s/%s',$this->path,$get_vars['mid'],$get_vars['document_srl']);
|
||||||
|
elseif($target=='act.document_srl') return sprintf('%s%s/%s',$this->path,$get_vars['document_srl'],$get_vars['act']);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// rewrite 모듈을 사용하지 않고 인자의 값이 2개 이상이거나 rewrite모듈을 위한 인자로 적당하지 않을 경우
|
||||||
foreach($get_vars as $key => $val) {
|
foreach($get_vars as $key => $val) {
|
||||||
if(!$val) continue;
|
if(!$val) continue;
|
||||||
$url_list[] = sprintf("%s=%s",$key, $val);
|
$url .= ($url?'&':'').$key.'='.$val;
|
||||||
}
|
}
|
||||||
|
|
||||||
$path = str_replace('index.php','',$_SERVER['SCRIPT_NAME']);
|
return $this->path.'?'.$url;
|
||||||
return sprintf('%s?%s', $path, htmlspecialchars(implode('&',$url_list)));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -178,6 +178,8 @@
|
||||||
|
|
||||||
$this->setTemplatePath($oMessageView->getTemplatePath());
|
$this->setTemplatePath($oMessageView->getTemplatePath());
|
||||||
$this->setTemplateFile($oMessageView->getTemplateFile());
|
$this->setTemplateFile($oMessageView->getTemplateFile());
|
||||||
|
|
||||||
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -24,7 +24,7 @@
|
||||||
* 2 : 1 + DB 쿼리
|
* 2 : 1 + DB 쿼리
|
||||||
* 3 : 모든 로그
|
* 3 : 모든 로그
|
||||||
**/
|
**/
|
||||||
define('__DEBUG__', 3);
|
define('__DEBUG__', 0);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief 간단하게 사용하기 위한 함수 정의한 파일 require
|
* @brief 간단하게 사용하기 위한 함수 정의한 파일 require
|
||||||
|
|
|
||||||
|
|
@ -79,7 +79,7 @@
|
||||||
$this->setTemplatePath($template_path);
|
$this->setTemplatePath($template_path);
|
||||||
|
|
||||||
// rss url
|
// rss url
|
||||||
if($this->module_info->open_rss != 'N') Context::set('rss_url', getUrl('','mid',$this->mid,'act','dispRss'));
|
if($this->module_info->open_rss != 'N') Context::set('rss_url', getUrl('','mid',$this->mid,'act','rss'));
|
||||||
|
|
||||||
// 레이아웃의 정보를 속이기 위해서 layout_srl을 현 블로그의 module_srl로 입력
|
// 레이아웃의 정보를 속이기 위해서 layout_srl을 현 블로그의 module_srl로 입력
|
||||||
$this->module_info->layout_srl = $this->module_info->module_srl;
|
$this->module_info->layout_srl = $this->module_info->module_srl;
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,7 @@
|
||||||
<!--@if($search_target && $search_keyword)-->
|
<!--@if($search_target && $search_keyword)-->
|
||||||
<div>
|
<div>
|
||||||
<!-- 일자, 제목 출력-->
|
<!-- 일자, 제목 출력-->
|
||||||
[{zdate($document->regdate, "Y-m-d")}] <a href="#" onclick="winopen('./?document_srl={$document->document_srl}');return false;">{$document->title}</a>
|
[{zdate($document->regdate, "Y-m-d")}] <a href="#" onclick="winopen('{getUrl('document_srl',$document->document_srl)}');return false;">{$document->title}</a>
|
||||||
|
|
||||||
<!-- 댓글이 있으면 댓글의 수 출력 -->
|
<!-- 댓글이 있으면 댓글의 수 출력 -->
|
||||||
<!--@if($document->comment_count)-->({number_format($document->comment_count)})<!--@end-->
|
<!--@if($document->comment_count)-->({number_format($document->comment_count)})<!--@end-->
|
||||||
|
|
|
||||||
|
|
@ -77,7 +77,7 @@
|
||||||
$this->setTemplatePath($template_path);
|
$this->setTemplatePath($template_path);
|
||||||
|
|
||||||
// rss url
|
// rss url
|
||||||
if($this->module_info->open_rss != 'N') Context::set('rss_url', getUrl('','mid',$this->mid,'act','dispRss'));
|
if($this->module_info->open_rss != 'N') Context::set('rss_url', getUrl('','mid',$this->mid,'act','rss'));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -46,7 +46,13 @@
|
||||||
<!--@end-->
|
<!--@end-->
|
||||||
|
|
||||||
<!--@if($grant->view)-->
|
<!--@if($grant->view)-->
|
||||||
<a href="{getUrl('document_srl',$val->document_srl)}">{htmlspecialchars($val->title)}</a>
|
<!-- 검색중일 경우는 새창으로 -->
|
||||||
|
<!--@if($search_target && $search_keyword)-->
|
||||||
|
<a href="#" onclick="winopen('{getUrl('','document_srl',$val->document_srl)}','viewDocument');return false;">{htmlspecialchars($val->title)}</a>
|
||||||
|
<!-- 검색을 하지 않을 시에는 현재창으로 -->
|
||||||
|
<!--@else-->
|
||||||
|
<a href="{getUrl('','document_srl',$val->document_srl)}">{htmlspecialchars($val->title)}</a>
|
||||||
|
<!--@end-->
|
||||||
<!--@else-->
|
<!--@else-->
|
||||||
{htmlspecialchars($val->title)}
|
{htmlspecialchars($val->title)}
|
||||||
<!--@end-->
|
<!--@end-->
|
||||||
|
|
|
||||||
|
|
@ -51,13 +51,13 @@
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<th>{$lang->document_url}</th>
|
<th>{$lang->document_url}</th>
|
||||||
<td>{getUrl()}{$document->document_srl}</td>
|
<td>{getUrl('','document_srl',$document->document_srl)}</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
<!--@if($document->allow_trackback=='Y')-->
|
<!--@if($document->allow_trackback=='Y')-->
|
||||||
<tr>
|
<tr>
|
||||||
<th>{$lang->trackback_url}</th>
|
<th>{$lang->trackback_url}</th>
|
||||||
<td>{getUrl()}trackback/{$document->document_srl}</td>
|
<td>{getUrl('','document_srl',$document->document_srl,'act','trackback')}</td>
|
||||||
</tr>
|
</tr>
|
||||||
<!--@end-->
|
<!--@end-->
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,6 @@
|
||||||
<module>
|
<module>
|
||||||
<grants />
|
<grants />
|
||||||
<actions>
|
<actions>
|
||||||
<action name="dispRss" type="view" standalone="true" />
|
<action name="rss" type="view" standalone="true" />
|
||||||
</actions>
|
</actions>
|
||||||
</module>
|
</module>
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,7 @@
|
||||||
/**
|
/**
|
||||||
* @brief RSS 출력
|
* @brief RSS 출력
|
||||||
**/
|
**/
|
||||||
function dispRss() {
|
function rss() {
|
||||||
// RSS를 출력하고자 하는 mid를 구함 (없으면 오류)
|
// RSS를 출력하고자 하는 mid를 구함 (없으면 오류)
|
||||||
$mid = Context::get('mid');
|
$mid = Context::get('mid');
|
||||||
if(!$mid) return $this->dispError();
|
if(!$mid) return $this->dispError();
|
||||||
|
|
|
||||||
|
|
@ -4,6 +4,6 @@
|
||||||
<actions>
|
<actions>
|
||||||
<action name="dispTrackbackAdminList" type="view" admin_index="true" standalone="true" />
|
<action name="dispTrackbackAdminList" type="view" admin_index="true" standalone="true" />
|
||||||
<action name="procTrackbackAdminDeleteChecked" type="controller" standalone="true" />
|
<action name="procTrackbackAdminDeleteChecked" type="controller" standalone="true" />
|
||||||
<action name="procTrackbackReceive" type="controller" standalone="true" />
|
<action name="trackback" type="controller" standalone="true" />
|
||||||
</actions>
|
</actions>
|
||||||
</module>
|
</module>
|
||||||
|
|
|
||||||
|
|
@ -38,11 +38,12 @@
|
||||||
/**
|
/**
|
||||||
* @brief 엮인글 입력
|
* @brief 엮인글 입력
|
||||||
**/
|
**/
|
||||||
function procTrackbackReceive() {
|
function trackback() {
|
||||||
Context::setRequestMethod("XMLRPC");
|
Context::setRequestMethod("XMLRPC");
|
||||||
|
|
||||||
$obj = Context::gets('document_srl','url','title','excerpt');
|
$obj = Context::gets('document_srl','url','title','excerpt');
|
||||||
if(!$obj->document_srl) return $this->stop('fail');
|
|
||||||
|
if(!$obj->document_srl || !$obj->url || !$obj->title || !$obj->excerpt) return $this->stop('fail');
|
||||||
|
|
||||||
return $this->insertTrackback($obj);
|
return $this->insertTrackback($obj);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue