git-svn-id: http://xe-core.googlecode.com/svn/trunk@1628 201d5d3c-b55e-5fd7-737f-ddc643e51545

This commit is contained in:
zero 2007-06-14 06:05:26 +00:00
parent 3f649ab32a
commit 67572cebaf
39 changed files with 543 additions and 459 deletions

View file

@ -82,6 +82,9 @@
// 구해진 클래스의 객체 생성후 isSupported method를 통해 지원 여부를 판단 // 구해진 클래스의 객체 생성후 isSupported method를 통해 지원 여부를 판단
for($i=0;$i<count($supported_list);$i++) { for($i=0;$i<count($supported_list);$i++) {
$db_type = $supported_list[$i]; $db_type = $supported_list[$i];
if(version_compare(phpversion(), '5.0') < 0 && eregi('pdo',$db_type)) continue;
$class_name = sprintf("DB%s%s", strtoupper(substr($db_type,0,1)), strtolower(substr($db_type,1))); $class_name = sprintf("DB%s%s", strtoupper(substr($db_type,0,1)), strtolower(substr($db_type,1)));
$class_file = sprintf("./classes/db/%s.class.php", $class_name); $class_file = sprintf("./classes/db/%s.class.php", $class_name);
if(!file_exists($class_file)) continue; if(!file_exists($class_file)) continue;

View file

@ -47,7 +47,8 @@
* @brief 설치 가능 여부를 return * @brief 설치 가능 여부를 return
**/ **/
function isSupported() { function isSupported() {
if(!function_exists('mysql_connect') || mysql_get_client_info() < "4.1.00") return false; //if(!function_exists('mysql_connect') || mysql_get_client_info() < "4.1.00") return false;
if(!function_exists('mysql_connect')) return false;
return true; return true;
} }

View file

@ -47,7 +47,8 @@
* @brief 설치 가능 여부를 return * @brief 설치 가능 여부를 return
**/ **/
function isSupported() { function isSupported() {
if(!function_exists('mysql_connect') || mysql_get_client_info() < "4.1.00") return false; //if(!function_exists('mysql_connect') || mysql_get_client_info() < "4.1.00") return false;
if(!function_exists('mysql_connect')) return false;
return true; return true;
} }

View file

@ -152,7 +152,7 @@
/** /**
* @ 실행된 모듈의 컨텐츠를 출력 * @ 실행된 모듈의 컨텐츠를 출력
**/ **/
function displayContent(&$oModule = NULL) { function displayContent($oModule = NULL) {
// 설정된 모듈이 정상이지 않을 경우 message 모듈 객체 생성 // 설정된 모듈이 정상이지 않을 경우 message 모듈 객체 생성
if(!$oModule || !is_object($oModule)) { if(!$oModule || !is_object($oModule)) {
$this->error = 'msg_module_is_not_exists'; $this->error = 'msg_module_is_not_exists';

View file

@ -63,7 +63,10 @@
* @brief 추가된 변수의 key, value들을 추가 * @brief 추가된 변수의 key, value들을 추가
**/ **/
function adds($object) { function adds($object) {
if( (is_object($object) && count(array_keys($object))) || (is_array($object) && count($object))) { if(is_object($object)) {
$vars = get_object_vars($object);
foreach($vars as $key => $val) $this->add($key, $val);
} elseif(is_array($object)) {
foreach($object as $key => $val) $this->add($key, $val); foreach($object as $key => $val) $this->add($key, $val);
} }
} }

View file

@ -79,27 +79,31 @@
// document 객체를 생성. 기본 데이터 구조의 경우 document모듈만 쓰면 만사 해결.. -_-; // document 객체를 생성. 기본 데이터 구조의 경우 document모듈만 쓰면 만사 해결.. -_-;
$oDocumentModel = &getModel('document'); $oDocumentModel = &getModel('document');
$oDocument = $oDocumentModel->getDocument(0, $this->grant->manager);
// document_srl이 있다면 해당 글을 구해오자 // document_srl이 있다면 해당 글을 구해오자
if($this->grant->list && $document_srl) { if($this->grant->list && $document_srl) {
// 글을 구함 // 글을 구함
$document = $oDocumentModel->getDocument($document_srl, $this->grant->manager, true); $oDocument->setDocument($document_srl);
// 찾아지지 않았다면 초기화 // 찾아지지 않았다면 초기화
if($document->document_srl != $document_srl) { if(!$oDocument->isExists()) {
unset($document);
unset($document_srl); unset($document_srl);
Context::set('document_srl','',true); Context::set('document_srl','',true);
} else {
// 브라우저 타이틀 설정
Context::setBrowserTitle($oDocument->getTitleText());
// 글이 찾아졌으면 댓글 권한과 허용 여부를 체크하여 댓글 에디터 세팅 // 댓글에디터 설정
} elseif($this->grant->write_comment && $document->allow_comment == 'Y' && $document->lock_comment != 'Y') { if($this->grant->write_comment && $oDocument->allowComment() && !$oDocument->isLocked()) $this->setCommentEditor(0, 100);
// 브라우저 타이틀
$browser_title = $this->module_info->browser_title.' - '.$document->title; // 조회수 증가
Context::setBrowserTitle($browser_title); $oDocument->updateReadedCount();
} }
Context::set('document', $document);
} }
Context::set('oDocument', $oDocument);
// 댓글 // 댓글
$this->setCommentEditor(0, 100); $this->setCommentEditor(0, 100);
@ -167,23 +171,21 @@
// document 모듈 객체 생성 // document 모듈 객체 생성
$oDocumentModel = &getModel('document'); $oDocumentModel = &getModel('document');
$oDocument = $oDocumentModel->getDocument($document_srl, $this->grant->manager);
// 지정된 글이 없다면 (신규) 새로운 번호를 만든다 // 지정된 글이 없다면 (신규) 새로운 번호를 만든다
if($document_srl) { if(!$oDocument->isExists()) {
$document = $oDocumentModel->getDocument($document_srl, $this->grant->manager); unset($document_srl);
if(!$document) { Context::set('document_srl','');
unset($document_srl);
Context::set('document_srl','');
}
} }
if(!$document_srl) $document_srl = getNextSequence(); if(!$document_srl) $document_srl = getNextSequence();
// 글을 수정하려고 할 경우 권한이 없는 경우 비밀번호 입력화면으로 // 글을 수정하려고 할 경우 권한이 없는 경우 비밀번호 입력화면으로
if($document&&!$document->is_granted) return $this->setTemplateFile('input_password_form'); if($oDocument->isExists()&&!$oDocument->isGranted()) return $this->setTemplateFile('input_password_form');
Context::set('document_srl',$document_srl); Context::set('document_srl',$document_srl);
Context::set('document', $document); Context::set('oDocument', $oDocument);
// 에디터 모듈의 getEditor를 호출하여 세팅 // 에디터 모듈의 getEditor를 호출하여 세팅
$oEditorModel = &getModel('editor'); $oEditorModel = &getModel('editor');
@ -209,19 +211,16 @@
// 삭제할 문서번호를 가져온다 // 삭제할 문서번호를 가져온다
$document_srl = Context::get('document_srl'); $document_srl = Context::get('document_srl');
// 지정된 글이 있는지 확인 $oDocumentModel = &getModel('document');
if($document_srl) { $oDocument = $oDocumentModel->getDocument($document_srl, $this->grant->manager);
$oDocumentModel = &getModel('document');
$document = $oDocumentModel->getDocument($document_srl);
}
// 삭제하려는 글이 없으면 에러 // 삭제하려는 글이 없으면 에러
if(!$document) return $this->dispBlogContent(); if(!$oDocument->isExists()) return $this->dispBlogContent();
// 권한이 없는 경우 비밀번호 입력화면으로 // 권한이 없는 경우 비밀번호 입력화면으로
if($document&&!$document->is_granted) return $this->setTemplateFile('input_password_form'); if($oDocument->isExists()&&!$oDocument->isGranted()) return $this->setTemplateFile('input_password_form');
Context::set('document',$document); Context::set('oDocument',$oDocument);
$this->setTemplateFile('delete_form'); $this->setTemplateFile('delete_form');
} }

View file

@ -1,6 +1,8 @@
<!--@if($document->comment_list)--> <!--%import("filter/insert_comment.xml")-->
<!--@foreach($document->comment_list as $key => $val)--> <!--@if($oDocument->getCommentCount())-->
<!--@foreach($oDocument->getComments() as $key => $val)-->
<a name="comment_{$key}"></a> <a name="comment_{$key}"></a>
<div style="margin-left:{$val->depth*15}px" > <div style="margin-left:{$val->depth*15}px" >
<table border="1" width="100%"> <table border="1" width="100%">
@ -56,6 +58,6 @@
<!--@end--> <!--@end-->
<!-- 댓글 입력 폼 --> <!-- 댓글 입력 폼 -->
<!--@if($grant->write_comment && $document->lock_comment == 'N')--> <!--@if($grant->write_comment && !$oDocument->isLocked())-->
<!--#include("./comment_form.html")--> <!--#include("./comment_form.html")-->
<!--@end--> <!--@end-->

View file

@ -12,7 +12,7 @@
</tr> </tr>
<tr> <tr>
<th>{$lang->title}</th> <th>{$lang->title}</th>
<td>{$document->title}</td> <td>{$oDocument->getTitleText()}</td>
</tr> </tr>
<tr> <tr>
<td colspan="2"> <td colspan="2">

View file

@ -5,19 +5,19 @@
<!-- 검색된 글 목록이 있고 권한이 있을 경우 출력 --> <!-- 검색된 글 목록이 있고 권한이 있을 경우 출력 -->
<!--@if($document_list && $grant->list)--> <!--@if($document_list && $grant->list)-->
<!--@foreach($document_list as $no => $document)--> <!--@foreach($document_list as $no => $oDocument)-->
<!-- 검색어가 사용되었을 경우 목록형태로 출력 --> <!-- 검색어가 사용되었을 경우 목록형태로 출력 -->
<!--@if($search_target && $search_keyword)--> <!--@if($search_target && $search_keyword)-->
<div> <div>
<!-- 일자, 제목 출력--> <!-- 일자, 제목 출력-->
[{zdate($document->regdate, "Y-m-d")}] <a href="#" onclick="winopen('{getUrl('','document_srl',$document->document_srl)}');return false;">{$document->title}</a> [{$oDocument->getRegdate("Y-m-d")}] <a href="#" onclick="winopen('{$oDocument->getPermanentUrl()}');return false;">{$oDocument->getTitleText()}</a>
<!-- 댓글이 있으면 댓글의 수 출력 --> <!-- 댓글이 있으면 댓글의 수 출력 -->
<!--@if($document->comment_count)-->({number_format($document->comment_count)})<!--@end--> <!--@if($oDocument->getCommentCount())-->({number_format($oDocument->getCommentCount())})<!--@end-->
<!-- 엮인글이 있으면 엮인글의 수 출력 --> <!-- 엮인글이 있으면 엮인글의 수 출력 -->
<!--@if($document->trackback_count)-->({number_format($document->trackback_count)})<!--@end--> <!--@if($oDocument->getTrackbackCount())-->({number_format($oDocument->getTrackbackCount())})<!--@end-->
</div> </div>
<!-- 검색어가 없다면 내용을 바로 출력 --> <!-- 검색어가 없다면 내용을 바로 출력 -->

View file

@ -1,5 +1,5 @@
<!--@if($document->trackback_list)--> <!--@if($oDocument->getTrackbackCount())-->
<!--@foreach($document->trackback_list as $key => $val)--> <!--@foreach($oDocument->getTrackbacks as $key => $val)-->
<a name="trackback_{$val->trackback_srl}"></a> <a name="trackback_{$val->trackback_srl}"></a>
<div style="margin-left:{$val->depth*15}px" > <div style="margin-left:{$val->depth*15}px" >

View file

@ -3,60 +3,63 @@
<div class="title" style="clear:right;height:25px;"> <div class="title" style="clear:right;height:25px;">
<div style="font-weight:bold;font-size:18px;float:left;"> <div style="font-weight:bold;font-size:18px;float:left;">
<!--@if($category_list && $document->category_srl)--> <!--@if($oDocument->get('category_srl'))-->
[{$category_list[$document->category_srl]->title}] [{$category_list[$oDocument->get('category_srl')]->title}]
<!--@end--> <!--@end-->
{htmlspecialchars($document->title)} {$oDocument->getTitleText()}
</div> </div>
</div> </div>
<div style="clear:right;height:20px;"> <div style="clear:right;height:20px;">
<div class="date" style="float:left;"> <div class="date" style="float:left;">
{zdate($document->regdate,"Y-m-d H:i:s")} <strong>{$oDocument->getRegdate('Y.m.d')}</strong> {$oDocument->getRegdate('H:i:s')}
<!--@if($module_info->display_writer == "on")--> <!--@if($module_info->display_writer == "on")-->
by <span class="member_{$document->member_srl}">{htmlspecialchars($document->nick_name)}</span> <span class="member_{$oDocument->get('member_srl')}">{$oDocument->getNickName()}</span>
<!--@end--> <!--@end-->
</div> </div>
<div style="float:right;"> <div style="float:right;">
<!--@if($document->is_granted || $grant->manager)--> <!--@if($oDocument->isEditable())-->
<a href="{getUrl('act','dispBlogWrite','document_srl',$document->document_srl)}">[{$lang->cmd_modify}]</a> <a href="{getUrl('act','dispBlogWrite','document_srl',$oDocument->document_srl)}">[{$lang->cmd_modify}]</a>
<a href="{getUrl('act','dispBlogDelete','document_srl',$document->document_srl)}">[{$lang->cmd_delete}]</a> <a href="{getUrl('act','dispBlogDelete','document_srl',$oDocument->document_srl)}">[{$lang->cmd_delete}]</a>
<!--@end--> <!--@end-->
</div> </div>
</div> </div>
<div style="overflow:hidden;width:660px;margin:10px 0px 10px 0px;padding:5px 0px 5px 0px;border-top:1px solid #EEEEEE;border-bottom:1px solid #EEEEEE;" class="content">{$document->content}</div> <div style="overflow:hidden;width:660px;margin:10px 0px 10px 0px;padding:5px 0px 5px 0px;border-top:1px solid #EEEEEE;border-bottom:1px solid #EEEEEE;" class="content">{$oDocument->getContent()}</div>
<div style="margin:10px 0px 10px 0px"> <div style="margin:10px 0px 10px 0px">
{$lang->document_url} : {getUrl()}{$document->document_srl} {$lang->document_url} : {$oDocument->getPermanentUrl()}
</div> </div>
<div style="clear:both;height:20px;margin:0px 0px 10px 0px"> <div style="clear:both;height:20px;margin:0px 0px 10px 0px">
<!--@if($document->tag_list)--> {@ $tag_list = $oDocument->get('tag_list') }
<!--@if(count($tag_list))-->
<div style="color:#888888;float:left;"> <div style="color:#888888;float:left;">
{$lang->tag} : <!--@for($i=0;$i<count($tag_list);$i++)-->
<!--@foreach($document->tag_list as $val)--> {@ $tag = $tag_list[$i]; }
{$lang->tag} :
<a href="{getUrl('search_target','tag','search_keyword',urlencode($val),'document_srl','')}">{htmlspecialchars($val)}</a> <a href="{getUrl('search_target','tag','search_keyword',urlencode($val),'document_srl','')}">{htmlspecialchars($val)}</a>
<!--@end--> <!--@end-->
</div> </div>
<!--@end--> <!--@end-->
<!--@if($document->allow_trackback=='Y')--> <!--@if($oDocument->allowTrackback())-->
<div style="color:#888888;float:right;"> <div style="color:#888888;float:right;">
{$lang->trackback_url} : {getUrl()}trackback/{$document->document_srl} {$lang->trackback_url} : {$oDocument->getTrackbackUrl()}
</div> </div>
<!--@end--> <!--@end-->
</div> </div>
<!--@if($document->uploaded_count && $document->uploaded_list)--> <!--@if($oDocument->hasUploadedFiles())-->
<div style="border:1px solid #DDDDDD;padding:10px;margin-bottom:10px;"> <div style="border:1px solid #DDDDDD;padding:10px;margin-bottom:10px;">
<div>{$lang->uploaded_file}</div> <div>{$lang->uploaded_file}</div>
<div> <div>
<!--@foreach($document->uploaded_list as $key => $file)--> {@ $uploaded_list = $oDocument->getUploadedFiles() }
<!--@foreach($uploaded_list as $key => $file)-->
<span><a href="{$file->download_url}">{$file->source_filename} ({FileHandler::filesize($file->file_size)})</a> ({number_format($file->download_count)})</span> <span><a href="{$file->download_url}">{$file->source_filename} ({FileHandler::filesize($file->file_size)})</a> ({number_format($file->download_count)})</span>
<!--@end--> <!--@end-->
</div> </div>
</div> </div>
<!--@end--> <!--@end-->
@ -64,23 +67,28 @@
<!-- 댓글/ 엮인글 정보 출력 --> <!-- 댓글/ 엮인글 정보 출력 -->
<div> <div>
<a href="#comment_top_{$document->document_srl}">{$lang->comment} : {count($document->comment_list)}</a>, <!--@if($grant->write_comment && $oDocument->allowComment()) -->
<a href="#trackback_{$document->document_srl}">{$lang->trackback} : {count($document->trackback_list)}</a> <a href="#comment_top_{$oDocument->document_srl}">{$lang->comment} : {$oDocument->getCommentCount()}</a>,
<!--@end-->
<!--@if($oDocument->allowTrackback())-->
<a href="#trackback_{$oDocument->document_srl}">{$lang->trackback} : {$oDocument->getTrackbackCount()}</a>
<!--@end-->
</div> </div>
<!-- 엮인글 목록 --> <!-- 엮인글 목록 -->
<a name="trackback_{$document->document_srl}"></a> <a name="trackback_{$oDocument->document_srl}"></a>
<!-- 엮인글 파일 include --> <!-- 엮인글 파일 include -->
<!--@if($document->allow_trackback=='Y')--> <!--@if($oDocument->allowTrackback())-->
<!--#include("./trackback.html")--> <!--#include("./trackback.html")-->
<!--@end--> <!--@end-->
<!-- 댓글 정보 출력 --> <!-- 댓글 정보 출력 -->
<a name="comment_top_{$document->document_srl}"></a> <a name="comment_top_{$oDocument->document_srl}"></a>
<!-- 댓글 파일 include --> <!-- 댓글 파일 include -->
<!--@if($grant->write_comment&&$document->allow_comment=='Y')--> <!--@if($grant->write_comment && $oDocument->allowComment())-->
{@ $document_srl = $document->document_srl; } {@ $document_srl = $oDocument->document_srl; }
<!--#include("./comment.html")--> <!--#include("./comment.html")-->
<!--@end--> <!--@end-->

View file

@ -3,7 +3,7 @@
<form action="./" method="post" onsubmit="return procFilter(this, insert)" <!--@if($grant->fileupload)-->enctype="multipart/form-data"<!--@end-->> <form action="./" method="post" onsubmit="return procFilter(this, insert)" <!--@if($grant->fileupload)-->enctype="multipart/form-data"<!--@end-->>
<input type="hidden" name="mid" value="{$mid}" /> <input type="hidden" name="mid" value="{$mid}" />
<input type="hidden" name="content" value="{htmlspecialchars($document->content)}" /> <input type="hidden" name="content" value="{$oDocument->getContentText()}" />
<input type="hidden" name="document_srl" value="{$document_srl}" /> <input type="hidden" name="document_srl" value="{$document_srl}" />
<table border="1" width="100%"> <table border="1" width="100%">
@ -17,7 +17,7 @@
<select name="category_srl" > <select name="category_srl" >
<option value="">{$lang->category}</option> <option value="">{$lang->category}</option>
<!--@foreach($category_list as $val)--> <!--@foreach($category_list as $val)-->
<option value="{$val->category_srl}" <!--@if($category==$val->category_srl||$val->category_srl==$document->category_srl)-->selected="true"<!--@end-->>{$val->title}</option> <option value="{$val->category_srl}" <!--@if($category==$val->category_srl||$val->category_srl==$oDocument->get('category_srl'))-->selected="true"<!--@end-->>{$val->title} <!--@if($val->document_count)-->({$val->document_count})<!--@end--></option>
<!--@end--> <!--@end-->
</select> </select>
</td> </td>
@ -26,7 +26,7 @@
<!--@if(!$is_logged)--> <!--@if(!$is_logged)-->
<tr> <tr>
<th>{$lang->writer}</th> <th>{$lang->writer}</th>
<td><input type="text" name="nick_name" value="{$document->nick_name}" /></td> <td><input type="text" name="nick_name" value="{$oDocument->getNickName()}" /></td>
</tr> </tr>
<tr> <tr>
<th>{$lang->password}</th> <th>{$lang->password}</th>
@ -34,35 +34,35 @@
</tr> </tr>
<tr> <tr>
<th>{$lang->email_address}</th> <th>{$lang->email_address}</th>
<td><input type="text" name="email_address" value="{htmlspecialchars($document->email_address)}"/></td> <td><input type="text" name="email_address" value="{htmlspecialchars($oDocument->get('email_address'))}"/></td>
</tr> </tr>
<tr> <tr>
<th>{$lang->homepage}</th> <th>{$lang->homepage}</th>
<td><input type="text" name="homepage" value="{htmlspecialchars($document->homepage)}" /></td> <td><input type="text" name="homepage" value="{htmlspecialchars($oDocument->get('homepage'))}" /></td>
</tr> </tr>
<!--@end--> <!--@end-->
<tr> <tr>
<th>{$lang->title}</th> <th>{$lang->title}</th>
<td><input type="text" name="title" value="{htmlspecialchars($document->title)}" /></td> <td><input type="text" name="title" value="{$oDocument->getTitleText()}" /></td>
</tr> </tr>
<tr> <tr>
<td colspan="2"> <td colspan="2">
<!--@if($grant->manager)--> <!--@if($grant->manager)-->
<input type="checkbox" name="is_notice" value="Y" <!--@if($document->is_notice== "Y")-->checked="true"<!--@end--> id="is_notice" /> <input type="checkbox" name="is_notice" value="Y" <!--@if($oDocument->isNotice())-->checked="true"<!--@end--> id="is_notice" />
<label for="is_notice">{$lang->notice}</label> <label for="is_notice">{$lang->notice}</label>
<!--@end--> <!--@end-->
<input type="checkbox" name="is_secret" value="Y" <!--@if($document->is_secret== "Y")-->checked="true"<!--@end--> id="is_secret" /> <input type="checkbox" name="is_secret" value="Y" <!--@if($oDocument->isSecret())-->checked="true"<!--@end--> id="is_secret" />
<label for="is_secret">{$lang->secret}</label> <label for="is_secret">{$lang->secret}</label>
<input type="checkbox" name="allow_comment" value="Y" <!--@if($document->allow_comment != "N")-->checked="true"<!--@end--> id="allow_comment" /> <input type="checkbox" name="allow_comment" value="Y" <!--@if($oDocument->allowComment())-->checked="true"<!--@end--> id="allow_comment" />
<label for="allow_comment">{$lang->allow_comment}</label> <label for="allow_comment">{$lang->allow_comment}</label>
<input type="checkbox" name="lock_comment" value="Y" <!--@if($document->lock_comment == "Y")-->checked="true"<!--@end--> id="lock_comment" /> <input type="checkbox" name="lock_comment" value="Y" <!--@if($oDocument->isLocked())-->checked="true"<!--@end--> id="lock_comment" />
<label for="lock_comment">{$lang->lock_comment}</label> <label for="lock_comment">{$lang->lock_comment}</label>
<input type="checkbox" name="allow_trackback" value="Y" <!--@if($document->allow_trackback != "N")-->checked="true"<!--@end--> id="allow_trackback" /> <input type="checkbox" name="allow_trackback" value="Y" <!--@if($oDocument->allowTrackback())-->checked="true"<!--@end--> id="allow_trackback" />
<label for="allow_trackback">{$lang->allow_trackback}</label> <label for="allow_trackback">{$lang->allow_trackback}</label>
</td> </td>
</tr> </tr>
@ -87,7 +87,7 @@
<tr> <tr>
<th>{$lang->tag}</th> <th>{$lang->tag}</th>
<td> <td>
<input type="text" name="tags" value="{htmlspecialchars($document->tags)}" /> <br /> <input type="text" name="tags" value="{htmlspecialchars($oDocument->get('tags'))}" /> <br />
{$lang->about_tag} {$lang->about_tag}
</td> </td>
</tr> </tr>

View file

@ -1,9 +1,9 @@
<!--%import("filter/insert_comment.xml")--> <!--%import("filter/insert_comment.xml")-->
<!--@if($document->comment_list)--> <!--@if($oDocument->getCommentCount())-->
<ul id="reply"> <ul id="reply">
<!--@foreach($document->comment_list as $key => $val)--> <!--@foreach($oDocument->getComments() as $key => $val)-->
<li <!--@if($val->depth)-->class="reply"<!--@end-->> <li <!--@if($val->depth)-->class="reply"<!--@end-->>
<!--@if($val->depth)--> <!--@if($val->depth)-->
@ -53,6 +53,6 @@
<!--@end--> <!--@end-->
<!-- 댓글 입력 폼 --> <!-- 댓글 입력 폼 -->
<!--@if($grant->write_comment && $document->lock_comment == 'N')--> <!--@if($grant->write_comment && !$oDocument->isLocked())-->
<!--#include("./comment_form.html")--> <!--#include("./comment_form.html")-->
<!--@end--> <!--@end-->

View file

@ -12,7 +12,7 @@
</tr> </tr>
<tr> <tr>
<th>{$lang->title}</th> <th>{$lang->title}</th>
<td>{$document->title}</td> <td>{$oDocument->getTitleText()}</td>
</tr> </tr>
<tr> <tr>
<td colspan="2"> <td colspan="2">

View file

@ -5,19 +5,19 @@
<!-- 검색된 글 목록이 있고 권한이 있을 경우 출력 --> <!-- 검색된 글 목록이 있고 권한이 있을 경우 출력 -->
<!--@if($document_list && $grant->list)--> <!--@if($document_list && $grant->list)-->
<!--@foreach($document_list as $no => $document)--> <!--@foreach($document_list as $no => $oDocument)-->
<!-- 검색어가 사용되었을 경우 목록형태로 출력 --> <!-- 검색어가 사용되었을 경우 목록형태로 출력 -->
<!--@if($search_target && $search_keyword)--> <!--@if($search_target && $search_keyword)-->
<div> <div>
<!-- 일자, 제목 출력--> <!-- 일자, 제목 출력-->
[{zdate($document->regdate, "Y-m-d")}] <a href="#" onclick="winopen('{getUrl('','document_srl',$document->document_srl)}');return false;">{$document->title}</a> [{$oDocument->getRegdate("Y-m-d")}] <a href="#" onclick="winopen('{$oDocument->getPermanentUrl()}');return false;">{$oDocument->getTitleText()}</a>
<!-- 댓글이 있으면 댓글의 수 출력 --> <!-- 댓글이 있으면 댓글의 수 출력 -->
<!--@if($document->comment_count)-->({number_format($document->comment_count)})<!--@end--> <!--@if($oDocument->getCommentCount())-->({number_format($oDocument->getCommentCount())})<!--@end-->
<!-- 엮인글이 있으면 엮인글의 수 출력 --> <!-- 엮인글이 있으면 엮인글의 수 출력 -->
<!--@if($document->trackback_count)-->({number_format($document->trackback_count)})<!--@end--> <!--@if($oDocument->getTrackbackCount())-->({number_format($oDocument->getTrackbackCount())})<!--@end-->
</div> </div>
<!-- 검색어가 없다면 내용을 바로 출력 --> <!-- 검색어가 없다면 내용을 바로 출력 -->

View file

@ -1,9 +1,9 @@
<!-- 엮인글 목록 --> <!-- 엮인글 목록 -->
<!--@if($document->trackback_list)--> <!--@if($oDocument->getTrackbackCount())-->
<ul id="trackbacks"> <ul id="trackbacks">
<!--@foreach($document->trackback_list as $key => $val)--> <!--@foreach($oDocument->getTrackbacks as $key => $val)-->
<li> <li>
<a name="trackback_{$val->trackback_srl}"></a> <a name="trackback_{$val->trackback_srl}"></a>
<address> <address>

View file

@ -1,36 +1,28 @@
<!--%import("filter/vote.xml")-->
<!-- 현 글의 기본 정보를 담고 있는 form. 필수 -->
<form id="fo_document_info" action="./" method="get">
<input type="hidden" name="mid" value="{$mid}" />
<input type="hidden" name="document_srl" value="{$document_srl}" />
</form>
<!-- 글 내용 보여주기 --> <!-- 글 내용 보여주기 -->
<div class="boardRead"> <div class="boardRead">
<div class="originalContent"> <div class="originalContent">
<div class="readHeader"> <div class="readHeader">
<div class="titleAndCategory"> <div class="titleAndCategory">
<h4>{htmlspecialchars($document->title)}</h4> <h4>{$oDocument->getTitleText()}</h4>
<!--@if($module_info->use_category == "Y" && $document->category_srl)--> <!--@if($oDocument->get('category_srl'))-->
<span class="vr">|</span><span class="category">{$category_list[$document->category_srl]->title}</span> <span class="vr">|</span><span class="category">{$category_list[$oDocument->get('category_srl')]->title}</span>
<!--@end--> <!--@end-->
</div> </div>
<div class="dateAndModify"> <div class="dateAndModify">
<span class="num"> <span class="num">
<strong>{zdate($document->regdate,"Y.m.d")}</strong> {zdate($document->regdate,"H:i:s")} <strong>{$oDocument->getRegdate('Y.m.d')}</strong> {$oDocument->getRegdate('H:i:s')}
</span> </span>
<!--@if($grant->is_admin)--> <!--@if($grant->is_admin)-->
<span class="ipaddress"> <span class="ipaddress">
({$document->ipaddress}) ({$oDocument->get('ipaddress')})
</span> </span>
<!--@end--> <!--@end-->
<!--@if($document->is_granted || !$document->member_srl)--> <!--@if($oDocument->isEditable())-->
<ul> <ul>
<li><a href="{getUrl('act','dispBlogWrite','document_srl',$document->document_srl)}" class="buttonTypeB"><img src="./images/blank.gif" alt="" class="leftCap" />{$lang->cmd_modify}<img src="./images/blank.gif" alt="" class="rightCap" /></a></li> <li><a href="{getUrl('act','dispBlogWrite','document_srl',$oDocument->document_srl)}" class="buttonTypeB"><img src="./images/blank.gif" alt="" class="leftCap" />{$lang->cmd_modify}<img src="./images/blank.gif" alt="" class="rightCap" /></a></li>
<li><a href="{getUrl('act','dispBlogDelete','document_srl',$document->document_srl)}" class="buttonTypeB"><img src="./images/blank.gif" alt="" class="leftCap" />{$lang->cmd_delete}<img src="./images/blank.gif" alt="" class="rightCap" /></a></li> <li><a href="{getUrl('act','dispBlogDelete','document_srl',$oDocument->document_srl)}" class="buttonTypeB"><img src="./images/blank.gif" alt="" class="leftCap" />{$lang->cmd_delete}<img src="./images/blank.gif" alt="" class="rightCap" /></a></li>
</ul> </ul>
<!--@end--> <!--@end-->
</div> </div>
@ -38,42 +30,44 @@
<dl class="uri"> <dl class="uri">
<dt>{$lang->document_url} :</dt> <dt>{$lang->document_url} :</dt>
<dd>{getUrl('','document_srl',$document->document_srl)}</dd> <dd>{$oDocument->getPermanentUrl()}</dd>
<!--@if($document->allow_trackback=='Y')--> <!--@if($oDocument->allowTrackback())-->
<dt>{$lang->trackback_url} :</dt> <dt>{$lang->trackback_url} :</dt>
<dd>{getUrl('','document_srl',$document->document_srl,'act','trackback')}</dd> <dd>{$oDocument->getTrackbackUrl()}</dd>
<!--@end--> <!--@end-->
</dl> </dl>
<!--@if($module_info->display_writer == "on")--> <!--@if($module_info->display_writer == "on")-->
<div class="userInfo"> <div class="userInfo">
<div class="author member_{$document->member_srl}">{htmlspecialchars($document->nick_name)}</div> <div class="author member_{$oDocument->get('member_srl')}">{$oDocument->getNickName()}</div>
</div> </div>
<!--@end--> <!--@end-->
<div class="readBody">{$document->content}</div> <div class="readBody">{$oDocument->getContent()}</div>
<div class="readFooter"> <div class="readFooter">
<!--@if($document->tag_list)--> {@ $tag_list = $oDocument->get('tag_list') }
<!--@if(count($tag_list))-->
<div class="tag"> <div class="tag">
<h5><img src="./images/{$module_info->colorset}/iconTag.gif" alt="{$lang->tag}" width="17" height="10" class="tagIcon" /></h5> <h5><img src="./images/{$module_info->colorset}/iconTag.gif" alt="{$lang->tag}" width="17" height="10" class="tagIcon" /></h5>
<ul> <ul>
<!--@for($i=0;$i<count($document->tag_list);$i++)--> <!--@for($i=0;$i<count($tag_list);$i++)-->
{@ $tag = $document->tag_list[$i]; } {@ $tag = $tag_list[$i]; }
<li> <li>
<a href="{getUrl('search_target','tag','search_keyword',urlencode($tag),'document_srl','')}">{htmlspecialchars($tag)}</a><!--@if($i<count($document->tag_list)-1)-->,<!--@end--> <a href="{getUrl('search_target','tag','search_keyword',urlencode($tag),'document_srl','')}">{htmlspecialchars($tag)}</a><!--@if($i<count($tag_list)-1)-->,<!--@end-->
</li> </li>
<!--@end--> <!--@end-->
</ul> </ul>
</div> </div>
<!--@end--> <!--@end-->
<!--@if($document->uploaded_count && $document->uploaded_list)--> <!--@if($oDocument->hasUploadedFiles())-->
<div class="fileAttached"> <div class="fileAttached">
<h5>{$lang->uploaded_file} : </h5> <h5>{$lang->uploaded_file} : </h5>
<ul> <ul>
<!--@foreach($document->uploaded_list as $key => $file)--> {@ $uploaded_list = $oDocument->getUploadedFiles() }
<!--@foreach($uploaded_list as $key => $file)-->
<li><a href="{getUrl('')}{$file->download_url}">{$file->source_filename} ({FileHandler::filesize($file->file_size)})({number_format($file->download_count)})</a></li> <li><a href="{getUrl('')}{$file->download_url}">{$file->source_filename} ({FileHandler::filesize($file->file_size)})({number_format($file->download_count)})</a></li>
<!--@end--> <!--@end-->
</ul> </ul>
@ -83,25 +77,25 @@
</div> </div>
<ul class="replyAndTrackback"> <ul class="replyAndTrackback">
<!--@if($grant->write_comment&&$document->allow_comment=='Y')--> <!--@if($grant->write_comment && $oDocument->allowComment()) -->
<li class="reply"><a href="#trackback_{$document->document_srl}">{$lang->comment} <strong>{count($document->comment_list)}</strong></a></li> <li class="reply"><a href="#trackback_{$oDocument->document_srl}">{$lang->comment} <strong>{$oDocument->getCommentCount()}</strong></a></li>
<!--@end--> <!--@end-->
<!--@if($document->allow_trackback=='Y')--> <!--@if($oDocument->allowTrackback())-->
<li class="trackback"><a href="#comment_top_{$document->document_srl}">{$lang->trackback} <strong>{count($document->trackback_list)}</strong></a></li> <li class="trackback"><a href="#comment_top_{$oDocument->document_srl}">{$lang->trackback} <strong>{$oDocument->getTrackbackCount()}</strong></a></li>
<!--@end--> <!--@end-->
</ul> </ul>
</div> </div>
<!-- 엮인글 파일 include --> <!-- 엮인글 파일 include -->
<a name="trackback_{$document->document_srl}"></a> <a name="trackback_{$oDocument->document_srl}"></a>
<!--@if($document->allow_trackback=='Y')--> <!--@if($oDocument->allowTrackback())-->
<!--#include("./trackback.html")--> <!--#include("./trackback.html")-->
<!--@end--> <!--@end-->
<!-- 댓글 파일 include --> <!-- 댓글 파일 include -->
<a name="comment_top_{$document->document_srl}"></a> <a name="comment_top_{$oDocument->document_srl}"></a>
<!--@if($grant->write_comment&&$document->allow_comment=='Y')--> <!--@if($grant->write_comment && $oDocument->allowComment())-->
{@ $document_srl = $document->document_srl; } {@ $document_srl = $oDocument->document_srl; }
<!--#include("./comment.html")--> <!--#include("./comment.html")-->
<!--@end--> <!--@end-->

View file

@ -5,62 +5,62 @@
<form action="./" method="post" onsubmit="return procFilter(this, insert)" <!--@if($grant->fileupload)-->enctype="multipart/form-data"<!--@end--> class="boardEditor" id="fo_write"> <form action="./" method="post" onsubmit="return procFilter(this, insert)" <!--@if($grant->fileupload)-->enctype="multipart/form-data"<!--@end--> class="boardEditor" id="fo_write">
<fieldset> <fieldset>
<input type="hidden" name="mid" value="{$mid}" /> <input type="hidden" name="mid" value="{$mid}" />
<input type="hidden" name="content" value="{htmlspecialchars($document->content)}" /> <input type="hidden" name="content" value="{$oDocument->getContentText()}" />
<input type="hidden" name="document_srl" value="{$document_srl}" /> <input type="hidden" name="document_srl" value="{$document_srl}" />
<!--@if(!$is_logged)--> <!--@if(!$is_logged)-->
<div class="userNameAndPw"> <div class="userNameAndPw">
<label for="userName">{$lang->writer}</label> <label for="userName">{$lang->writer}</label>
<input type="text" name="nick_name" value="{$document->nick_name}" class="userName inputTypeText" id="userName"/> <input type="text" name="nick_name" value="{$oDocument->getNickName()}" class="userName inputTypeText" id="userName"/>
<label for="userPw">{$lang->password}</label> <label for="userPw">{$lang->password}</label>
<input type="password" name="password" value="" id="userPw" class="userPw inputTypeText" /> <input type="password" name="password" value="" id="userPw" class="userPw inputTypeText" />
<label for="emailAddress">{$lang->email_address}</label> <label for="emailAddress">{$lang->email_address}</label>
<input type="text" name="email_address" value="{htmlspecialchars($document->email_address)}" id="emailAddress" class="emailAddress inputTypeText"/> <input type="text" name="email_address" value="{htmlspecialchars($oDocument->get('email_address'))}" id="emailAddress" class="emailAddress inputTypeText"/>
<label for="homePage">{$lang->homepage}</label> <label for="homePage">{$lang->homepage}</label>
<input type="text" name="homepage" value="{htmlspecialchars($document->homepage)}" id="homePage" class="homePage inputTypeText"/> <input type="text" name="homepage" value="{htmlspecialchars($oDocument->get('homepage'))}" id="homePage" class="homePage inputTypeText"/>
</div> </div>
<!--@end--> <!--@end-->
<div class="title"> <div class="title">
<label for="title" class="title">{$lang->title}</label> <label for="title" class="title">{$lang->title}</label>
<!--@if($category_list)--> <!--@if($module_info->use_category=="Y")-->
<select name="category_srl" > <select name="category_srl" >
<option value="">{$lang->category}</option> <option value="">{$lang->category}</option>
<!--@foreach($category_list as $val)--> <!--@foreach($category_list as $val)-->
<option value="{$val->category_srl}" <!--@if($category==$val->category_srl||$val->category_srl==$document->category_srl)-->selected="true"<!--@end-->>{$val->title} <!--@if($val->document_count)-->({$val->document_count})<!--@end--></option> <option value="{$val->category_srl}" <!--@if($category==$val->category_srl||$val->category_srl==$oDocument->get('category_srl'))-->selected="true"<!--@end-->>{$val->title} <!--@if($val->document_count)-->({$val->document_count})<!--@end--></option>
<!--@end--> <!--@end-->
</select> </select>
<!--@end--> <!--@end-->
<input type="text" name="title" id="title" class="inputTypeText" value="{htmlspecialchars($document->title)}" /> <input type="text" name="title" id="title" class="inputTypeText" value="{$oDocument->getTitleText()}" />
</div> </div>
<dl class="option"> <dl class="option">
<dt>설정옵션</dt> <dt>설정옵션</dt>
<!--@if($grant->manager)--> <!--@if($grant->manager)-->
<dd> <dd>
<input type="checkbox" name="is_notice" value="Y" <!--@if($document->is_notice== "Y")-->checked="true"<!--@end--> id="is_notice" /> <input type="checkbox" name="is_notice" value="Y" <!--@if($oDocument->isNotice())-->checked="true"<!--@end--> id="is_notice" />
<label for="is_notice">{$lang->notice}</label> <label for="is_notice">{$lang->notice}</label>
</dd> </dd>
<dd> <dd>
<input type="checkbox" name="lock_comment" value="Y" <!--@if($document->lock_comment == "Y")-->checked="true"<!--@end--> id="lock_comment" /> <input type="checkbox" name="lock_comment" value="Y" <!--@if($oDocument->isLocked())-->checked="true"<!--@end--> id="lock_comment" />
<label for="lock_comment">{$lang->lock_comment}</label> <label for="lock_comment">{$lang->lock_comment}</label>
</dd> </dd>
<!--@end--> <!--@end-->
<dd> <dd>
<input type="checkbox" name="is_secret" value="Y" <!--@if($document->is_secret== "Y")-->checked="true"<!--@end--> id="is_secret" /> <input type="checkbox" name="is_secret" value="Y" <!--@if($oDocument->isSecret())-->checked="true"<!--@end--> id="is_secret" />
<label for="is_secret">{$lang->secret}</label> <label for="is_secret">{$lang->secret}</label>
</dd> </dd>
<dd> <dd>
<input type="checkbox" name="allow_comment" value="Y" <!--@if($document->allow_comment != "N")-->checked="true"<!--@end--> id="allow_comment" /> <input type="checkbox" name="allow_comment" value="Y" <!--@if($oDocument->allowComment())-->checked="true"<!--@end--> id="allow_comment" />
<label for="allow_comment">{$lang->allow_comment}</label> <label for="allow_comment">{$lang->allow_comment}</label>
</dd> </dd>
<dd> <dd>
<input type="checkbox" name="allow_trackback" value="Y" <!--@if($document->allow_trackback != "N")-->checked="true"<!--@end--> id="allow_trackback" /> <input type="checkbox" name="allow_trackback" value="Y" <!--@if($oDocument->allowTrackback())-->checked="true"<!--@end--> id="allow_trackback" />
<label for="allow_trackback">{$lang->allow_trackback}</label> <label for="allow_trackback">{$lang->allow_trackback}</label>
</dd> </dd>
</dl> </dl>
@ -83,7 +83,7 @@
<div class="tag"> <div class="tag">
<label for="tag">{$lang->tag}</label> <label for="tag">{$lang->tag}</label>
<input type="text" name="tags" id="tag" value="{htmlspecialchars($document->tags)}" class="inputTypeText" /> <input type="text" name="tags" id="tag" value="{htmlspecialchars($oDocument->get('tags'))}" class="inputTypeText" />
<p class="info">{$lang->about_tag}</p> <p class="info">{$lang->about_tag}</p>
</div> </div>

View file

@ -220,8 +220,8 @@
// 목록이 있으면 게시글을 가져옴 // 목록이 있으면 게시글을 가져옴
if(count($flag_list)) $document_srl_list = array_keys($flag_list); if(count($flag_list)) $document_srl_list = array_keys($flag_list);
if(is_array($document_srl_list) && count($document_srl_list)) { if(is_array($document_srl_list) && count($document_srl_list)) {
$oDocumentModeul = &getModel('document'); $oDocumentModel = &getModel('document');
$document_list = $oDocumentModeul->getDocuments($document_srl_list, $this->grant->is_admin); $document_list = $oDocumentModel->getDocuments($document_srl_list, $this->grant->is_admin);
Context::set('document_list', $document_list); Context::set('document_list', $document_list);
} }

View file

@ -51,31 +51,31 @@
// document 객체를 생성. 기본 데이터 구조의 경우 document모듈만 쓰면 만사 해결.. -_-; // document 객체를 생성. 기본 데이터 구조의 경우 document모듈만 쓰면 만사 해결.. -_-;
$oDocumentModel = &getModel('document'); $oDocumentModel = &getModel('document');
// document_srl이 있다면 해당 글을 구해오자 // 선택된 문서 표시를 위한 객체 생성
$oDocument = $oDocumentModel->getDocument(0, $this->grant->manager);
// document_srl이 있다면 해당 글을 구해와서 $oDocument로 세팅
if($this->grant->view && $document_srl) { if($this->grant->view && $document_srl) {
// 글을 구함 // 글을 구함
$document = $oDocumentModel->getDocument($document_srl, $this->grant->manager, true); $oDocument->setDocument($document_srl);
if($this->grant->manager) $oDocument->setGrant();
// 찾아지지 않았다면 초기화 if(!$oDocument->isExists()) {
if($document->document_srl != $document_srl) {
unset($document);
unset($document_srl);
Context::set('document_srl','',true); Context::set('document_srl','',true);
} else {
// 브라우저 타이틀 설정
Context::setBrowserTitle($oDocument->getTitleText());
// 글이 찾아졌으면 댓글 권한과 허용 여부를 체크하여 댓글 에디터 세팅 // 조회수 증가
} elseif($this->grant->write_comment && $document->allow_comment == 'Y' && $document->lock_comment != 'Y') { $oDocument->updateReadedCount();
// 브라우저 타이틀
$browser_title = $this->module_info->browser_title.' - '.$document->title;
Context::setBrowserTitle($browser_title);
// 댓글
$this->setCommentEditor(0, 100);
} }
Context::set('document', $document);
} }
Context::set('oDocument', $oDocument);
// 댓글에디터 설정
$this->setCommentEditor(0, 100);
// 만약 document_srl은 있는데 page가 없다면 글만 호출된 경우 page를 구해서 세팅해주자.. // 만약 document_srl은 있는데 page가 없다면 글만 호출된 경우 page를 구해서 세팅해주자..
if($document_srl && !$page) { if($document_srl && !$page) {
@ -93,7 +93,6 @@
$args->search_target = Context::get('search_target'); ///< 검색 대상 (title, contents...) $args->search_target = Context::get('search_target'); ///< 검색 대상 (title, contents...)
$args->search_keyword = Context::get('search_keyword'); ///< 검색어 $args->search_keyword = Context::get('search_keyword'); ///< 검색어
if($this->module_info->use_category=='Y') $args->category_srl = Context::get('category'); ///< 카테고리 사용시 선택된 카테고리 if($this->module_info->use_category=='Y') $args->category_srl = Context::get('category'); ///< 카테고리 사용시 선택된 카테고리
$args->sort_index = Context::get('sort_index'); $args->sort_index = Context::get('sort_index');
$args->order_type = Context::get('order_type'); $args->order_type = Context::get('order_type');
@ -135,22 +134,18 @@
// document 모듈 객체 생성 // document 모듈 객체 생성
$oDocumentModel = &getModel('document'); $oDocumentModel = &getModel('document');
// 지정된 글이 없다면 (신규) 새로운 번호를 만든다 $oDocument = $oDocumentModel->getDocument(0, $this->grant->manager);
if($document_srl) { $oDocument->setDocument($document_srl);
$document = $oDocumentModel->getDocument($document_srl, $this->grant->manager);
if(!$document) { if(!$oDocument->isExists()) Context::set('document_srl','');
unset($document_srl);
Context::set('document_srl','');
}
}
if(!$document_srl) $document_srl = getNextSequence(); if(!$document_srl) $document_srl = getNextSequence();
// 글을 수정하려고 할 경우 권한이 없는 경우 비밀번호 입력화면으로 // 글을 수정하려고 할 경우 권한이 없는 경우 비밀번호 입력화면으로
if($document&&!$document->is_granted) return $this->setTemplateFile('input_password_form'); if($oDocument->isExists()&&!$oDocument->isGranted()) return $this->setTemplateFile('input_password_form');
Context::set('document_srl',$document_srl); Context::set('document_srl',$document_srl);
Context::set('document', $document); Context::set('oDocument', $oDocument);
// 에디터 모듈의 getEditor를 호출하여 세팅 // 에디터 모듈의 getEditor를 호출하여 세팅
$oEditorModel = &getModel('editor'); $oEditorModel = &getModel('editor');

View file

@ -1,16 +1,16 @@
<!-- 댓글 정보 출력 --> <!-- 댓글 정보 출력 -->
<a name="comment_top_{$document_srl}"></a> <a name="comment_top_{$document_srl}"></a>
<div> <div>
{$lang->comment} : {count($document->comment_list)} {$lang->comment} : {$oDocument->getCommentCount()}
</div> </div>
<!-- 댓글 출력 --> <!-- 댓글 출력 -->
<div> <div>
<!-- 댓글 목록 --> <!-- 댓글 목록 -->
<!--@if($document->comment_list)--> <!--@if($oDocument->getCommentCount())-->
<!--@foreach($document->comment_list as $key => $val)--> <!--@foreach($oDocument->getComments() as $key => $val)-->
<a name="comment_{$key}"></a> <a name="comment_{$key}"></a>
<div style="margin-left:{$val->depth*15}px" > <div style="margin-left:{$val->depth*15}px" >
<table border="1" width="100%"> <table border="1" width="100%">
@ -68,7 +68,7 @@
<!-- 댓글 입력 폼 --> <!-- 댓글 입력 폼 -->
<!--@if($grant->write_comment && $document->lock_comment == 'N')--> <!--@if($grant->write_comment && !$oDocument->isLocked())-->
<!--#include("./comment_form.html")--> <!--#include("./comment_form.html")-->
<!--@end--> <!--@end-->

View file

@ -12,7 +12,7 @@
</tr> </tr>
<tr> <tr>
<th>{$lang->title}</th> <th>{$lang->title}</th>
<td>{$document->title}</td> <td>{$oDocument->getTitleText()}</td>
</tr> </tr>
<tr> <tr>
<td colspan="2"> <td colspan="2">

View file

@ -2,7 +2,7 @@
<!--#include("header.html")--> <!--#include("header.html")-->
<!-- 게시물 내용 include --> <!-- 게시물 내용 include -->
<!--@if($document && $grant->view)--> <!--@if($oDocument->isExists() && $grant->view)-->
<!--#include("./view_document.html")--> <!--#include("./view_document.html")-->
<!--@end--> <!--@end-->
@ -32,48 +32,44 @@
<th>{$lang->date}</th> <th>{$lang->date}</th>
</tr> </tr>
<!--@foreach($document_list as $no => $val)--> <!--@foreach($document_list as $no => $document)-->
<tr> <tr>
<td>{$no}</td> <td>{$no}</td>
<!--@if($category_list)--> <!--@if($category_list)-->
<td>{$category_list[$val->category_srl]->title}</td> <td>{$category_list[$document->get('category_srl')]->title}</td>
<!--@end--> <!--@end-->
<td> <td>
<!--@if($grant->is_admin)--> <!--@if($grant->is_admin)-->
<input type="checkbox" value="{$val->document_srl}" onclick="doAddCart('{$mid}',this)" <!--@if($check_list[$val->document_srl])-->checked="true"<!--@end--> /> <input type="checkbox" value="{$document->document_srl}" onclick="doAddCart('{$mid}',this)" <!--@if($check_list[$document->document_srl])-->checked="true"<!--@end--> />
<!--@end-->
<!--@if($module_info->subject_cut_size>0)-->
{@ $val->title = cut_str($val->title,$module_info->subject_cut_size)}
<!--@end--> <!--@end-->
<!--@if($grant->view)--> <!--@if($grant->view)-->
<!-- 검색중일 경우는 새창으로 --> <!-- 검색중일 경우는 새창으로 -->
<!--@if($search_target && $search_keyword)--> <!--@if($search_target && $search_keyword)-->
<a href="#" onclick="winopen('{getUrl('','document_srl',$val->document_srl)}','viewDocument');return false;">{htmlspecialchars($val->title)}</a> <a href="#" onclick="winopen('{getUrl('','document_srl',$document->document_srl)}','viewDocument');return false;">{$document->getTitleText($module_info->subject_cut_size)}</a>
<!-- 검색을 하지 않을 시에는 현재창으로 --> <!-- 검색을 하지 않을 시에는 현재창으로 -->
<!--@else--> <!--@else-->
<a href="{getUrl('','document_srl',$val->document_srl)}">{htmlspecialchars($val->title)}</a> <a href="{getUrl('','document_srl',$document->document_srl)}">{$document->getTitleText($module_info->subject_cut_size)}</a>
<!--@end--> <!--@end-->
<!--@else--> <!--@else-->
{htmlspecialchars($val->title)} {$document->getTitleText($module_info->subject_cut_size)}
<!--@end--> <!--@end-->
<!--@if($val->comment_count>0)--> <!--@if($document->getCommentCount())-->
[<a href="{getUrl('document_srl',$val->document_srl)}#comment">{$val->comment_count}</a>] [<a href="{getUrl('document_srl',$document->document_srl)}#comment">{$document->getCommentCount()}</a>]
<!--@end--> <!--@end-->
<!--@if($val->trackback_count>0)--> <!--@if($document->trackback_count>0)-->
[<a href="{getUrl('document_srl',$val->document_srl)}#trackback">{$val->trackback_count}</a>] [<a href="{getUrl('document_srl',$document->document_srl)}#trackback">{$document->getTrackbackCount()}</a>]
<!--@end--> <!--@end-->
</td> </td>
<td><div class="member_{$val->member_srl}">{$val->nick_name}</div></td> <td><div class="member_{$document->get('member_srl')}">{$document->getNickName()}</div></td>
<td>{$val->readed_count}</td> <td>{$document->get('readed_count')}</td>
<td>{$val->voted_count}</td> <td>{$document->get('voted_count')}</td>
<td>{zdate($val->regdate,"Y-m-d")}</td> <td>{$document->getRegdate("Y-m-d")}</td>
</tr> </tr>
<!--@end--> <!--@end-->
</table> </table>

View file

@ -1,12 +1,12 @@
<!-- 엮인글 정보 출력 --> <!-- 엮인글 정보 출력 -->
<div> <div>
{$lang->trackback} : {count($document->trackback_list)} {$lang->trackback} : {$oDocument->getTrackbackCount()}
</div> </div>
<!-- 엮인글 목록 --> <!-- 엮인글 목록 -->
<!--@if($document->trackback_list)--> <!--@if($oDocument->getTrackbackCount())-->
<div> <div>
<!--@foreach($document->trackback_list as $key => $val)--> <!--@foreach($oDocument->getTrackbacks as $key => $val)-->
<a name="trackback_{$val->trackback_srl}"></a> <a name="trackback_{$val->trackback_srl}"></a>
<div style="margin-left:{$val->depth*15}px" > <div style="margin-left:{$val->depth*15}px" >

View file

@ -3,7 +3,7 @@
<!-- 현 글의 기본 정보를 담고 있는 form. 필수 --> <!-- 현 글의 기본 정보를 담고 있는 form. 필수 -->
<form id="fo_document_info" action="./" method="get"> <form id="fo_document_info" action="./" method="get">
<input type="hidden" name="mid" value="{$mid}" /> <input type="hidden" name="mid" value="{$mid}" />
<input type="hidden" name="document_srl" value="{$document_srl}" /> <input type="hidden" name="document_srl" value="{$oDocument->document_srl}" />
</form> </form>
<!-- 글 내용 보여주기 --> <!-- 글 내용 보여주기 -->
@ -12,72 +12,69 @@
<col width="120" /> <col width="120" />
<col width="*" /> <col width="*" />
<!--@if($category_list && $document->category_srl)--> <!--@if($category_list && $oDocument->document->category_srl)-->
<tr> <tr>
<th>{$lang->category}</th> <th>{$lang->category}</th>
<td>{$category_list[$document->category_srl]->title}</td> <td>{$category_list[$oDocument->get('category_srl')]->title}</td>
</tr> </tr>
<!--@end--> <!--@end-->
<tr> <tr>
<th>{$lang->title}</th> <th>{$lang->title}</th>
<td>{htmlspecialchars($document->title)}</td> <td>{$oDocument->getTitleText()}</td>
</tr> </tr>
<!--@if($document->homepage)-->
<tr>
<th>{$lang->homepage}</th>
<td><a href="{$document->homepage}" onclick="winopen('{$document->homepage}'); return false;">{htmlspecialchars($document->homepage)}</a></td>
</tr>
<!--@end-->
<tr> <tr>
<th>{$lang->date}</th> <th>{$lang->date}</th>
<td>{zdate($document->regdate,"Y-m-d H:i:s")}</td> <td>{$oDocument->getRegdate('Y-m-d H:i:s')}</td>
</tr> </tr>
<tr> <tr>
<th>{$lang->writer}</th> <th>{$lang->writer}</th>
<td><div class="member_{$document->member_srl}">{htmlspecialchars($document->nick_name)}</div></td> <td><div class="member_{$oDocument->get('member_srl')}">{$oDocument->getNickName()}</div></td>
</tr> </tr>
<tr> <tr>
<th>{$lang->readed_count}</th> <th>{$lang->readed_count}</th>
<td>{$document->readed_count}</td> <td>{$oDocument->get('readed_count')}</td>
</tr> </tr>
<tr> <tr>
<th>{$lang->voted_count}</th> <th>{$lang->voted_count}</th>
<td>{$document->voted_count}</td> <td>{$oDocument->get('voted_count')}</td>
</tr> </tr>
<tr> <tr>
<th>{$lang->content}</th> <th>{$lang->content}</th>
<td height="100" valign="top">{$document->content}</td> <td height="100" valign="top">{$oDocument->getContent()}</td>
</tr> </tr>
<tr> <tr>
<th>{$lang->document_url}</th> <th>{$lang->document_url}</th>
<td>{getUrl('','document_srl',$document->document_srl)}</td> <td>{$oDocument->getPermanentUrl()}</td>
</tr> </tr>
<!--@if($document->allow_trackback=='Y')--> <!--@if($oDocument->allowTrackback())-->
<tr> <tr>
<th>{$lang->trackback_url}</th> <th>{$lang->trackback_url}</th>
<td>{getUrl('','document_srl',$document->document_srl,'act','trackback')}</td> <td>{$oDocument->getTrackbackUrl()}</td>
</tr> </tr>
<!--@end--> <!--@end-->
<!--@if($document->tag_list)--> {@ $tag_list = $oDocument->get('tag_list') }
<!--@if(count($tag_list))-->
<tr> <tr>
<th>{$lang->tag}</th> <th>{$lang->tag}</th>
<td> <td>
<!--@foreach($document->tag_list as $val)--> <!--@for($i=0;$i<count($tag_list);$i++)-->
<a href="{getUrl('search_target','tag','search_keyword',urlencode($val),'document_srl','')}">{htmlspecialchars($val)}</a> {@ $tag = $tag_list[$i]; }
<a href="{getUrl('search_target','tag','search_keyword',urlencode($tag),'document_srl','')}">{htmlspecialchars($tag)}</a><!--@if($i<count($tag_list)-1)-->,<!--@end-->
<!--@end--> <!--@end-->
</td> </td>
</tr> </tr>
<!--@end--> <!--@end-->
<!--@if($document->uploaded_count && $document->uploaded_list)--> <!--@if($oDocument->hasUploadedFiles())-->
<tr> <tr>
<th>{$lang->uploaded_file}</th> <th>{$lang->uploaded_file}</th>
<td> <td>
<!--@foreach($document->uploaded_list as $key => $file)--> {@ $uploaded_list = $oDocument->getUploadedFiles() }
<div><a href="{$file->download_url}">{$file->source_filename} ({FileHandler::filesize($file->file_size)})</a> ({number_format($file->download_count)})</div> <!--@foreach($uploaded_list as $key => $file)-->
<span><a href="{$file->download_url}">{$file->source_filename} ({FileHandler::filesize($file->file_size)})</a> ({number_format($file->download_count)})</span>
<!--@end--> <!--@end-->
</td> </td>
</tr> </tr>
@ -85,19 +82,19 @@
<tr> <tr>
<th>ipaddress</th> <th>ipaddress</th>
<td>{$document->ipaddress}</td> <td>{$oDocument->get('ipaddress')}</td>
</tr> </tr>
<tr> <tr>
<td colspan="2"> <td colspan="2">
<!--@if($document->allow_comment=='Y')--> <!--@if($oDocument->allowComment())-->
{$lang->allow_comment} {$lang->allow_comment}
<!--@end--> <!--@end-->
<!--@if($document->lock_comment=='Y')--> <!--@if($oDocument->isLocked())-->
{$lang->lock_comment} {$lang->lock_comment}
<!--@end--> <!--@end-->
<!--@if($document->allow_trackback=='Y')--> <!--@if($oDocument->allowTrackback())-->
{$lang->allow_trackback} {$lang->allow_trackback}
<!--@end--> <!--@end-->
</td> </td>
@ -110,7 +107,7 @@
<a href="{getUrl('document_srl','')}">[{$lang->cmd_list}]</a> <a href="{getUrl('document_srl','')}">[{$lang->cmd_list}]</a>
<a href="#" onclick="doVote();return false;">[{$lang->cmd_vote}]</a> <a href="#" onclick="doVote();return false;">[{$lang->cmd_vote}]</a>
<!--@if($document->is_granted || !$document->member_srl)--> <!--@if($oDocument->isEditable())-->
<a href="{getUrl('act','dispBoardWrite')}">[{$lang->cmd_modify}]</a> <a href="{getUrl('act','dispBoardWrite')}">[{$lang->cmd_modify}]</a>
<a href="{getUrl('act','dispBoardDelete')}">[{$lang->cmd_delete}]</a> <a href="{getUrl('act','dispBoardDelete')}">[{$lang->cmd_delete}]</a>
<!--@end--> <!--@end-->
@ -118,13 +115,13 @@
<!-- 엮인글 파일 include --> <!-- 엮인글 파일 include -->
<!--@if($document->allow_trackback=='Y')--> <!--@if($oDocument->allowTrackback())-->
<a name="trackback"></a> <a name="trackback"></a>
<!--#include("./trackback.html")--> <!--#include("./trackback.html")-->
<!--@end--> <!--@end-->
<!-- 댓글 파일 include --> <!-- 댓글 파일 include -->
<!--@if($grant->write_comment&&$document->allow_comment=='Y')--> <!--@if($grant->write_comment && $oDocument->allowComment())-->
<a name="comment"></a> <a name="comment"></a>
<!--#include("./comment.html")--> <!--#include("./comment.html")-->
<!--@end--> <!--@end-->

View file

@ -3,7 +3,7 @@
<form action="./" method="post" onsubmit="return procFilter(this, insert)" <!--@if($grant->fileupload)-->enctype="multipart/form-data"<!--@end-->> <form action="./" method="post" onsubmit="return procFilter(this, insert)" <!--@if($grant->fileupload)-->enctype="multipart/form-data"<!--@end-->>
<input type="hidden" name="mid" value="{$mid}" /> <input type="hidden" name="mid" value="{$mid}" />
<input type="hidden" name="content" value="{htmlspecialchars($document->content)}" /> <input type="hidden" name="content" value="{$oDocument->getContentText()}" />
<input type="hidden" name="document_srl" value="{$document_srl}" /> <input type="hidden" name="document_srl" value="{$document_srl}" />
<table border="1" width="100%"> <table border="1" width="100%">
@ -17,7 +17,7 @@
<select name="category_srl" > <select name="category_srl" >
<option value="">{$lang->category}</option> <option value="">{$lang->category}</option>
<!--@foreach($category_list as $val)--> <!--@foreach($category_list as $val)-->
<option value="{$val->category_srl}" <!--@if($category==$val->category_srl||$val->category_srl==$document->category_srl)-->selected="true"<!--@end-->>{$val->title} <!--@if($val->document_count)-->({$val->document_count})<!--@end--></option> <option value="{$val->category_srl}" <!--@if($category==$val->category_srl||$val->category_srl==$oDocument->get('category_srl'))-->selected="true"<!--@end-->>{$val->title} <!--@if($val->document_count)-->({$val->document_count})<!--@end--></option>
<!--@end--> <!--@end-->
</select> </select>
</td> </td>
@ -26,7 +26,7 @@
<!--@if(!$is_logged)--> <!--@if(!$is_logged)-->
<tr> <tr>
<th>{$lang->writer}</th> <th>{$lang->writer}</th>
<td><input type="text" name="nick_name" value="{$document->nick_name}" /></td> <td><input type="text" name="nick_name" value="{$oDocument->getNickName()}" /></td>
</tr> </tr>
<tr> <tr>
<th>{$lang->password}</th> <th>{$lang->password}</th>
@ -34,35 +34,35 @@
</tr> </tr>
<tr> <tr>
<th>{$lang->email_address}</th> <th>{$lang->email_address}</th>
<td><input type="text" name="email_address" value="{htmlspecialchars($document->email_address)}"/></td> <td><input type="text" name="email_address" value="{htmlspecialchars($oDocument->get('email_address'))}"/></td>
</tr> </tr>
<tr> <tr>
<th>{$lang->homepage}</th> <th>{$lang->homepage}</th>
<td><input type="text" name="homepage" value="{htmlspecialchars($document->homepage)}" /></td> <td><input type="text" name="homepage" value="{htmlspecialchars($oDocument->get('homepage'))}" /></td>
</tr> </tr>
<!--@end--> <!--@end-->
<tr> <tr>
<th>{$lang->title}</th> <th>{$lang->title}</th>
<td><input type="text" name="title" value="{htmlspecialchars($document->title)}" /></td> <td><input type="text" name="title" value="{$oDocument->getTitleText()}" /></td>
</tr> </tr>
<tr> <tr>
<td colspan="2"> <td colspan="2">
<!--@if($grant->manager)--> <!--@if($grant->manager)-->
<input type="checkbox" name="is_notice" value="Y" <!--@if($document->is_notice== "Y")-->checked="true"<!--@end--> id="is_notice" /> <input type="checkbox" name="is_notice" value="Y" <!--@if($oDocument->isNotice())-->checked="true"<!--@end--> id="is_notice" />
<label for="is_notice">{$lang->notice}</label> <label for="is_notice">{$lang->notice}</label>
<!--@end--> <!--@end-->
<input type="checkbox" name="is_secret" value="Y" <!--@if($document->is_secret== "Y")-->checked="true"<!--@end--> id="is_secret" /> <input type="checkbox" name="is_secret" value="Y" <!--@if($oDocument->isSecret())-->checked="true"<!--@end--> id="is_secret" />
<label for="is_secret">{$lang->secret}</label> <label for="is_secret">{$lang->secret}</label>
<input type="checkbox" name="allow_comment" value="Y" <!--@if($document->allow_comment != "N")-->checked="true"<!--@end--> id="allow_comment" /> <input type="checkbox" name="allow_comment" value="Y" <!--@if($oDocument->allowComment())-->checked="true"<!--@end--> id="allow_comment" />
<label for="allow_comment">{$lang->allow_comment}</label> <label for="allow_comment">{$lang->allow_comment}</label>
<input type="checkbox" name="lock_comment" value="Y" <!--@if($document->lock_comment == "Y")-->checked="true"<!--@end--> id="lock_comment" /> <input type="checkbox" name="lock_comment" value="Y" <!--@if($oDocument->isLocked())-->checked="true"<!--@end--> id="lock_comment" />
<label for="lock_comment">{$lang->lock_comment}</label> <label for="lock_comment">{$lang->lock_comment}</label>
<input type="checkbox" name="allow_trackback" value="Y" <!--@if($document->allow_trackback != "N")-->checked="true"<!--@end--> id="allow_trackback" /> <input type="checkbox" name="allow_trackback" value="Y" <!--@if($oDocument->allowTrackback())-->checked="true"<!--@end--> id="allow_trackback" />
<label for="allow_trackback">{$lang->allow_trackback}</label> <label for="allow_trackback">{$lang->allow_trackback}</label>
</td> </td>
</tr> </tr>
@ -87,7 +87,7 @@
<tr> <tr>
<th>{$lang->tag}</th> <th>{$lang->tag}</th>
<td> <td>
<input type="text" name="tags" value="{htmlspecialchars($document->tags)}" /> <br /> <input type="text" name="tags" value="{htmlspecialchars($oDocument->get('tags'))}" /> <br />
{$lang->about_tag} {$lang->about_tag}
</td> </td>
</tr> </tr>

View file

@ -1,7 +1,7 @@
<!--@if($document->comment_list)--> <!--@if($oDocument->getCommentCount())-->
<ul id="reply"> <ul id="reply">
<!--@foreach($document->comment_list as $key => $val)--> <!--@foreach($oDocument->getComments() as $key => $val)-->
<li <!--@if($val->depth)-->class="reply"<!--@end-->> <li <!--@if($val->depth)-->class="reply"<!--@end-->>
<!--@if($val->depth)--> <!--@if($val->depth)-->
@ -51,6 +51,6 @@
<!--@end--> <!--@end-->
<!-- 댓글 입력 폼 --> <!-- 댓글 입력 폼 -->
<!--@if($grant->write_comment && $document->lock_comment == 'N')--> <!--@if($grant->write_comment && !$oDocument->isLocked())-->
<!--#include("./comment_form.html")--> <!--#include("./comment_form.html")-->
<!--@end--> <!--@end-->

View file

@ -12,7 +12,7 @@
</tr> </tr>
<tr> <tr>
<th>{$lang->title}</th> <th>{$lang->title}</th>
<td>{$document->title}</td> <td>{$oDocument->getTitleText()}</td>
</tr> </tr>
<tr> <tr>
<td colspan="2"> <td colspan="2">

View file

@ -5,7 +5,7 @@
<!--#include("header.html")--> <!--#include("header.html")-->
<!-- 선택된 게시물이 있고 권한이 있으면 내용 출력 --> <!-- 선택된 게시물이 있고 권한이 있으면 내용 출력 -->
<!--@if($document && $grant->view)--> <!--@if($oDocument->isExists() && $grant->view)-->
<!--#include("./view_document.html")--> <!--#include("./view_document.html")-->
<!--@end--> <!--@end-->
@ -56,9 +56,9 @@
</tr> </tr>
<!--@end--> <!--@end-->
<!--@foreach($document_list as $no => $val)--> <!--@foreach($document_list as $no => $document)-->
<!--@if($val->is_notice=="Y")--> <!--@if($document->isNotice())-->
<tr class="notice"> <tr class="notice">
<td class="num">{$lang->notice}</td> <td class="num">{$lang->notice}</td>
@ -71,40 +71,36 @@
<!--@end--> <!--@end-->
<!--@if($module_info->use_category == "Y")--> <!--@if($module_info->use_category == "Y")-->
<td class="category">{$category_list[$val->category_srl]->title}</td> <td class="category">{$category_list[$document->get('category_srl')]->title}</td>
<!--@end--> <!--@end-->
<td class="title"> <td class="title">
<!--@if($grant->is_admin)--> <!--@if($grant->is_admin)-->
<input type="checkbox" value="{$val->document_srl}" onclick="doAddCart('{$mid}',this)" <!--@if($check_list[$val->document_srl])-->checked="true"<!--@end--> /> <input type="checkbox" value="{$document->document_srl}" onclick="doAddCart('{$mid}',this)" <!--@if($check_list[$document->document_srl])-->checked="true"<!--@end--> />
<!--@end-->
<!--@if($module_info->subject_cut_size>0)-->
{@ $val->title = cut_str($val->title,$module_info->subject_cut_size)}
<!--@end--> <!--@end-->
<!--@if($grant->view)--> <!--@if($grant->view)-->
<!--@if($search_target && $search_keyword)--> <!--@if($search_target && $search_keyword)-->
<a href="#" onclick="winopen('{getUrl('','document_srl',$val->document_srl)}','viewDocument');return false;">{htmlspecialchars($val->title)}</a> <a href="#" onclick="winopen('{getUrl('','document_srl',$document->document_srl)}','viewDocument');return false;">{$document->getTitleText($module_info->subject_cut_size)}</a>
<!--@else--> <!--@else-->
<a href="{getUrl('','document_srl',$val->document_srl)}">{htmlspecialchars($val->title)}</a> <a href="{getUrl('','document_srl',$document->document_srl)}">{$document->getTitleText($module_info->subject_cut_size)}</a>
<!--@end--> <!--@end-->
<!--@else--> <!--@else-->
{htmlspecialchars($val->title)} {$document->getTitleText($module_info->subject_cut_size)}
<!--@end--> <!--@end-->
<!--@if($val->comment_count>0)--> <!--@if($document->getCommentCount())-->
<span class="replyAndTrackback" title="Replies"><img src="./images/{$module_info->colorset}/iconReply.gif" alt="" width="12" height="12" class="icon" /> <strong>{$val->comment_count}</strong></span> <span class="replyAndTrackback" title="Replies"><img src="./images/{$module_info->colorset}/iconReply.gif" alt="" width="12" height="12" class="icon" /> <strong>{$document->getCommentCount()}</strong></span>
<!--@end--> <!--@end-->
<!--@if($val->trackback_count>0)--> <!--@if($document->getTrackbackCount())-->
<span class="replyAndTrackback" title="Trackbacks"><img src="./images/{$module_info->colorset}/iconTrackback.gif" alt="" width="12" height="13" class="trackback icon" /> <strong>{$val->trackback_count}</strong></span> <span class="replyAndTrackback" title="Trackbacks"><img src="./images/{$module_info->colorset}/iconTrackback.gif" alt="" width="12" height="13" class="trackback icon" /> <strong>{$document->getTrackbackCount()}</strong></span>
<!--@end--> <!--@end-->
</td> </td>
<td class="author"><div class="member_{$val->member_srl}">{$val->nick_name}</div></td> <td class="author"><div class="member_{$document->get('member_srl')}">{$document->getNickName()}</div></td>
<td class="reading">{$val->readed_count}</td> <td class="reading">{$document->get('readed_count')}</td>
<td class="recommend">{$val->voted_count}</td> <td class="recommend">{$document->get('voted_count')}</td>
<td class="date">{zdate($val->regdate,"Y-m-d")}</td> <td class="date">{$document->getRegdate('Y-m-d')}</td>
</tr> </tr>
<!--@end--> <!--@end-->
</tbody> </tbody>

View file

@ -1,9 +1,9 @@
<!-- 엮인글 목록 --> <!-- 엮인글 목록 -->
<!--@if($document->trackback_list)--> <!--@if($oDocument->getTrackbackCount())-->
<ul id="trackbacks"> <ul id="trackbacks">
<!--@foreach($document->trackback_list as $key => $val)--> <!--@foreach($oDocument->getTrackbacks as $key => $val)-->
<li> <li>
<a name="trackback_{$val->trackback_srl}"></a> <a name="trackback_{$val->trackback_srl}"></a>
<address> <address>

View file

@ -3,7 +3,7 @@
<!-- 현 글의 기본 정보를 담고 있는 form. 필수 --> <!-- 현 글의 기본 정보를 담고 있는 form. 필수 -->
<form id="fo_document_info" action="./" method="get"> <form id="fo_document_info" action="./" method="get">
<input type="hidden" name="mid" value="{$mid}" /> <input type="hidden" name="mid" value="{$mid}" />
<input type="hidden" name="document_srl" value="{$document_srl}" /> <input type="hidden" name="document_srl" value="{$oDocument->document_srl}" />
</form> </form>
<!-- 글 내용 보여주기 --> <!-- 글 내용 보여주기 -->
@ -11,40 +11,41 @@
<div class="originalContent"> <div class="originalContent">
<div class="readHeader"> <div class="readHeader">
<div class="titleAndCategory"> <div class="titleAndCategory">
<h4>{htmlspecialchars($document->title)}</h4> <h4>{$oDocument->getTitleText()}</h4>
<!--@if($module_info->use_category == "Y" && $document->category_srl)--> <!--@if($module_info->use_category == "Y" && $oDocument->get('category_srl'))-->
<span class="vr">|</span><span class="category">{$category_list[$document->category_srl]->title}</span> <span class="vr">|</span><span class="category">{$category_list[$oDocument->get('category_srl')]->title}</span>
<!--@end--> <!--@end-->
</div> </div>
<div class="dateAndModify"> <div class="dateAndModify">
<span class="num"> <span class="num">
{$lang->readed_count}: {$lang->readed_count}:
<strong>{$document->readed_count}</strong> <strong>{$oDocument->get('readed_count')}</strong>
, ,
</span> </span>
<!--@if($document->voted_count>0)--> <!--@if($oDocument->get('voted_count')>0)-->
<span class="num"> <span class="num">
{$lang->voted_count}: {$lang->voted_count}:
<strong>{$document->voted_count}</strong> <strong>{$oDocument->get('voted_count')}</strong>
, ,
</span> </span>
<!--@end--> <!--@end-->
<span class="num"> <span class="num">
<strong>{zdate($document->regdate,"Y.m.d")}</strong> {zdate($document->regdate,"H:i:s")} <strong>{$oDocument->getRegdate('Y.m.d')}</strong> {$oDocument->getRegdate('H:i:s')}
</span> </span>
<!--@if($grant->is_admin)--> <!--@if($grant->is_admin)-->
<span class="ipaddress"> <span class="ipaddress">
({$document->ipaddress}) ({$oDocument->get('ipaddress')})
</span> </span>
<!--@end--> <!--@end-->
<!--@if($document->is_granted || !$document->member_srl)--> <!--@if($oDocument->isEditable())-->
<ul> <ul>
<li><a href="{getUrl('act','dispBoardWrite','document_srl',$document->document_srl)}" class="buttonTypeB"><img src="./images/blank.gif" alt="" class="leftCap" />{$lang->cmd_modify}<img src="./images/blank.gif" alt="" class="rightCap" /></a></li> <li><a href="{getUrl('act','dispBoardWrite','document_srl',$oDocument->document_srl)}" class="buttonTypeB"><img src="./images/blank.gif" alt="" class="leftCap" />{$lang->cmd_modify}<img src="./images/blank.gif" alt="" class="rightCap" /></a></li>
<li><a href="{getUrl('act','dispBoardDelete','document_srl',$document->document_srl)}" class="buttonTypeB"><img src="./images/blank.gif" alt="" class="leftCap" />{$lang->cmd_delete}<img src="./images/blank.gif" alt="" class="rightCap" /></a></li> <li><a href="{getUrl('act','dispBoardDelete','document_srl',$oDocument->document_srl)}" class="buttonTypeB"><img src="./images/blank.gif" alt="" class="leftCap" />{$lang->cmd_delete}<img src="./images/blank.gif" alt="" class="rightCap" /></a></li>
</ul> </ul>
<!--@end--> <!--@end-->
</div> </div>
@ -52,40 +53,42 @@
<dl class="uri"> <dl class="uri">
<dt>{$lang->document_url} :</dt> <dt>{$lang->document_url} :</dt>
<dd>{getUrl('','document_srl',$document->document_srl)}</dd> <dd>{$oDocument->getPermanentUrl()}</dd>
<!--@if($document->allow_trackback=='Y')--> <!--@if($oDocument->allowTrackback())-->
<dt>{$lang->trackback_url} :</dt> <dt>{$lang->trackback_url} :</dt>
<dd>{getUrl('','document_srl',$document->document_srl,'act','trackback')}</dd> <dd>{$oDocument->getTrackbackUrl()}</dd>
<!--@end--> <!--@end-->
</dl> </dl>
<div class="userInfo"> <div class="userInfo">
<div class="author member_{$document->member_srl}">{htmlspecialchars($document->nick_name)}</div> <div class="author member_{$oDocument->get('member_srl')}">{$oDocument->getNickName()}</div>
</div> </div>
<div class="readBody">{$document->content}</div> <div class="readBody">{$oDocument->getContent()}</div>
<div class="readFooter"> <div class="readFooter">
<!--@if($document->tag_list)--> {@ $tag_list = $oDocument->get('tag_list') }
<!--@if(count($tag_list))-->
<div class="tag"> <div class="tag">
<h5><img src="./images/{$module_info->colorset}/iconTag.gif" alt="{$lang->tag}" width="17" height="10" class="tagIcon" /></h5> <h5><img src="./images/{$module_info->colorset}/iconTag.gif" alt="{$lang->tag}" width="17" height="10" class="tagIcon" /></h5>
<ul> <ul>
<!--@for($i=0;$i<count($document->tag_list);$i++)--> <!--@for($i=0;$i<count($tag_list);$i++)-->
{@ $tag = $document->tag_list[$i]; } {@ $tag = $tag_list[$i]; }
<li> <li>
<a href="{getUrl('search_target','tag','search_keyword',urlencode($tag),'document_srl','')}">{htmlspecialchars($tag)}</a><!--@if($i<count($document->tag_list)-1)-->,<!--@end--> <a href="{getUrl('search_target','tag','search_keyword',urlencode($tag),'document_srl','')}">{htmlspecialchars($tag)}</a><!--@if($i<count($tag_list)-1)-->,<!--@end-->
</li> </li>
<!--@end--> <!--@end-->
</ul> </ul>
</div> </div>
<!--@end--> <!--@end-->
<!--@if($document->uploaded_count && $document->uploaded_list)--> <!--@if($oDocument->hasUploadedFiles())-->
<div class="fileAttached"> <div class="fileAttached">
<h5>{$lang->uploaded_file} : </h5> <h5>{$lang->uploaded_file} : </h5>
<ul> <ul>
<!--@foreach($document->uploaded_list as $key => $file)--> {@ $uploaded_list = $oDocument->getUploadedFiles() }
<!--@foreach($uploaded_list as $key => $file)-->
<li><a href="{getUrl('')}{$file->download_url}">{$file->source_filename} ({FileHandler::filesize($file->file_size)})({number_format($file->download_count)})</a></li> <li><a href="{getUrl('')}{$file->download_url}">{$file->source_filename} ({FileHandler::filesize($file->file_size)})({number_format($file->download_count)})</a></li>
<!--@end--> <!--@end-->
</ul> </ul>
@ -95,12 +98,12 @@
</div> </div>
<ul class="replyAndTrackback"> <ul class="replyAndTrackback">
<!--@if($grant->write_comment&&$document->allow_comment=='Y')--> <!--@if($grant->write_comment && $oDocument->allowComment()) -->
<li class="reply"><a href="#comment">{$lang->comment} <strong>{count($document->comment_list)}</strong></a></li> <li class="reply"><a href="#comment">{$lang->comment} <strong>{$oDocument->getCommentcount()}</strong></a></li>
<!--@end--> <!--@end-->
<!--@if($document->allow_trackback=='Y')--> <!--@if($oDocument->allowTrackback())-->
<li class="trackback"><a href="#trackback">{$lang->trackback} <strong>{count($document->trackback_list)}</strong></a></li> <li class="trackback"><a href="#trackback">{$lang->trackback} <strong>{$oDocument->getTrackbackCount()}</strong></a></li>
<!--@end--> <!--@end-->
<li class="button"> <li class="button">
@ -111,13 +114,13 @@
</div> </div>
<!-- 엮인글 파일 include --> <!-- 엮인글 파일 include -->
<!--@if($document->allow_trackback=='Y')--> <!--@if($oDocument->allowTrackback())-->
<a name="trackback"></a> <a name="trackback"></a>
<!--#include("./trackback.html")--> <!--#include("./trackback.html")-->
<!--@end--> <!--@end-->
<!-- 댓글 파일 include --> <!-- 댓글 파일 include -->
<!--@if($grant->write_comment&&$document->allow_comment=='Y')--> <!--@if($grant->write_comment && $oDocument->allowComment())-->
<a name="comment"></a> <a name="comment"></a>
<!--#include("./comment.html")--> <!--#include("./comment.html")-->
<!--@end--> <!--@end-->

View file

@ -5,22 +5,22 @@
<form action="./" method="post" onsubmit="return procFilter(this, insert)" <!--@if($grant->fileupload)-->enctype="multipart/form-data"<!--@end--> class="boardEditor" id="fo_write"> <form action="./" method="post" onsubmit="return procFilter(this, insert)" <!--@if($grant->fileupload)-->enctype="multipart/form-data"<!--@end--> class="boardEditor" id="fo_write">
<fieldset> <fieldset>
<input type="hidden" name="mid" value="{$mid}" /> <input type="hidden" name="mid" value="{$mid}" />
<input type="hidden" name="content" value="{htmlspecialchars($document->content)}" /> <input type="hidden" name="content" value="{$oDocument->getContentText()}" />
<input type="hidden" name="document_srl" value="{$document_srl}" /> <input type="hidden" name="document_srl" value="{$document_srl}" />
<!--@if(!$is_logged)--> <!--@if(!$is_logged)-->
<div class="userNameAndPw"> <div class="userNameAndPw">
<label for="userName">{$lang->writer}</label> <label for="userName">{$lang->writer}</label>
<input type="text" name="nick_name" value="{$document->nick_name}" class="userName inputTypeText" id="userName"/> <input type="text" name="nick_name" value="{$oDocument->getNickName()}" class="userName inputTypeText" id="userName"/>
<label for="userPw">{$lang->password}</label> <label for="userPw">{$lang->password}</label>
<input type="password" name="password" value="" id="userPw" class="userPw inputTypeText" /> <input type="password" name="password" value="" id="userPw" class="userPw inputTypeText" />
<label for="emailAddress">{$lang->email_address}</label> <label for="emailAddress">{$lang->email_address}</label>
<input type="text" name="email_address" value="{htmlspecialchars($document->email_address)}" id="emailAddress" class="emailAddress inputTypeText"/> <input type="text" name="email_address" value="{htmlspecialchars($oDocument->get('email_address'))}" id="emailAddress" class="emailAddress inputTypeText"/>
<label for="homePage">{$lang->homepage}</label> <label for="homePage">{$lang->homepage}</label>
<input type="text" name="homepage" value="{htmlspecialchars($document->homepage)}" id="homePage" class="homePage inputTypeText"/> <input type="text" name="homepage" value="{htmlspecialchars($oDocument->get('homepage'))}" id="homePage" class="homePage inputTypeText"/>
</div> </div>
<!--@end--> <!--@end-->
@ -31,36 +31,36 @@
<select name="category_srl" > <select name="category_srl" >
<option value="">{$lang->category}</option> <option value="">{$lang->category}</option>
<!--@foreach($category_list as $val)--> <!--@foreach($category_list as $val)-->
<option value="{$val->category_srl}" <!--@if($category==$val->category_srl||$val->category_srl==$document->category_srl)-->selected="true"<!--@end-->>{$val->title} <!--@if($val->document_count)-->({$val->document_count})<!--@end--></option> <option value="{$val->category_srl}" <!--@if($category==$val->category_srl||$val->category_srl==$oDocument->get('category_srl'))-->selected="true"<!--@end-->>{$val->title} <!--@if($val->document_count)-->({$val->document_count})<!--@end--></option>
<!--@end--> <!--@end-->
</select> </select>
<!--@end--> <!--@end-->
<input type="text" name="title" id="title" class="inputTypeText" value="{htmlspecialchars($document->title)}" /> <input type="text" name="title" id="title" class="inputTypeText" value="{$oDocument->getTitleText()}" />
</div> </div>
<dl class="option"> <dl class="option">
<dt>설정옵션</dt> <dt>설정옵션</dt>
<!--@if($grant->manager)--> <!--@if($grant->manager)-->
<dd> <dd>
<input type="checkbox" name="is_notice" value="Y" <!--@if($document->is_notice== "Y")-->checked="true"<!--@end--> id="is_notice" /> <input type="checkbox" name="is_notice" value="Y" <!--@if($oDocument->isNotice())-->checked="true"<!--@end--> id="is_notice" />
<label for="is_notice">{$lang->notice}</label> <label for="is_notice">{$lang->notice}</label>
</dd> </dd>
<dd> <dd>
<input type="checkbox" name="lock_comment" value="Y" <!--@if($document->lock_comment == "Y")-->checked="true"<!--@end--> id="lock_comment" /> <input type="checkbox" name="lock_comment" value="Y" <!--@if($oDocument->isLocked())-->checked="true"<!--@end--> id="lock_comment" />
<label for="lock_comment">{$lang->lock_comment}</label> <label for="lock_comment">{$lang->lock_comment}</label>
</dd> </dd>
<!--@end--> <!--@end-->
<dd> <dd>
<input type="checkbox" name="is_secret" value="Y" <!--@if($document->is_secret== "Y")-->checked="true"<!--@end--> id="is_secret" /> <input type="checkbox" name="is_secret" value="Y" <!--@if($oDocument->isSecret())-->checked="true"<!--@end--> id="is_secret" />
<label for="is_secret">{$lang->secret}</label> <label for="is_secret">{$lang->secret}</label>
</dd> </dd>
<dd> <dd>
<input type="checkbox" name="allow_comment" value="Y" <!--@if($document->allow_comment != "N")-->checked="true"<!--@end--> id="allow_comment" /> <input type="checkbox" name="allow_comment" value="Y" <!--@if($oDocument->allowComment())-->checked="true"<!--@end--> id="allow_comment" />
<label for="allow_comment">{$lang->allow_comment}</label> <label for="allow_comment">{$lang->allow_comment}</label>
</dd> </dd>
<dd> <dd>
<input type="checkbox" name="allow_trackback" value="Y" <!--@if($document->allow_trackback != "N")-->checked="true"<!--@end--> id="allow_trackback" /> <input type="checkbox" name="allow_trackback" value="Y" <!--@if($oDocument->allowTrackback())-->checked="true"<!--@end--> id="allow_trackback" />
<label for="allow_trackback">{$lang->allow_trackback}</label> <label for="allow_trackback">{$lang->allow_trackback}</label>
</dd> </dd>
</dl> </dl>
@ -83,7 +83,7 @@
<div class="tag"> <div class="tag">
<label for="tag">{$lang->tag}</label> <label for="tag">{$lang->tag}</label>
<input type="text" name="tags" id="tag" value="{htmlspecialchars($document->tags)}" class="inputTypeText" /> <input type="text" name="tags" id="tag" value="{htmlspecialchars($oDocument->get('tags'))}" class="inputTypeText" />
<p class="info">{$lang->about_tag}</p> <p class="info">{$lang->about_tag}</p>
</div> </div>

View file

@ -5,6 +5,8 @@
* @brief document 모듈의 high 클래스 * @brief document 모듈의 high 클래스
**/ **/
require_once('./modules/document/document.item.php');
class document extends ModuleObject { class document extends ModuleObject {
// 공지사항용 값 // 공지사항용 값

View file

@ -227,11 +227,11 @@
$oDocumentModel = &getModel('document'); $oDocumentModel = &getModel('document');
// 기존 문서가 있는지 확인 // 기존 문서가 있는지 확인
$document = $oDocumentModel->getDocument($document_srl, $is_admin); $oDocument = $oDocumentModel->getDocument($document_srl, $is_admin);
if($document->document_srl != $document_srl) return new Object(-1, 'msg_invalid_document'); if(!$oDocument->isExists() || $oDocument->document_srl != $document_srl) return new Object(-1, 'msg_invalid_document');
// 권한이 있는지 확인 // 권한이 있는지 확인
if(!$document->is_granted&&!$is_admin) return new Object(-1, 'msg_not_permitted'); if(!$oDocument->isGranted()) return new Object(-1, 'msg_not_permitted');
// 글 삭제 // 글 삭제
$args->document_srl = $document_srl; $args->document_srl = $document_srl;
@ -260,7 +260,7 @@
} }
// 카테고리가 있으면 카테고리 정보 변경 // 카테고리가 있으면 카테고리 정보 변경
if($document->category_srl) $this->updateCategoryCount($document->category_srl); if($document->category_srl) $this->updateCategoryCount($oDocument->get('category_srl'));
// commit // commit
$oDB->commit(); $oDB->commit();
@ -271,8 +271,10 @@
/** /**
* @brief 해당 document의 조회수 증가 * @brief 해당 document의 조회수 증가
**/ **/
function updateReadedCount($document) { function updateReadedCount($oDocument) {
$document_srl = $document->document_srl; $document_srl = $oDocument->document_srl;
$member_srl = $oDocument->get('member_srl');
$logged_info = Context::get('logged_info');
// session에 정보로 조회수를 증가하였다고 생각하면 패스 // session에 정보로 조회수를 증가하였다고 생각하면 패스
if($_SESSION['readed_document'][$document_srl]) return false; if($_SESSION['readed_document'][$document_srl]) return false;
@ -284,21 +286,18 @@
} }
// document의 작성자가 회원일때 조사 // document의 작성자가 회원일때 조사
if($document->member_srl) { if($member_srl) {
// member model 객체 생성
$oMemberModel = &getModel('member');
$member_srl = $oMemberModel->getLoggedMemberSrl();
// 글쓴이와 현재 로그인 사용자의 정보가 일치하면 읽었다고 생각하고 세션 등록후 패스 // 글쓴이와 현재 로그인 사용자의 정보가 일치하면 읽었다고 생각하고 세션 등록후 패스
if($member_srl && $member_srl == $document->member_srl) { if($member_srl && $logged_info->member_srl == $member_srl) {
$_SESSION['readed_document'][$document_srl] = true; $_SESSION['readed_document'][$document_srl] = true;
return false; return false;
} }
} }
// 로그인 사용자이면 member_srl, 비회원이면 ipaddress로 판단 // 로그인 사용자이면 member_srl, 비회원이면 ipaddress로 판단
if($member_srl) { if($logged_info->member_srl) {
$args->member_srl = $member_srl; $args->member_srl = $logged_info->member_srl;
} else { } else {
$args->ipaddress = $_SERVER['REMOTE_ADDR']; $args->ipaddress = $_SERVER['REMOTE_ADDR'];
} }

View file

@ -0,0 +1,183 @@
<?php
/**
* @class documentItem
* @author zero (zero@nzeo.com)
* @brief document 객체
**/
class documentItem extends Object {
var $document_srl = 0;
function documentItem($document_srl = 0) {
$this->document_srl = $document_srl;
$this->_loadFromDB();
}
function setDocument($document_srl) {
$this->document_srl = $document_srl;
$this->_loadFromDB();
}
function _loadFromDB() {
if(!$this->document_srl) return;
$args->document_srl = $this->document_srl;
$output = executeQuery('document.getDocument', $args);
$this->setAttribute($output->data);
}
function setAttribute($attribute) {
if(!$attribute->document_srl) return;
$this->document_srl = $attribute->document_srl;
$this->adds($attribute);
// 태그 정리
if($this->get('tags')) {
$tags = explode(',',$this->get('tags'));
$tag_count = count($tags);
for($i=0;$i<$tag_count;$i++) if(trim($tags[$i])) $tag_list[] = trim($tags[$i]);
$this->add('tag_list', $tag_list);
}
}
function isExists() {
return $this->document_srl ? true : false;
}
function isGranted() {
if($_SESSION['own_attribute'][$this->document_srl]) return true;
if(!Context::get('is_logged')) return false;
$logged_info = Context::get('logged_info');
if($logged_info->is_admin == 'Y') return true;
if($this->get('member_srl') && $this->get('member_srl') == $logged_info->member_srl) return true;
return false;
}
function setGrant() {
$_SESSION['own_attribute'][$this->document_srl] = true;
}
function allowComment() {
return $this->get('allow_comment') == 'Y' ? true : false;
}
function allowTrackback() {
return $this->get('allow_trackback') == 'Y' ? true : false;
}
function isLocked() {
return $this->get('lock_comment') == 'Y' ? true : false;
}
function isEditable() {
if($this->isGranted() || !$this->get('member_srl')) return true;
return false;
}
function isSecret() {
return $this->get('is_secret') == 'Y' ? true : false;
}
function isNotice() {
return $this->get('is_notice') == 'Y' ? true : false;
}
function getUserID() {
return htmlspecialchars($this->get('user_id'));
}
function getUserName() {
return htmlspecialchars($this->get('user_name'));
}
function getNickName() {
return htmlspecialchars($this->get('nick_name'));
}
function getTitleText($cut_size = 0) {
return htmlspecialchars($this->getTitle());
}
function getTitle($cut_size = 0) {
if($this->isSecret() && !$this->isGranted()) return Context::getLang('msg_is_secret');
if($cut_size) return cut_str($this->get('title'), $cut_size);
return $this->get('title');
}
function getContentText() {
if($this->isSecret() && !$this->isGranted()) return Context::getLang('msg_is_secret');
return htmlspecialchars($this->get('content'));
}
function getContent() {
if($this->isSecret() && !$this->isGranted()) return Context::getLang('msg_is_secret');
return sprintf('<!--BeforeDocument(%d,%d)-->%s<!--AfterDocument(%d,%d)-->', $this->document_srl, $this->get('member_srl'), $this->get('content'), $this->document_srl, $this->get('member_srl'));
}
function getRegdate($format = 'Y.m.d H:i:s') {
return zdate($this->get('regdate'), $format);
}
function getPermanentUrl() {
return getUrl('','document_srl',$this->document_srl);
}
function getTrackbackUrl() {
return getUrl('','document_srl',$this->document_srl,'act','trackback');
}
function updateReadedCount() {
$oDocumentController = &getController('document');
if($oDocumentController->updateReadedCount($this)) {
$readed_count = $this->get('readed_count');
$readed_count++;
$this->add('readed_count', $readed_count);
}
}
function getCommentCount() {
return $this->get('comment_count');
}
function getComments() {
if(!$this->allowComment() || !$this->get('comment_count')) return;
$oCommentModel = &getModel('comment');
return $oCommentModel->getCommentList($this->document_srl, $is_admin);
}
function getTrackbackCount() {
return $this->get('trackback_count');
}
function getTrackbacks() {
if(!$this->allowTrackback() || !$this->get('trackback_count')) return;
$oTrackbackModel = &getModel('trackback');
return $oTrackbackModel->getTrackbackList($this->document_srl, $is_admin);
}
function hasUploadedFiles() {
return $this->get('uploaded_count')? true : false;
}
function getUploadedFiles() {
if(!$this->get('uploaded_count')) return;
$oFileModel = &getModel('file');
$file_list = $oFileModel->getFiles($this->document_srl, $is_admin);
return $file_list;
}
}
?>

View file

@ -23,71 +23,17 @@
/** /**
* @brief 문서 가져오기 * @brief 문서 가져오기
**/ **/
function getDocument($document_srl, $is_admin=false, $get_extra_info=false) { function getDocument($document_srl, $is_admin = false) {
// DB에서 가져옴 $oDocument = new documentItem($document_srl);
$args->document_srl = $document_srl; if($is_admin) $oDocument->setGrant();
$output = executeQuery('document.getDocument', $args);
$document = $output->data;
if(!$document) return;
// 이 문서에 대한 권한이 있는지 확인 return $oDocument;
if($this->isGranted($document->document_srl) || $is_admin) { }
$document->is_granted = true;
} elseif($document->member_srl) {
$oMemberModel = &getModel('member');
$member_srl = $oMemberModel->getLoggedMemberSrl();
if($member_srl && $member_srl ==$document->member_srl) $document->is_granted = true;
}
// 비밀글이고 권한이 없을 경우 제목과 내용을 숨김
if($document->is_secret=='Y' && !$document->is_granted) {
$document->title = $document->content = Context::getLang('msg_is_secret');
}
// 확장 정보(코멘트나 기타 등등) 플래그가 false이면 기본 문서 정보만 return
if(!$get_extra_info) return $document;
// document controller 객체 생성
$oDocumentController = &getController('document');
// 조회수 업데이트
if($buff = $oDocumentController->updateReadedCount($document)) $document->readed_count++;
// 댓글 가져오기
if($document->comment_count && $document->allow_comment == 'Y') {
$oCommentModel = &getModel('comment');
$document->comment_list = $oCommentModel->getCommentList($document_srl, $is_admin);
}
// 트랙백 가져오기
if($document->trackback_count && $document->allow_trackback == 'Y') {
$oTrackbackModel = &getModel('trackback');
$document->trackback_list = $oTrackbackModel->getTrackbackList($document_srl, $is_admin);
}
// 첨부파일 가져오기
if($document->uploaded_count) {
$oFileModel = &getModel('file');
$file_list = $oFileModel->getFiles($document_srl, $is_admin);
$document->uploaded_list = $file_list;
}
// 태그 정리
if($document->tags) {
$tag_list = explode(',',$document->tags);
$tag_count = count($tag_list);
for($i=0;$i<$tag_count;$i++) if(trim($tag_list[$i])) $document->tag_list[] = trim($tag_list[$i]);
}
$document->content = sprintf('<!--BeforeDocument(%d,%d)-->%s<!--AfterDocument(%d,%d)-->', $document_srl, $document->member_srl, $document->content, $document_srl, $document->member_srl);
return $document;
}
/** /**
* @brief 여러개의 문서들을 가져옴 (페이징 아님) * @brief 여러개의 문서들을 가져옴 (페이징 아님)
**/ **/
function getDocuments($document_srl_list, $is_admin=false) { function getDocuments($document_srl_list, $is_admin = false) {
if(is_array($document_srl_list)) $document_srls = implode(',',$document_srl_list); if(is_array($document_srl_list)) $document_srls = implode(',',$document_srl_list);
// DB에서 가져옴 // DB에서 가져옴
@ -97,21 +43,17 @@
if(!$document_list) return; if(!$document_list) return;
if(!is_array($document_list)) $document_list = array($document_list); if(!is_array($document_list)) $document_list = array($document_list);
// 권한 체크
$oMemberModel = &getModel('member');
$member_srl = $oMemberModel->getLoggedMemberSrl();
$document_count = count($document_list); $document_count = count($document_list);
for($i=0;$i<$document_count;$i++) { for($i=0;$i<$document_count;$i++) {
$document = $document_list[$i]; $document_srl = $attribute->document_srl;
$is_granted = false; $attribute = $document_list[$i];
if($this->isGranted($document->document_srl) || $is_admin) { $oDocument = null;
$is_granted = true; $oDocument = new documentItem();
} elseif($member_srl && $member_srl == $document->member_srl) { $oDocument->setAttribute($attribute);
$is_granted = true; if($is_admin) $oDocument->setGrant();
}
$document_list[$i]->is_granted = $is_granted; $document_list[$document_srl] = $oDocument;
} }
return $document_list; return $document_list;
} }
@ -119,9 +61,9 @@
/** /**
* @brief module_srl값을 가지는 문서의 목록을 가져옴 * @brief module_srl값을 가지는 문서의 목록을 가져옴
**/ **/
function getDocumentList($obj, $get_extra_info = false) { function getDocumentList($obj) {
// 정렬 대상과 순서 체크
if(!in_array($obj->sort_index, array('list_order','regdate','update_order','readed_count','voted_count'))) $obj->sort_index = 'list_order'; ///< 소팅 값 if(!in_array($obj->sort_index, array('list_order','regdate','update_order','readed_count','voted_count'))) $obj->sort_index = 'list_order';
if(!in_array($obj->order_type, array('desc','asc'))) $obj->order_type = 'asc'; if(!in_array($obj->order_type, array('desc','asc'))) $obj->order_type = 'asc';
// module_srl 대신 mid가 넘어왔을 경우는 직접 module_srl을 구해줌 // module_srl 대신 mid가 넘어왔을 경우는 직접 module_srl을 구해줌
@ -135,8 +77,8 @@
if(is_array($obj->module_srl)) $args->module_srl = implode(',', $obj->module_srl); if(is_array($obj->module_srl)) $args->module_srl = implode(',', $obj->module_srl);
else $args->module_srl = $obj->module_srl; else $args->module_srl = $obj->module_srl;
// 변수 체크
$args->category_srl = $obj->category_srl?$obj->category_srl:''; $args->category_srl = $obj->category_srl?$obj->category_srl:'';
$args->sort_index = $obj->sort_index; $args->sort_index = $obj->sort_index;
$args->order_type = $obj->order_type; $args->order_type = $obj->order_type;
$args->page = $obj->page?$obj->page:1; $args->page = $obj->page?$obj->page:1;
@ -232,55 +174,15 @@
// 결과가 없거나 오류 발생시 그냥 return // 결과가 없거나 오류 발생시 그냥 return
if(!$output->toBool()||!count($output->data)) return $output; if(!$output->toBool()||!count($output->data)) return $output;
// 권한 체크 foreach($output->data as $key => $attribute) {
$oMemberModel = &getModel('member'); $document_srl = $attribute->document_srl;
$member_srl = $oMemberModel->getLoggedMemberSrl();
// document controller 객체 생성 $oDocument = null;
$oDocumentController = &getController('document'); $oDocument = new documentItem();
$oDocument->setAttribute($attribute);
if($is_admin) $oDocument->setGrant();
foreach($output->data as $key => $document) { $output->data[$key] = $oDocument;
// 권한 부여
$is_granted = false;
if($this->isGranted($document->document_srl)) $is_granted = true;
elseif($member_srl && $member_srl == $document->member_srl) $is_granted = true;
$document->is_granted = $is_granted;
$document_srl = $document->document_srl;
if($get_extra_info) {
// 댓글 가져오기
if($document->comment_count && $document->allow_comment == 'Y') {
$oCommentModel = &getModel('comment');
$document->comment_list = $oCommentModel->getCommentList($document_srl, $is_admin);
}
// 트랙백 가져오기
if($document->trackback_count && $document->allow_trackback == 'Y') {
$oTrackbackModel = &getModel('trackback');
$document->trackback_list = $oTrackbackModel->getTrackbackList($document_srl, $is_admin);
}
// 첨부파일 가져오기
if($document->uploaded_count) {
$oFileModel = &getModel('file');
$file_list = $oFileModel->getFiles($document_srl, $is_admin);
$document->uploaded_list = $file_list;
}
// 태그 정리
if($document->tags) {
$tag_list = explode(',',$document->tags);
$tag_count = count($tag_list);
for($i=0;$i<$tag_count;$i++) if(trim($tag_list[$i])) $document->tag_list[] = trim($tag_list[$i]);
}
}
$document->content = sprintf('<!--BeforeDocument(%d,%d)-->%s<!--AfterDocument(%d,%d)-->', $document_srl, $document->member_srl, $document->content, $document_srl, $document->member_srl);
$output->data[$key] = $document;
} }
return $output; return $output;

View file

@ -24,26 +24,26 @@
<th>{$lang->date}</th> <th>{$lang->date}</th>
</tr> </tr>
<!--@foreach($document_list as $no => $val)--> <!--@foreach($document_list as $no => $oDocument)-->
<tr> <tr>
<td>{$no}</td> <td>{$no}</td>
<td><input type="checkbox" name="cart" value="{$val->document_srl}" /></td> <td><input type="checkbox" name="cart" value="{$oDocument->document_srl}" /></td>
<td><a href="#" onclick="window.open('./?mid={$module_list[$val->module_srl]->mid}');return false">{htmlspecialchars($module_list[$val->module_srl]->browser_title)}</a></td> <td><a href="#" onclick="window.open('./?mid={$module_list[$oDocument->get('module_srl')]->mid}');return false">{htmlspecialchars($module_list[$oDocument->get('module_srl')]->browser_title)}</a></td>
<td> <td>
<a href="#" onclick="window.open('./?document_srl={$val->document_srl}');return false">{htmlspecialchars($val->title)}</a> <a href="#" onclick="window.open('./?document_srl={$oDocument->document_srl}');return false">{$oDocument->getTitleText()}</a>
<!--@if($val->comment_count>0)--> <!--@if($oDocument->getCommentCount())-->
[{$val->comment_count}] [{$oDocument->getCommentCount()}]
<!--@end--> <!--@end-->
<!--@if($val->trackback_count>0)--> <!--@if($oDocument->getTrackbackCount())-->
[{$val->trackback_count}] [{$oDocument->getTrackbackCount()}]
<!--@end--> <!--@end-->
</td> </td>
<td><div class="member_{$val->member_srl}">{htmlspecialchars($val->user_name)}</div></td> <td><div class="member_{$oDocument->get('member_srl')}">{$oDocument->getUserName()}</div></td>
<td>{$val->readed_count}</td> <td>{$oDocument->get('readed_count')}</td>
<td>{$val->voted_count}</td> <td>{$oDocument->get('voted_count')}</td>
<td>{zdate($val->regdate,"Y-m-d")}</td> <td>{$oDocument->getRegdate("Y-m-d")}</td>
</tr> </tr>
<!--@end--> <!--@end-->

View file

@ -14,11 +14,11 @@
<!--@end--> <!--@end-->
<div class="document_box"> <div class="document_box">
<!--@foreach($plugin_info->document_list as $val)--> <!--@foreach($plugin_info->document_list as $oDocument)-->
<div class="document"> <div class="document">
<a href="{getUrl('','document_srl',$val->document_srl)}#{$val->comment_count}">{htmlspecialchars(cut_str($val->title,20))}</a> <a href="{$oDocument->getPermanentUrl()}#{$oDocument->getCommentCount()}">{$oDocument->getTitleText(20)}</a>
<!--@if($val->comment_count)--> <!--@if($oDocument->getCommentCount())-->
&nbsp;<span class="comment"><a href="{getUrl('','document_srl',$val->document_srl)}#comment_top_{$val->document_srl}">*{$val->comment_count}</a></span> &nbsp;<span class="comment"><a href="{$oDocument->getPermanentUrl()}#comment_top_{$oDocument->document_srl}">*{$oDocument->getCommentCount()}</a></span>
<!--@end--> <!--@end-->
</div> </div>
<!--@end--> <!--@end-->

View file

@ -17,18 +17,18 @@
<!--@end--> <!--@end-->
</div> </div>
<!--@foreach($plugin_info->document_list as $val)--> <!--@foreach($plugin_info->document_list as $oDocument)-->
<div class="document_box"> <div class="document_box">
<div class="document"> <div class="document">
<a href="{getUrl('','document_srl',$val->document_srl)}#{$val->comment_count}">{htmlspecialchars(cut_str($val->title,20))}</a> <a href="{$oDocument->getPermanentUrl()}#{$oDocument->getCommentCount()}">{$oDocument->getTitleText(20)}</a>
<!--@if($val->comment_count)--> <!--@if($oDocument->getCommentCount())-->
<span class="comment"><a href="{getUrl('','document_srl',$val->document_srl)}#comment_top_{$val->document_srl}">( {$val->comment_count} )</a></span> &nbsp;<span class="comment"><a href="{$oDocument->getPermanentUrl()}#comment_top_{$oDocument->document_srl}">*{$oDocument->getCommentCount()}</a></span>
<!--@end--> <!--@end-->
<span class="writer"> <span class="writer">
- {$val->nick_name} - {$oDocument->getNickName()}
</span> </span>
</div> </div>
<div class="regdate">{zdate($val->regdate, "Y-m-d")}</div> <div class="regdate">{$oDocument->getRegdate("Y-m-d")}</div>
</div> </div>
<!--@end--> <!--@end-->
</div> </div>