1 | <?php |
---|
2 | /** |
---|
3 | * XPressME - WordPress for XOOPS |
---|
4 | * |
---|
5 | * Adding multi-author features to XPress |
---|
6 | * |
---|
7 | * @copyright toemon |
---|
8 | * @license GNU public license |
---|
9 | * @author "toemon ( http://www.toemon.com)" |
---|
10 | * @package module::xpressme |
---|
11 | */ |
---|
12 | |
---|
13 | if( ! defined( 'XOOPS_ROOT_PATH' ) ) exit ; |
---|
14 | |
---|
15 | $mydirpath = dirname(__FILE__); |
---|
16 | $mydirname = basename($mydirpath); |
---|
17 | |
---|
18 | $lang = @$GLOBALS["xoopsConfig"]['language']; |
---|
19 | |
---|
20 | // language file (modinfo.php) |
---|
21 | |
---|
22 | if( file_exists( $mydirpath .'/language/'.$lang.'/modinfo.php' ) ) { |
---|
23 | include_once $mydirpath .'/language/'.$lang.'/modinfo.php' ; |
---|
24 | } else if( file_exists( $mydirpath .'/language/english/modinfo.php' ) ) { |
---|
25 | include_once $mydirpath .'/language/english/modinfo.php' ; |
---|
26 | } |
---|
27 | global $wp_db_version,$wp_version; |
---|
28 | |
---|
29 | include $mydirpath .'/wp-includes/version.php' ; |
---|
30 | |
---|
31 | $modversion['name'] = ucfirst($mydirname) . ' ' . constant('_MI_XPRESS_NAME') ; |
---|
32 | $modversion['description'] = constant( '_MI_XPRESS_DESC'); |
---|
33 | $modversion['version'] = "0.14"; |
---|
34 | $modversion['credits'] = "Wordpress DEV (http://wordpress.org/) XPressME DEV Toemon) (http://www.toemon.com) ;"; |
---|
35 | $modversion['author'] = "toemon (http://www.toemon.com)"; |
---|
36 | $modversion['license'] = "GPL see LICENSE"; |
---|
37 | $modversion['official'] = 0 ; |
---|
38 | $modversion['image'] = 'module_icon.php' ; |
---|
39 | $modversion['dirname'] = $mydirname; |
---|
40 | |
---|
41 | // status |
---|
42 | $modversion['codename'] = "r133"; |
---|
43 | |
---|
44 | // onInstall, onUpdate, onUninstall |
---|
45 | $modversion['onInstall'] = 'include/oninstall.php' ; |
---|
46 | $modversion['onUpdate'] = 'include/onupdate.php' ; |
---|
47 | $modversion['onUninstall'] = 'include/onuninstall.php' ; |
---|
48 | |
---|
49 | // Sql file (must contain sql generated by phpMyAdmin or phpPgAdmin) |
---|
50 | //$modversion['sqlfile']['mysql'] = "sql/mysql.sql"; |
---|
51 | |
---|
52 | $db_prefix = $mydirname; |
---|
53 | if ($mydirname == 'wordpress') { |
---|
54 | $db_prefix = 'wp'; |
---|
55 | } |
---|
56 | |
---|
57 | $modversion['tables'] = array( |
---|
58 | $db_prefix . "_comments", |
---|
59 | $db_prefix . "_links", |
---|
60 | $db_prefix . "_options", |
---|
61 | $db_prefix . "_postmeta", |
---|
62 | $db_prefix . "_posts", |
---|
63 | $db_prefix . "_users", |
---|
64 | $db_prefix . "_usermeta", |
---|
65 | $db_prefix . "_terms", |
---|
66 | $db_prefix . "_term_relationships", |
---|
67 | $db_prefix . "_term_taxonomy", |
---|
68 | $db_prefix . "_views", |
---|
69 | $db_prefix . "_d3forum_link", |
---|
70 | $db_prefix . "_group_role" |
---|
71 | ); |
---|
72 | |
---|
73 | |
---|
74 | // Search |
---|
75 | $modversion['hasSearch'] = 1 ; |
---|
76 | $modversion['search']['file'] = 'include/search.php' ; |
---|
77 | $modversion['search']['func'] = $mydirname.'_global_search' ; |
---|
78 | //Admin things |
---|
79 | $modversion['hasAdmin'] = 1; |
---|
80 | $modversion['adminindex'] = "admin/index.php"; |
---|
81 | $modversion['adminmenu'] = "admin/menu.php"; |
---|
82 | |
---|
83 | $modversion['hasMain'] = 1; |
---|
84 | if(is_object($GLOBALS["xoopsUser"])){ |
---|
85 | $modversion['sub'][1]['name'] = constant( '_MI_XPRESS_MENU_POST_NEW'); |
---|
86 | $modversion['sub'][1]['url'] = "wp-admin/post-new.php"; |
---|
87 | $modversion['sub'][2]['name'] = constant( '_MI_XPRESS_MENU_EDIT'); |
---|
88 | $modversion['sub'][2]['url'] = "wp-admin/edit.php"; |
---|
89 | } |
---|
90 | |
---|
91 | // Use smarty |
---|
92 | $modversion["use_smarty"] = 1; |
---|
93 | |
---|
94 | /** |
---|
95 | * Templates |
---|
96 | */ |
---|
97 | // All Templates can't be touched by modulesadmin. |
---|
98 | $modversion['templates'] = array() ; |
---|
99 | |
---|
100 | $modversion['hasconfig'] = 1; |
---|
101 | |
---|
102 | //BLOCKS |
---|
103 | $b_no =1; |
---|
104 | $modversion['blocks'][$b_no] = array( |
---|
105 | 'file' => 'recent_comments_block.php' , |
---|
106 | 'name' => constant('_MI_XPRESS_BLOCK_COMMENTS') , |
---|
107 | 'description' => '' , |
---|
108 | 'show_func' => "b_". $mydirname . "_comments_show" , |
---|
109 | 'edit_func' => "b_". $mydirname . "_comments_edit" , |
---|
110 | 'template' => '' , |
---|
111 | 'options' => $mydirname. '||10|30|0' , |
---|
112 | 'can_clone' => true , |
---|
113 | 'func_num' => $b_no, |
---|
114 | ); |
---|
115 | $b_no++; |
---|
116 | $modversion['blocks'][$b_no] = array( |
---|
117 | 'file' => 'recent_posts_content_block.php' , |
---|
118 | 'name' => constant('_MI_XPRESS_BLOCK_CONTENT') , |
---|
119 | 'description' => '' , |
---|
120 | 'show_func' => "b_". $mydirname . "_content_show" , |
---|
121 | 'edit_func' => "b_". $mydirname . "_content_edit" , |
---|
122 | 'template' => '' , |
---|
123 | 'options' => $mydirname. '||10|0|100||0' , |
---|
124 | 'can_clone' => true , |
---|
125 | 'func_num' => $b_no, |
---|
126 | ); |
---|
127 | $b_no++; |
---|
128 | $modversion['blocks'][$b_no] = array( |
---|
129 | 'file' => 'recent_posts_list_block.php' , |
---|
130 | 'name' => constant('_MI_XPRESS_BLOCK_POSTS') , |
---|
131 | 'description' => '' , |
---|
132 | 'show_func' => "b_". $mydirname . "_posts_show" , |
---|
133 | 'edit_func' => "b_". $mydirname . "_posts_edit" , |
---|
134 | 'options' => $mydirname. '||10|1|7||0' , |
---|
135 | 'can_clone' => true , |
---|
136 | 'func_num' => $b_no, |
---|
137 | ); |
---|
138 | $b_no++; |
---|
139 | $modversion['blocks'][$b_no] = array( |
---|
140 | 'file' => 'calender_block.php' , |
---|
141 | 'name' => constant('_MI_XPRESS_BLOCK_CALENDER') , |
---|
142 | 'description' => '' , |
---|
143 | 'show_func' => "b_". $mydirname . "_calender_show" , |
---|
144 | 'edit_func' => "b_". $mydirname . "_calender_edit" , |
---|
145 | 'options' => $mydirname. '||#DB0000|#004D99' , |
---|
146 | 'can_clone' => false , |
---|
147 | 'func_num' => $b_no, |
---|
148 | ); |
---|
149 | $b_no++; |
---|
150 | $modversion['blocks'][$b_no] = array( |
---|
151 | 'file' => 'popular_posts_block.php' , |
---|
152 | 'name' => constant('_MI_XPRESS_BLOCK_POPULAR') , |
---|
153 | 'description' => '' , |
---|
154 | 'show_func' => "b_". $mydirname . "_popular_show" , |
---|
155 | 'edit_func' => "b_". $mydirname . "_popular_edit" , |
---|
156 | 'options' => $mydirname. '||10|0||0' , |
---|
157 | 'can_clone' => true , |
---|
158 | 'func_num' => $b_no, |
---|
159 | ); |
---|
160 | $b_no++; |
---|
161 | $modversion['blocks'][$b_no] = array( |
---|
162 | 'file' => 'archives_block.php' , |
---|
163 | 'name' => constant('_MI_XPRESS_BLOCK_ARCHIVE') , |
---|
164 | 'description' => '' , |
---|
165 | 'show_func' => "b_". $mydirname . "_archives_show" , |
---|
166 | 'edit_func' => "b_". $mydirname . "_archives_edit" , |
---|
167 | 'options' => $mydirname. '||monthly|0|1|0' , |
---|
168 | 'can_clone' => true , |
---|
169 | 'func_num' => $b_no, |
---|
170 | ); |
---|
171 | $b_no++; |
---|
172 | $modversion['blocks'][$b_no] = array( |
---|
173 | 'file' => 'authors_block.php' , |
---|
174 | 'name' => constant('_MI_XPRESS_BLOCK_AUTHORS') , |
---|
175 | 'description' => '' , |
---|
176 | 'show_func' => "b_". $mydirname . "_authors_show" , |
---|
177 | 'edit_func' => "b_". $mydirname . "_authors_edit" , |
---|
178 | 'options' => $mydirname. '||0|1|0|1' , |
---|
179 | 'can_clone' => false , |
---|
180 | 'func_num' => $b_no, |
---|
181 | ); |
---|
182 | $b_no++; |
---|
183 | $modversion['blocks'][$b_no] = array( |
---|
184 | 'file' => 'page_block.php' , |
---|
185 | 'name' => constant('_MI_XPRESS_BLOCK_PAGE') , |
---|
186 | 'description' => '' , |
---|
187 | 'show_func' => "b_". $mydirname . "_page_show" , |
---|
188 | 'edit_func' => "b_". $mydirname . "_page_edit" , |
---|
189 | 'options' => $mydirname. '||post_title|asc||0||0|0|none||1||' , |
---|
190 | 'can_clone' => true , |
---|
191 | 'func_num' => $b_no, |
---|
192 | ); |
---|
193 | $b_no++; |
---|
194 | $modversion['blocks'][$b_no] = array( |
---|
195 | 'file' => 'search_block.php' , |
---|
196 | 'name' => constant('_MI_XPRESS_BLOCK_SEARCH') , |
---|
197 | 'description' => '' , |
---|
198 | 'show_func' => "b_". $mydirname . "_search_show" , |
---|
199 | 'edit_func' => "b_". $mydirname . "_search_edit" , |
---|
200 | 'options' => $mydirname. '||18' , |
---|
201 | 'can_clone' => false , |
---|
202 | 'func_num' => $b_no , |
---|
203 | ); |
---|
204 | $b_no++; |
---|
205 | $modversion['blocks'][$b_no] = array( |
---|
206 | 'file' => 'tag_cloud_block.php' , |
---|
207 | 'name' => constant('_MI_XPRESS_BLOCK_TAG') , |
---|
208 | 'description' => '' , |
---|
209 | 'show_func' => "b_". $mydirname . "_tag_cloud_show" , |
---|
210 | 'edit_func' => "b_". $mydirname . "_tag_cloud_edit" , |
---|
211 | 'options' => $mydirname. '||8|22|pt|45|flat|name|ASC||' , |
---|
212 | 'can_clone' => false , |
---|
213 | 'func_num' => $b_no, |
---|
214 | ); |
---|
215 | $b_no++; |
---|
216 | $modversion['blocks'][$b_no] = array( |
---|
217 | 'file' => 'category_block.php' , |
---|
218 | 'name' => constant('_MI_XPRESS_BLOCK_CATEGORY') , |
---|
219 | 'description' => '' , |
---|
220 | 'show_func' => "b_". $mydirname . "_category_show" , |
---|
221 | 'edit_func' => "b_". $mydirname . "_category_edit" , |
---|
222 | 'options' => $mydirname. '||ALL|name|ASC|0|0|1|1|||1|0' , |
---|
223 | 'can_clone' => false , |
---|
224 | 'func_num' => $b_no, |
---|
225 | ); |
---|
226 | $b_no++; |
---|
227 | $modversion['blocks'][$b_no] = array( |
---|
228 | 'file' => 'meta_block.php' , |
---|
229 | 'name' => constant('_MI_XPRESS_BLOCK_META') , |
---|
230 | 'description' => '' , |
---|
231 | 'show_func' => "b_". $mydirname . "_meta_show" , |
---|
232 | 'edit_func' => "b_". $mydirname . "_meta_edit" , |
---|
233 | 'options' => $mydirname. '||1|1|1|1|1|1|1|1' , |
---|
234 | 'can_clone' => false , |
---|
235 | 'func_num' => $b_no, |
---|
236 | ); |
---|
237 | $b_no++; |
---|
238 | $modversion['blocks'][$b_no] = array( |
---|
239 | 'file' => 'sidebar_block.php' , |
---|
240 | 'name' => constant('_MI_XPRESS_BLOCK_SIDEBAR') , |
---|
241 | 'description' => '' , |
---|
242 | 'show_func' => "b_". $mydirname . "_sidebar_show" , |
---|
243 | 'edit_func' => '' , |
---|
244 | 'options' => '' , |
---|
245 | 'can_clone' => false , |
---|
246 | 'func_num' => $b_no, |
---|
247 | ); |
---|
248 | |
---|
249 | |
---|
250 | // Notification |
---|
251 | $modversion['hasNotification'] = 1; |
---|
252 | $modversion['notification'] = array( |
---|
253 | 'lookup_file' => 'include/notification.inc.php' , |
---|
254 | 'lookup_func' => "xpress_notify" , |
---|
255 | 'category' => array( |
---|
256 | array( |
---|
257 | 'name' => 'global' , |
---|
258 | 'title' => constant('_MI_XPRESS_NOTCAT_GLOBAL') , |
---|
259 | 'description' => constant('_MI_XPRESS_NOTCAT_GLOBALDSC') , |
---|
260 | 'subscribe_from' => 'index.php' , |
---|
261 | ) , |
---|
262 | array( |
---|
263 | 'name' => 'category' , |
---|
264 | 'title' => constant('_MI_XPRESS_NOTCAT_CAT') , |
---|
265 | 'description' => constant('_MI_XPRESS_NOTCAT_CATDSC') , |
---|
266 | 'subscribe_from' => 'index.php' , |
---|
267 | 'item_name' => 'cat' , |
---|
268 | 'allow_bookmark' => 1 , |
---|
269 | ) , |
---|
270 | array( |
---|
271 | 'name' => 'author' , |
---|
272 | 'title' => constant('_MI_XPRESS_NOTCAT_AUTHOR') , |
---|
273 | 'description' => constant('_MI_XPRESS_NOTCAT_AUTHORDSC') , |
---|
274 | 'subscribe_from' => 'index.php' , |
---|
275 | 'item_name' => 'author' , |
---|
276 | 'allow_bookmark' => 1 , |
---|
277 | ) , |
---|
278 | array( |
---|
279 | 'name' => 'post' , |
---|
280 | 'title' => constant('_MI_XPRESS_NOTCAT_POST') , |
---|
281 | 'description' => constant('_MI_XPRESS_NOTCAT_POSTDSC') , |
---|
282 | 'subscribe_from' => 'index.php' , |
---|
283 | 'item_name' => 'p' , |
---|
284 | 'allow_bookmark' => 1 , |
---|
285 | ) , |
---|
286 | ) , |
---|
287 | 'event' => array( |
---|
288 | array( |
---|
289 | 'name' => 'waiting' , |
---|
290 | 'category' => 'global' , |
---|
291 | 'title' => constant('_MI_XPRESS_NOTIFY_GLOBAL_WAITING') , |
---|
292 | 'caption' => constant('_MI_XPRESS_NOTIFY_GLOBAL_WAITINGCAP') , |
---|
293 | 'description' => constant('_MI_XPRESS_NOTIFY_GLOBAL_WAITINGCAP') , |
---|
294 | 'mail_template' => 'global_waiting' , |
---|
295 | 'mail_subject' => constant('_MI_XPRESS_NOTIFY_GLOBAL_WAITINGSBJ') , |
---|
296 | 'admin_only' => 1 , |
---|
297 | ) , |
---|
298 | array( |
---|
299 | 'name' => 'newpost' , |
---|
300 | 'category' => 'global' , |
---|
301 | 'title' => constant('_MI_XPRESS_NOTIFY_GLOBAL_NEWPOST') , |
---|
302 | 'caption' => constant('_MI_XPRESS_NOTIFY_GLOBAL_NEWPOSTCAP') , |
---|
303 | 'description' => constant('_MI_XPRESS_NOTIFY_GLOBAL_NEWPOSTCAP') , |
---|
304 | 'mail_template' => 'global_newpost' , |
---|
305 | 'mail_subject' => constant('_MI_XPRESS_NOTIFY_GLOBAL_NEWPOSTSBJ') , |
---|
306 | ) , |
---|
307 | array( |
---|
308 | 'name' => 'comment' , |
---|
309 | 'category' => 'global' , |
---|
310 | 'title' => constant('_MI_XPRESS_NOTIFY_GLOBAL_NEWCOMMENT') , |
---|
311 | 'caption' => constant('_MI_XPRESS_NOTIFY_GLOBAL_NEWCOMMENTCAP') , |
---|
312 | 'description' => constant('_MI_XPRESS_NOTIFY_GLOBAL_NEWCOMMENTCAP') , |
---|
313 | 'mail_template' => 'global_newcomment' , |
---|
314 | 'mail_subject' => constant('_MI_XPRESS_NOTIFY_GLOBAL_NEWCOMMENTSBJ') , |
---|
315 | ) , |
---|
316 | |
---|
317 | array( |
---|
318 | 'name' => 'newpost' , |
---|
319 | 'category' => 'category' , |
---|
320 | 'title' => constant('_MI_XPRESS_NOTIFY_CAT_NEWPOST') , |
---|
321 | 'caption' => constant('_MI_XPRESS_NOTIFY_CAT_NEWPOSTCAP') , |
---|
322 | 'description' => constant('_MI_XPRESS_NOTIFY_CAT_NEWPOSTCAP') , |
---|
323 | 'mail_template' => 'category_newpost' , |
---|
324 | 'mail_subject' => constant('_MI_XPRESS_NOTIFY_CAT_NEWPOSTSBJ') , |
---|
325 | ) , |
---|
326 | array( |
---|
327 | 'name' => 'comment' , |
---|
328 | 'category' => 'category' , |
---|
329 | 'title' => constant('_MI_XPRESS_NOTIFY_CAT_NEWCOMMENT') , |
---|
330 | 'caption' => constant('_MI_XPRESS_NOTIFY_CAT_NEWCOMMENTCAP') , |
---|
331 | 'description' => constant('_MI_XPRESS_NOTIFY_CAT_NEWCOMMENTCAP') , |
---|
332 | 'mail_template' => 'category_newcomment' , |
---|
333 | 'mail_subject' => constant('_MI_XPRESS_NOTIFY_CAT_NEWCOMMENTSBJ') , |
---|
334 | ) , |
---|
335 | |
---|
336 | array( |
---|
337 | 'name' => 'newpost' , |
---|
338 | 'category' => 'author' , |
---|
339 | 'title' => constant('_MI_XPRESS_NOTIFY_AUT_NEWPOST') , |
---|
340 | 'caption' => constant('_MI_XPRESS_NOTIFY_AUT_NEWPOSTCAP') , |
---|
341 | 'description' => constant('_MI_XPRESS_NOTIFY_AUT_NEWPOSTCAP') , |
---|
342 | 'mail_template' => 'author_newpost' , |
---|
343 | 'mail_subject' => constant('_MI_XPRESS_NOTIFY_AUT_NEWPOSTSBJ') , |
---|
344 | ) , |
---|
345 | array( |
---|
346 | 'name' => 'comment' , |
---|
347 | 'category' => 'author' , |
---|
348 | 'title' => constant('_MI_XPRESS_NOTIFY_AUT_NEWCOMMENT') , |
---|
349 | 'caption' => constant('_MI_XPRESS_NOTIFY_AUT_NEWCOMMENTCAP') , |
---|
350 | 'description' => constant('_MI_XPRESS_NOTIFY_AUT_NEWCOMMENTCAP') , |
---|
351 | 'mail_template' => 'author_newcomment' , |
---|
352 | 'mail_subject' => constant('_MI_XPRESS_NOTIFY_AUT_NEWCOMMENTSBJ') , |
---|
353 | ) , |
---|
354 | |
---|
355 | array( |
---|
356 | 'name' => 'comment' , |
---|
357 | 'category' => 'post' , |
---|
358 | 'title' => constant('_MI_XPRESS_NOTIFY_POST_NEWCOMMENT') , |
---|
359 | 'caption' => constant('_MI_XPRESS_NOTIFY_POST_NEWCOMMENTCAP') , |
---|
360 | 'description' => constant('_MI_XPRESS_NOTIFY_POST_NEWCOMMENTCAP') , |
---|
361 | 'mail_template' => 'post_newcomment' , |
---|
362 | 'mail_subject' => constant('_MI_XPRESS_NOTIFY_POST_NEWCOMMENTSBJ') , |
---|
363 | ) , |
---|
364 | ) , |
---|
365 | ) ; |
---|
366 | |
---|
367 | |
---|
368 | ?> |
---|