mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-23 05:09:56 +09:00
글작성시에 알림 기능 추가. 알림 체크시 댓글/엮인글이 첨부되면 쪽지로 발송함
git-svn-id: http://xe-core.googlecode.com/svn/trunk@2015 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
812283e33a
commit
94227a556d
22 changed files with 134 additions and 24 deletions
|
|
@ -38,6 +38,11 @@
|
|||
**/
|
||||
if(!$oDB->isColumnExists("documents","extra_vars20")) return true;
|
||||
|
||||
/**
|
||||
* 2007. 7. 25 : 알림 필드(notify_message) 추가
|
||||
**/
|
||||
if(!$oDB->isColumnExists("documents","notify_message")) return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
@ -45,10 +50,11 @@
|
|||
* @brief 업데이트 실행
|
||||
**/
|
||||
function moduleUpdate() {
|
||||
$oDB = &DB::getInstance();
|
||||
|
||||
/**
|
||||
* 2007. 7. 23 : 확장변수(extra_vars1~20까지 추가)
|
||||
**/
|
||||
$oDB = &DB::getInstance();
|
||||
if(!$oDB->isColumnExists("documents","extra_vars20")) {
|
||||
for($i=1;$i<=20;$i++) {
|
||||
$column_name = "extra_vars".$i;
|
||||
|
|
@ -56,6 +62,13 @@
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 2007. 7. 25 : 알림 필드(notify_message) 추가
|
||||
**/
|
||||
if(!$oDB->isColumnExists("documents","notify_message")) {
|
||||
$oDB->addColumn('documents',"notify_message","char",1);
|
||||
}
|
||||
|
||||
return new Object(0,'success_updated');
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -36,6 +36,7 @@
|
|||
if($obj->lock_comment!='Y') $obj->lock_comment = 'N';
|
||||
if($obj->allow_trackback!='Y') $obj->allow_trackback = 'N';
|
||||
if($obj->homepage && !eregi('^http:\/\/',$obj->homepage)) $obj->homepage = 'http://'.$obj->homepage;
|
||||
if($obj->notify_message != "Y") $obj->notify_message = "N";
|
||||
|
||||
// 자동저장용 필드 제거
|
||||
unset($obj->_saved_doc_srl);
|
||||
|
|
@ -127,6 +128,7 @@
|
|||
if($obj->lock_comment!='Y') $obj->lock_comment = 'N';
|
||||
if($obj->allow_trackback!='Y') $obj->allow_trackback = 'N';
|
||||
if($obj->homepage && !eregi('^http:\/\/',$obj->homepage)) $obj->homepage = 'http://'.$obj->homepage;
|
||||
if($obj->notify_message != "Y") $obj->notify_message = "N";
|
||||
|
||||
// 자동저장용 필드 제거
|
||||
unset($obj->_saved_doc_srl);
|
||||
|
|
|
|||
|
|
@ -95,6 +95,32 @@
|
|||
function isNotice() {
|
||||
return $this->get('is_notice') == 'Y' ? true : false;
|
||||
}
|
||||
|
||||
function useNotify() {
|
||||
return $this->get('notify_message')=='Y' ? true : false;
|
||||
}
|
||||
|
||||
function notify($type, $content) {
|
||||
// useNotify가 아니면 return
|
||||
if(!$this->useNotify()) return;
|
||||
|
||||
// 글쓴이가 로그인 유저가 아니면 패스~
|
||||
if(!$this->get('member_srl')) return;
|
||||
|
||||
// 현재 로그인한 사용자와 글을 쓴 사용자를 비교하여 동일하면 return
|
||||
$logged_info = Context::get('logged_info');
|
||||
if($logged_info->member_srl == $this->get('member_srl')) return;
|
||||
|
||||
// 변수 정리
|
||||
$title = sprintf("[%s] %s", $type, cut_str(strip_tags($content), 10, '...') );
|
||||
$content = sprintf('%s<br /><br />from : <a href="%s" onclick="window.open(this.href);return false;">%s</a>',$content, $this->getPermanentUrl(), $this->getPermanentUrl());
|
||||
$receiver_srl = $this->get('member_srl');
|
||||
$sender_member_srl = $logged_info->member_srl;
|
||||
|
||||
// 쪽지 발송
|
||||
$oMemberController = &getController('member');
|
||||
$oMemberController->sendMessage($sender_member_srl, $receiver_srl, $title, $content, false);
|
||||
}
|
||||
|
||||
function getUserID() {
|
||||
return htmlspecialchars($this->get('user_id'));
|
||||
|
|
|
|||
|
|
@ -31,6 +31,7 @@
|
|||
<column name="allow_comment" var="allow_comment" default="Y" />
|
||||
<column name="lock_comment" var="lock_comment" default="N" />
|
||||
<column name="allow_trackback" var="allow_trackback" default="Y" />
|
||||
<column name="notify_message" var="notify_message" default="N" />
|
||||
<column name="extra_vars1" var="extra_vars1" />
|
||||
<column name="extra_vars2" var="extra_vars2" />
|
||||
<column name="extra_vars3" var="extra_vars3" />
|
||||
|
|
|
|||
|
|
@ -24,6 +24,7 @@
|
|||
<column name="allow_comment" var="allow_comment" default="Y" />
|
||||
<column name="lock_comment" var="lock_comment" default="N" />
|
||||
<column name="allow_trackback" var="allow_trackback" default="Y" />
|
||||
<column name="notify_message" var="notify_message" default="N" />
|
||||
<column name="extra_vars1" var="extra_vars1" />
|
||||
<column name="extra_vars2" var="extra_vars2" />
|
||||
<column name="extra_vars3" var="extra_vars3" />
|
||||
|
|
|
|||
|
|
@ -31,6 +31,7 @@
|
|||
<column name="allow_comment" type="char" size="1" default="Y" notnull="notnull" />
|
||||
<column name="lock_comment" type="char" size="1" default="N" notnull="notnull" />
|
||||
<column name="allow_trackback" type="char" size="1" default="Y" notnull="notnull" />
|
||||
<column name="notify_message" type="char" size="1" default="N" notnull="notnull" />
|
||||
<column name="extra_vars1" type="text" />
|
||||
<column name="extra_vars2" type="text" />
|
||||
<column name="extra_vars3" type="text" />
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue