-
Notifications
You must be signed in to change notification settings - Fork 0
/
upgletyle.class.php
114 lines (89 loc) · 3.79 KB
/
upgletyle.class.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
<?php
/**
* @class upgletyle
* @author UPGLE ([email protected])
* @brief upgletyle module main class
**/
require_once(_XE_PATH_.'modules/upgletyle/upgletyle.info.php');
class upgletyle extends ModuleObject {
/**
* @berif default mid
**/
var $upgletyle_mid = 'upgletyle';
/**
* @berif default skin
**/
var $skin = 'happyLetter';
var $mskin = 'default';
// post list
var $post_style = 'content';//,'summary','list'
var $post_list_count = 1;
// list count
var $comment_list_count = 30;
var $guestbook_list_count = 30;
// guestbook and comment input require
var $input_email = 'R';//,'Y','N;
var $input_website = 'R';//'Y','N';
var $post_editor_skin = "dreditor";
var $post_use_prefix = 'Y';//'Y','N';
var $post_use_suffix = 'Y';//'Y','N';
var $search_option = array('title','content','title_content','comment','user_name','nick_name','user_id','tag'); ///< 검색 옵션
var $order_target = array('list_order', 'update_order', 'regdate', 'voted_count', 'readed_count', 'comment_count', 'title'); // 정렬 옵션
var $add_triggers = array(
array('display', 'upgletyle', 'controller', 'triggerMemberMenu', 'before'),
array('comment.insertComment', 'upgletyle', 'controller', 'triggerInsertComment', 'after'),
array('comment.deleteComment', 'upgletyle', 'controller', 'triggerDeleteComment', 'after'),
array('trackback.insertTrackback', 'upgletyle', 'controller', 'triggerInsertTrackback', 'after'),
array('trackback.deleteTrackback', 'upgletyle', 'controller', 'triggerDeleteTrackback', 'after'),
array('moduleHandler.proc', 'upgletyle', 'controller', 'triggerApplyLayout', 'after')
);
/**
* @brief module install
**/
function moduleInstall() {
$oModuleController = &getController('module');
foreach($this->add_triggers as $trigger) {
$oModuleController->insertTrigger($trigger[0], $trigger[1], $trigger[2], $trigger[3], $trigger[4]);
}
}
/**
* @brief check for update method
**/
function checkUpdate() {
$oDB = &DB::getInstance();
$oModuleModel = &getModel('module');
foreach($this->add_triggers as $trigger) {
if(!$oModuleModel->getTrigger($trigger[0], $trigger[1], $trigger[2], $trigger[3], $trigger[4])) return true;
}
//post_list_count 컬럼 체크
if(!$oDB->isColumnExists("upgletyle","category_list_count")) return true;
return false;
}
/**
* @brief module update
**/
function moduleUpdate() {
$oDB = &DB::getInstance();
$oModuleModel = &getModel('module');
$oModuleController = &getController('module');
foreach($this->add_triggers as $trigger) {
if(!$oModuleModel->getTrigger($trigger[0], $trigger[1], $trigger[2], $trigger[3], $trigger[4])) {
$oModuleController->insertTrigger($trigger[0], $trigger[1], $trigger[2], $trigger[3], $trigger[4]);
}
}
//post_list_count 컬럼 추가
if(!$oDB->isColumnExists("upgletyle","category_list_count")) $oDB->addColumn('upgletyle',"category_list_count","number",2,30,true);
return new Object(0, 'success_updated');
}
/**
* @brief recompile cache
**/
function recompileCache() {
}
function checkXECoreVersion($requried_version){
$result = version_compare(__ZBXE_VERSION__,$requried_version,'>=');
if($result != 1) return false;
return true;
}
}
?>