mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-14 00:39:57 +09:00
git-svn-id: http://xe-core.googlecode.com/svn/trunk@70 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
ab5a684447
commit
09b95d3fa8
4 changed files with 166 additions and 208 deletions
|
|
@ -1,111 +1,110 @@
|
||||||
<?php
|
<?php
|
||||||
/**
|
|
||||||
* @file : modules/rss/rss.module.php
|
|
||||||
* @author : zero <zero@nzeo.com>
|
|
||||||
* @desc : 기본 모듈중의 하나인 rss module
|
|
||||||
* RSS 2.0형식으로 문서 출력
|
|
||||||
**/
|
|
||||||
|
|
||||||
class rss extends Module {
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 모듈의 정보
|
* @file : modules/rss/rss.module.php
|
||||||
**/
|
* @author : zero <zero@nzeo.com>
|
||||||
var $cur_version = "20070130_0.01";
|
* @desc : 기본 모듈중의 하나인 rss module
|
||||||
|
* RSS 2.0형식으로 문서 출력
|
||||||
/**
|
|
||||||
* 기본 action 지정
|
|
||||||
* $act값이 없거나 잘못된 값이 들어올 경우 $default_act 값으로 진행
|
|
||||||
**/
|
|
||||||
var $default_act = '';
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 현재 모듈의 초기화를 위한 작업을 지정해 놓은 method
|
|
||||||
* css/js파일의 load라든지 lang파일 load등을 미리 선언
|
|
||||||
*
|
|
||||||
* Init() => 공통
|
|
||||||
* dispInit() => disp시에
|
|
||||||
* procInit() => proc시에
|
|
||||||
*
|
|
||||||
* $this->module_path는 현재 이 모듈파일의 위치를 나타낸다
|
|
||||||
* (ex: $this->module_path = "./modules/system_install/";
|
|
||||||
**/
|
**/
|
||||||
|
|
||||||
// 초기화
|
class rss extends Module {
|
||||||
function init() {/*{{{*/
|
|
||||||
}/*}}}*/
|
|
||||||
|
|
||||||
// disp 초기화
|
/**
|
||||||
function dispInit() {/*{{{*/
|
* 모듈의 정보
|
||||||
}/*}}}*/
|
**/
|
||||||
|
var $cur_version = "20070130_0.01";
|
||||||
// proc 초기화
|
|
||||||
function procInit() {/*{{{*/
|
|
||||||
}/*}}}*/
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 여기서부터는 action의 구현
|
* 기본 action 지정
|
||||||
* request parameter의 경우 각 method의 첫번째 인자로 넘어온다
|
* $act값이 없거나 잘못된 값이 들어올 경우 $default_act 값으로 진행
|
||||||
*
|
**/
|
||||||
* dispXXXX : 출력을 위한 method, output에 tpl file이 지정되어야 한다
|
var $default_act = '';
|
||||||
* procXXXX : 처리를 위한 method, output에는 error, message가 지정되어야 한다
|
|
||||||
**/
|
|
||||||
|
|
||||||
// 출력 부분
|
/**
|
||||||
|
* 현재 모듈의 초기화를 위한 작업을 지정해 놓은 method
|
||||||
|
* css/js파일의 load라든지 lang파일 load등을 미리 선언
|
||||||
|
*
|
||||||
|
* Init() => 공통
|
||||||
|
* dispInit() => disp시에
|
||||||
|
* procInit() => proc시에
|
||||||
|
*
|
||||||
|
* $this->module_path는 현재 이 모듈파일의 위치를 나타낸다
|
||||||
|
* (ex: $this->module_path = "./modules/system_install/";
|
||||||
|
**/
|
||||||
|
|
||||||
// 실행 부분
|
// 초기화
|
||||||
|
function init() {
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
// disp 초기화
|
||||||
* 여기부터는 이 모듈과 관련된 라이브러리 개념의 method들
|
function dispInit() {
|
||||||
**/
|
}
|
||||||
function printRssDocument($info, $content) { /*{{{*/
|
|
||||||
header("Content-Type: text/xml; charset=UTF-8");
|
|
||||||
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
|
|
||||||
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
|
|
||||||
header("Cache-Control: no-store, no-cache, must-revalidate");
|
|
||||||
header("Cache-Control: post-check=0, pre-check=0", false);
|
|
||||||
header("Pragma: no-cache");
|
|
||||||
print '<?xml version="1.0" encoding="utf-8" ?>'."\n";
|
|
||||||
print "<!-- // RSS2.0 -->\n";
|
|
||||||
?><rss version="2.0" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/">
|
|
||||||
<channel>
|
|
||||||
<title><![CDATA[<?=$info->title?>]]></title>
|
|
||||||
<link><![CDATA[<?=$info->link?>]]></link>
|
|
||||||
<description><![CDATA[<?=$info->description?>]]></description>
|
|
||||||
<language><?=$info->language?></language>
|
|
||||||
<pubDate><?=$info->date?></pubDate>
|
|
||||||
<?
|
|
||||||
if(count($content)) {
|
|
||||||
foreach($content as $item) {
|
|
||||||
$year = substr($item->regdate,0,4);
|
|
||||||
$month = substr($item->regdate,4,2);
|
|
||||||
$day = substr($item->regdate,6,2);
|
|
||||||
$hour = substr($item->regdate,8,2);
|
|
||||||
$min = substr($item->regdate,10,2);
|
|
||||||
$sec = substr($item->regdate,12,2);
|
|
||||||
$time = mktime($hour,$min,$sec,$month,$day,$year);
|
|
||||||
|
|
||||||
$title = $item->title;
|
// proc 초기화
|
||||||
$author = $item->user_name;
|
function procInit() {
|
||||||
$link = sprintf("%s?document_srl=%d", Context::getRequestUri(), $item->document_srl);
|
}
|
||||||
$description = $item->content;
|
|
||||||
$date = gmdate("D, d M Y H:i:s", $time);
|
/**
|
||||||
?>
|
* 여기서부터는 action의 구현
|
||||||
<item>
|
* request parameter의 경우 각 method의 첫번째 인자로 넘어온다
|
||||||
<title><![CDATA[<?=$title?>]]></title>
|
*
|
||||||
<author><![CDATA[<?=$author?>]]></author>
|
* dispXXXX : 출력을 위한 method, output에 tpl file이 지정되어야 한다
|
||||||
<link><![CDATA[<?=$link?>]]></link>
|
* procXXXX : 처리를 위한 method, output에는 error, message가 지정되어야 한다
|
||||||
<description><![CDATA[<?=$description?>]]></description>
|
**/
|
||||||
<pubDate><?=$date?></pubDate>
|
|
||||||
</item>
|
// 출력 부분
|
||||||
<?
|
|
||||||
|
// 실행 부분
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 여기부터는 이 모듈과 관련된 라이브러리 개념의 method들
|
||||||
|
**/
|
||||||
|
function printRssDocument($info, $content) {
|
||||||
|
header("Content-Type: text/xml; charset=UTF-8");
|
||||||
|
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
|
||||||
|
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
|
||||||
|
header("Cache-Control: no-store, no-cache, must-revalidate");
|
||||||
|
header("Cache-Control: post-check=0, pre-check=0", false);
|
||||||
|
header("Pragma: no-cache");
|
||||||
|
print '<?xml version="1.0" encoding="utf-8" ?>'."\n";
|
||||||
|
print "<!-- // RSS2.0 -->\n";
|
||||||
|
?><rss version="2.0" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/">
|
||||||
|
<channel>
|
||||||
|
<title><![CDATA[<?=$info->title?>]]></title>
|
||||||
|
<link><![CDATA[<?=$info->link?>]]></link>
|
||||||
|
<description><![CDATA[<?=$info->description?>]]></description>
|
||||||
|
<language><?=$info->language?></language>
|
||||||
|
<pubDate><?=$info->date?></pubDate>
|
||||||
|
<?
|
||||||
|
if(count($content)) {
|
||||||
|
foreach($content as $item) {
|
||||||
|
$year = substr($item->regdate,0,4);
|
||||||
|
$month = substr($item->regdate,4,2);
|
||||||
|
$day = substr($item->regdate,6,2);
|
||||||
|
$hour = substr($item->regdate,8,2);
|
||||||
|
$min = substr($item->regdate,10,2);
|
||||||
|
$sec = substr($item->regdate,12,2);
|
||||||
|
$time = mktime($hour,$min,$sec,$month,$day,$year);
|
||||||
|
|
||||||
|
$title = $item->title;
|
||||||
|
$author = $item->user_name;
|
||||||
|
$link = sprintf("%s?document_srl=%d", Context::getRequestUri(), $item->document_srl);
|
||||||
|
$description = $item->content;
|
||||||
|
$date = gmdate("D, d M Y H:i:s", $time);
|
||||||
|
?>
|
||||||
|
<item>
|
||||||
|
<title><![CDATA[<?=$title?>]]></title>
|
||||||
|
<author><![CDATA[<?=$author?>]]></author>
|
||||||
|
<link><![CDATA[<?=$link?>]]></link>
|
||||||
|
<description><![CDATA[<?=$description?>]]></description>
|
||||||
|
<pubDate><?=$date?></pubDate>
|
||||||
|
</item>
|
||||||
|
<?
|
||||||
|
}
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
</channel>
|
||||||
|
</rss>
|
||||||
|
<?
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
?>
|
|
||||||
</channel>
|
|
||||||
</rss>
|
|
||||||
<?
|
|
||||||
}/*}}}*/
|
|
||||||
}
|
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|
|
||||||
68
modules/tag/tag.controller.php
Normal file
68
modules/tag/tag.controller.php
Normal file
|
|
@ -0,0 +1,68 @@
|
||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* @class tagController
|
||||||
|
* @author zero (zero@nzeo.com)
|
||||||
|
* @brief tag 모듈의 controller class
|
||||||
|
**/
|
||||||
|
|
||||||
|
class tagController extends Module {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief 초기화
|
||||||
|
**/
|
||||||
|
function init() {
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief 태그 입력
|
||||||
|
**/
|
||||||
|
function insertTag($module_srl, $document_srl, $tags) {
|
||||||
|
|
||||||
|
// 해당 글의 tags를 모두 삭제
|
||||||
|
$this->deleteTag($document_srl);
|
||||||
|
if(!$tags) return;
|
||||||
|
|
||||||
|
// tags변수 정리
|
||||||
|
$tmp_tag_list = explode(',', $tags);
|
||||||
|
$tag_count = count($tmp_tag_list);
|
||||||
|
for($i=0;$i<$tag_count;$i++) {
|
||||||
|
$tag = trim($tmp_tag_list[$i]);
|
||||||
|
if(!$tag) continue;
|
||||||
|
$tag_list[] = $tag;
|
||||||
|
}
|
||||||
|
if(!count($tag_list)) return;
|
||||||
|
|
||||||
|
// 다시 태그를 입력
|
||||||
|
$oDB = &DB::getInstance();
|
||||||
|
|
||||||
|
$args->module_srl = $module_srl;
|
||||||
|
$args->document_srl = $document_srl;
|
||||||
|
$tag_count = count($tag_list);
|
||||||
|
for($i=0;$i<$tag_count;$i++) {
|
||||||
|
$args->tag = $tag_list[$i];
|
||||||
|
$oDB->executeQuery('tag.insertTag', $args);
|
||||||
|
}
|
||||||
|
|
||||||
|
return implode(',',$tag_list);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief 특정 문서의 태그 삭제
|
||||||
|
**/
|
||||||
|
function deleteTag($document_srl) {
|
||||||
|
$oDB = &DB::getInstance();
|
||||||
|
$args->document_srl = $document_srl;
|
||||||
|
return $oDB->executeQuery('tag.deleteTag', $args);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief 특정 모듈의 태그 삭제
|
||||||
|
**/
|
||||||
|
function deleteModuleTags($module_srl) {
|
||||||
|
// 삭제
|
||||||
|
$oDB = &DB::getInstance();
|
||||||
|
$args->module_srl = $module_srl;
|
||||||
|
return $oDB->executeQuery('tag.deleteModuleTags', $args);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
|
@ -1,109 +0,0 @@
|
||||||
<?php
|
|
||||||
/**
|
|
||||||
* @file : modules/tag/tag.module.php
|
|
||||||
* @author : zero <zero@nzeo.com>
|
|
||||||
* @desc : 기본 모듈중의 하나인 tag module
|
|
||||||
* Module class에서 상속을 받아서 사용
|
|
||||||
* action 의 경우 disp/proc 2가지만 존재하며 이는 action명세서에
|
|
||||||
* 미리 기록을 하여야 함
|
|
||||||
**/
|
|
||||||
|
|
||||||
class tag extends Module {
|
|
||||||
/**
|
|
||||||
* 모듈의 정보
|
|
||||||
**/
|
|
||||||
var $cur_version = "20070130_0.01";
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 기본 action 지정
|
|
||||||
* $act값이 없거나 잘못된 값이 들어올 경우 $default_act 값으로 진행
|
|
||||||
**/
|
|
||||||
var $default_act = '';
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 현재 모듈의 초기화를 위한 작업을 지정해 놓은 method
|
|
||||||
* css/js파일의 load라든지 lang파일 load등을 미리 선언
|
|
||||||
*
|
|
||||||
* Init() => 공통
|
|
||||||
* dispInit() => disp시에
|
|
||||||
* procInit() => proc시에
|
|
||||||
*
|
|
||||||
* $this->module_path는 현재 이 모듈파일의 위치를 나타낸다
|
|
||||||
* (ex: $this->module_path = "./modules/install/";
|
|
||||||
**/
|
|
||||||
|
|
||||||
// 초기화
|
|
||||||
function init() {
|
|
||||||
}
|
|
||||||
|
|
||||||
// disp 초기화
|
|
||||||
function dispInit() {
|
|
||||||
}
|
|
||||||
|
|
||||||
// proc 초기화
|
|
||||||
function procInit() {
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 여기서부터는 action의 구현
|
|
||||||
* request parameter의 경우 각 method의 첫번째 인자로 넘어온다
|
|
||||||
*
|
|
||||||
* dispXXXX : 출력을 위한 method, output에 tpl file이 지정되어야 한다
|
|
||||||
* procXXXX : 처리를 위한 method, output에는 tag, tag가 지정되어야 한다
|
|
||||||
**/
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 여기부터는 이 모듈과 관련된 라이브러리 개념의 method들
|
|
||||||
**/
|
|
||||||
|
|
||||||
// public string insertTag($module_srl, $document_srl, $tags)
|
|
||||||
// 태그 입력
|
|
||||||
function insertTag($module_srl, $document_srl, $tags) {
|
|
||||||
|
|
||||||
// 해당 글의 tags를 모두 삭제
|
|
||||||
$this->deleteTag($document_srl);
|
|
||||||
|
|
||||||
if(!$tags) return;
|
|
||||||
|
|
||||||
// tags변수 정리
|
|
||||||
$tmp_tag_list = explode(',', $tags);
|
|
||||||
$tag_count = count($tmp_tag_list);
|
|
||||||
for($i=0;$i<$tag_count;$i++) {
|
|
||||||
$tag = trim($tmp_tag_list[$i]);
|
|
||||||
if(!$tag) continue;
|
|
||||||
$tag_list[] = $tag;
|
|
||||||
}
|
|
||||||
if(!count($tag_list)) return;
|
|
||||||
|
|
||||||
// 다시 태그를 입력
|
|
||||||
$oDB = &DB::getInstance();
|
|
||||||
|
|
||||||
$args->module_srl = $module_srl;
|
|
||||||
$args->document_srl = $document_srl;
|
|
||||||
$tag_count = count($tag_list);
|
|
||||||
for($i=0;$i<$tag_count;$i++) {
|
|
||||||
$args->tag = $tag_list[$i];
|
|
||||||
$oDB->executeQuery('tag.insertTag', $args);
|
|
||||||
}
|
|
||||||
|
|
||||||
return implode(',',$tag_list);
|
|
||||||
}
|
|
||||||
|
|
||||||
// public boolean deleteTag($document_srl)
|
|
||||||
// 특정 문서의 태그 삭제
|
|
||||||
function deleteTag($document_srl) {
|
|
||||||
$oDB = &DB::getInstance();
|
|
||||||
$args->document_srl = $document_srl;
|
|
||||||
return $oDB->executeQuery('tag.deleteTag', $args);
|
|
||||||
}
|
|
||||||
|
|
||||||
// public boolean deleteModuleTags($module_sr)
|
|
||||||
// 특정 모듈의 태그 삭제
|
|
||||||
function deleteModuleTags($module_srl) {
|
|
||||||
// 삭제
|
|
||||||
$oDB = &DB::getInstance();
|
|
||||||
$args->module_srl = $module_srl;
|
|
||||||
return $oDB->executeQuery('tag.deleteModuleTags', $args);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
?>
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue