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://ja.xpressme.info)" |
---|
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_XP2_NAME') ; |
---|
32 | $modversion['description'] = constant( '_MI_XP2_DESC'); |
---|
33 | $modversion['version'] = "2.10"; |
---|
34 | $modversion['credits'] = "Wordpress DEV (http://wordpress.org/) XPressME DEV Toemon) (http://ja.xpressme.info) ;"; |
---|
35 | $modversion['author'] = "toemon (http://ja.xpressme.info)"; |
---|
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'] = "Bata-7(r323)"; |
---|
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 | /* |
---|
58 | * Table information is not described. |
---|
59 | * |
---|
60 | * The create of the table is do with oninstall.php. |
---|
61 | * The drop of the table is do with onuninstall.php. |
---|
62 | * |
---|
63 | * $modversion['tables'] = array( ,,,); |
---|
64 | */ |
---|
65 | |
---|
66 | |
---|
67 | // Search |
---|
68 | $modversion['hasSearch'] = 1 ; |
---|
69 | $modversion['search']['file'] = 'include/search.php' ; |
---|
70 | $modversion['search']['func'] = $mydirname.'_global_search' ; |
---|
71 | //Admin things |
---|
72 | $modversion['hasAdmin'] = 1; |
---|
73 | $modversion['adminindex'] = "admin/index.php"; |
---|
74 | $modversion['adminmenu'] = "admin/menu.php"; |
---|
75 | |
---|
76 | $modversion['hasMain'] = 1; |
---|
77 | |
---|
78 | |
---|
79 | if(is_object($GLOBALS["xoopsUser"])){ |
---|
80 | global $current_user; |
---|
81 | if (@$current_user->user_level > 0) { |
---|
82 | $modversion['sub'][1]['name'] = constant( '_MI_XP2_MENU_POST_NEW'); |
---|
83 | if ($wp_db_version > 5000) |
---|
84 | $modversion['sub'][1]['url'] = "wp-admin/post-new.php"; |
---|
85 | else |
---|
86 | $modversion['sub'][1]['url'] = "wp-admin/post.php"; |
---|
87 | $modversion['sub'][2]['name'] = constant( '_MI_XP2_MENU_EDIT'); |
---|
88 | $modversion['sub'][2]['url'] = "wp-admin/edit.php"; |
---|
89 | $modversion['sub'][3]['name'] = constant( '_MI_XP2_MENU_ADMIN'); |
---|
90 | $modversion['sub'][3]['url'] = "wp-admin/"; |
---|
91 | } |
---|
92 | if (@$current_user->user_level > 9) { |
---|
93 | $modversion['sub'][4]['name'] = constant( '_MI_XP2_MENU_XPRESS'); |
---|
94 | // $modversion['sub'][4]['url'] = "wp-admin/options-general.php?page=xpressme_config"; |
---|
95 | $modversion['sub'][4]['url'] = "wp-admin/admin.php?page=xpressme\\xpressme.php"; |
---|
96 | } |
---|
97 | if($GLOBALS["xoopsUserIsAdmin"]){ |
---|
98 | $modversion['sub'][5]['name'] = constant( '_MI_XP2_MOD_ADMIN'); |
---|
99 | $modversion['sub'][5]['url'] = "admin/index.php"; |
---|
100 | } |
---|
101 | |
---|
102 | } |
---|
103 | |
---|
104 | // Use smarty |
---|
105 | $modversion["use_smarty"] = 1; |
---|
106 | |
---|
107 | /** |
---|
108 | * Templates |
---|
109 | */ |
---|
110 | // All Templates can't be touched by modulesadmin. |
---|
111 | $modversion['templates'] = array() ; |
---|
112 | |
---|
113 | if (defined('ICMS_ROOT_PATH')){ |
---|
114 | $modversion['hasconfig'] = 1; |
---|
115 | $modversion['config'][] = array( |
---|
116 | 'name' => 'dummy' , |
---|
117 | 'title' => 'Dummy Value' , |
---|
118 | 'description' => 'This is Dummy Value' , |
---|
119 | 'formtype' => 'yesno' , |
---|
120 | 'valuetype' => 'int' , |
---|
121 | 'default' => 0 , |
---|
122 | ); |
---|
123 | } |
---|
124 | |
---|
125 | //BLOCKS |
---|
126 | $b_no =1; |
---|
127 | $modversion['blocks'][$b_no] = array( |
---|
128 | 'file' => 'recent_posts_content_block.php' , |
---|
129 | 'name' => constant('_MI_XP2_BLOCK_CONTENT') , |
---|
130 | 'description' => '' , |
---|
131 | 'show_func' => "b_". $mydirname . "_content_show" , |
---|
132 | 'edit_func' => "b_". $mydirname . "_content_edit" , |
---|
133 | 'template' => '' , |
---|
134 | 'options' => $mydirname. '||10|0|100||||0' , |
---|
135 | 'can_clone' => true , |
---|
136 | 'func_num' => $b_no, |
---|
137 | ); |
---|
138 | $b_no++; |
---|
139 | $modversion['blocks'][$b_no] = array( |
---|
140 | 'file' => 'recent_posts_list_block.php' , |
---|
141 | 'name' => constant('_MI_XP2_BLOCK_POSTS') , |
---|
142 | 'description' => '' , |
---|
143 | 'show_func' => "b_". $mydirname . "_posts_show" , |
---|
144 | 'edit_func' => "b_". $mydirname . "_posts_edit" , |
---|
145 | 'options' => $mydirname. '||10|1|7||||0' , |
---|
146 | 'can_clone' => true , |
---|
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_XP2_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' => 'page_block.php' , |
---|
163 | 'name' => constant('_MI_XP2_BLOCK_PAGE') , |
---|
164 | 'description' => '' , |
---|
165 | 'show_func' => "b_". $mydirname . "_page_show" , |
---|
166 | 'edit_func' => "b_". $mydirname . "_page_edit" , |
---|
167 | 'options' => $mydirname. '||post_title|asc||||0|0|none||1||' , |
---|
168 | 'can_clone' => true , |
---|
169 | 'func_num' => $b_no, |
---|
170 | ); |
---|
171 | $b_no++; |
---|
172 | $modversion['blocks'][$b_no] = array( |
---|
173 | 'file' => 'recent_comments_block.php' , |
---|
174 | 'name' => constant('_MI_XP2_BLOCK_COMMENTS') , |
---|
175 | 'description' => '' , |
---|
176 | 'show_func' => "b_". $mydirname . "_comments_show" , |
---|
177 | 'edit_func' => "b_". $mydirname . "_comments_edit" , |
---|
178 | 'template' => '' , |
---|
179 | 'options' => $mydirname. '||10|30|||0' , |
---|
180 | 'can_clone' => true , |
---|
181 | 'func_num' => $b_no, |
---|
182 | ); |
---|
183 | $b_no++; |
---|
184 | $modversion['blocks'][$b_no] = array( |
---|
185 | 'file' => 'sidebar_block.php' , |
---|
186 | 'name' => constant('_MI_XP2_BLOCK_SIDEBAR') , |
---|
187 | 'description' => '' , |
---|
188 | 'show_func' => "b_". $mydirname . "_sidebar_show" , |
---|
189 | 'edit_func' => '' , |
---|
190 | 'options' => '' , |
---|
191 | 'can_clone' => false , |
---|
192 | 'func_num' => $b_no, |
---|
193 | ); |
---|
194 | $b_no++; |
---|
195 | $modversion['blocks'][$b_no] = array( |
---|
196 | 'file' => 'search_block.php' , |
---|
197 | 'name' => constant('_MI_XP2_BLOCK_SEARCH') , |
---|
198 | 'description' => '' , |
---|
199 | 'show_func' => "b_". $mydirname . "_search_show" , |
---|
200 | 'edit_func' => "b_". $mydirname . "_search_edit" , |
---|
201 | 'options' => $mydirname. '||18' , |
---|
202 | 'can_clone' => false , |
---|
203 | 'func_num' => $b_no , |
---|
204 | ); |
---|
205 | $b_no++; |
---|
206 | $modversion['blocks'][$b_no] = array( |
---|
207 | 'file' => 'calender_block.php' , |
---|
208 | 'name' => constant('_MI_XP2_BLOCK_CALENDER') , |
---|
209 | 'description' => '' , |
---|
210 | 'show_func' => "b_". $mydirname . "_calender_show" , |
---|
211 | 'edit_func' => "b_". $mydirname . "_calender_edit" , |
---|
212 | 'options' => $mydirname. '||#DB0000|#004D99' , |
---|
213 | 'can_clone' => false , |
---|
214 | 'func_num' => $b_no, |
---|
215 | ); |
---|
216 | $b_no++; |
---|
217 | $modversion['blocks'][$b_no] = array( |
---|
218 | 'file' => 'archives_block.php' , |
---|
219 | 'name' => constant('_MI_XP2_BLOCK_ARCHIVE') , |
---|
220 | 'description' => '' , |
---|
221 | 'show_func' => "b_". $mydirname . "_archives_show" , |
---|
222 | 'edit_func' => "b_". $mydirname . "_archives_edit" , |
---|
223 | 'options' => $mydirname. '||monthly|0|1|0' , |
---|
224 | 'can_clone' => true , |
---|
225 | 'func_num' => $b_no, |
---|
226 | ); |
---|
227 | $b_no++; |
---|
228 | $modversion['blocks'][$b_no] = array( |
---|
229 | 'file' => 'authors_block.php' , |
---|
230 | 'name' => constant('_MI_XP2_BLOCK_AUTHORS') , |
---|
231 | 'description' => '' , |
---|
232 | 'show_func' => "b_". $mydirname . "_authors_show" , |
---|
233 | 'edit_func' => "b_". $mydirname . "_authors_edit" , |
---|
234 | 'options' => $mydirname. '||0|1|0|1' , |
---|
235 | 'can_clone' => false , |
---|
236 | 'func_num' => $b_no, |
---|
237 | ); |
---|
238 | $b_no++; |
---|
239 | $modversion['blocks'][$b_no] = array( |
---|
240 | 'file' => 'tag_cloud_block.php' , |
---|
241 | 'name' => constant('_MI_XP2_BLOCK_TAG') , |
---|
242 | 'description' => '' , |
---|
243 | 'show_func' => "b_". $mydirname . "_tag_cloud_show" , |
---|
244 | 'edit_func' => "b_". $mydirname . "_tag_cloud_edit" , |
---|
245 | 'options' => $mydirname. '||8|22|pt|45|flat|name|ASC||' , |
---|
246 | 'can_clone' => false , |
---|
247 | 'func_num' => $b_no, |
---|
248 | ); |
---|
249 | $b_no++; |
---|
250 | $modversion['blocks'][$b_no] = array( |
---|
251 | 'file' => 'category_block.php' , |
---|
252 | 'name' => constant('_MI_XP2_BLOCK_CATEGORY') , |
---|
253 | 'description' => '' , |
---|
254 | 'show_func' => "b_". $mydirname . "_category_show" , |
---|
255 | 'edit_func' => "b_". $mydirname . "_category_edit" , |
---|
256 | 'options' => $mydirname. '||ALL|name|ASC|0|0|1|1|||1|0' , |
---|
257 | 'can_clone' => false , |
---|
258 | 'func_num' => $b_no, |
---|
259 | ); |
---|
260 | $b_no++; |
---|
261 | $modversion['blocks'][$b_no] = array( |
---|
262 | 'file' => 'meta_block.php' , |
---|
263 | 'name' => constant('_MI_XP2_BLOCK_META') , |
---|
264 | 'description' => '' , |
---|
265 | 'show_func' => "b_". $mydirname . "_meta_show" , |
---|
266 | 'edit_func' => "b_". $mydirname . "_meta_edit" , |
---|
267 | 'options' => $mydirname. '||1|1|1|1|1|1|1|1' , |
---|
268 | 'can_clone' => false , |
---|
269 | 'func_num' => $b_no, |
---|
270 | ); |
---|
271 | $b_no++; |
---|
272 | $modversion['blocks'][$b_no] = array( |
---|
273 | 'file' => 'widget_block.php' , |
---|
274 | 'name' => constant('_MI_XP2_BLOCK_WIDGET') , |
---|
275 | 'description' => '' , |
---|
276 | 'show_func' => "b_". $mydirname . "_widget_show" , |
---|
277 | 'edit_func' => "b_". $mydirname . "_widget_edit" , |
---|
278 | 'options' => $mydirname. '||' , |
---|
279 | 'can_clone' => true , |
---|
280 | 'func_num' => $b_no, |
---|
281 | ); |
---|
282 | $b_no++; |
---|
283 | $modversion['blocks'][$b_no] = array( |
---|
284 | 'file' => 'enhanced_block.php' , |
---|
285 | 'name' => constant('_MI_XP2_BLOCK_ENHANCED') , |
---|
286 | 'description' => '' , |
---|
287 | 'show_func' => "b_". $mydirname . "_enhanced_show" , |
---|
288 | 'edit_func' => "b_". $mydirname . "_enhanced_edit" , |
---|
289 | 'options' => $mydirname. '||' , |
---|
290 | 'can_clone' => true , |
---|
291 | 'func_num' => $b_no, |
---|
292 | ); |
---|
293 | |
---|
294 | |
---|
295 | // Notification |
---|
296 | $modversion['hasNotification'] = 1; |
---|
297 | $modversion['notification'] = array( |
---|
298 | 'lookup_file' => 'include/notification.inc.php' , |
---|
299 | 'lookup_func' => "xpress_notify" , |
---|
300 | 'category' => array( |
---|
301 | array( |
---|
302 | 'name' => 'global' , |
---|
303 | 'title' => constant('_MI_XP2_NOTCAT_GLOBAL') , |
---|
304 | 'description' => constant('_MI_XP2_NOTCAT_GLOBALDSC') , |
---|
305 | 'subscribe_from' => 'index.php' , |
---|
306 | ) , |
---|
307 | array( |
---|
308 | 'name' => 'category' , |
---|
309 | 'title' => constant('_MI_XP2_NOTCAT_CAT') , |
---|
310 | 'description' => constant('_MI_XP2_NOTCAT_CATDSC') , |
---|
311 | 'subscribe_from' => 'index.php' , |
---|
312 | 'item_name' => 'cat' , |
---|
313 | 'allow_bookmark' => 1 , |
---|
314 | ) , |
---|
315 | array( |
---|
316 | 'name' => 'author' , |
---|
317 | 'title' => constant('_MI_XP2_NOTCAT_AUTHOR') , |
---|
318 | 'description' => constant('_MI_XP2_NOTCAT_AUTHORDSC') , |
---|
319 | 'subscribe_from' => 'index.php' , |
---|
320 | 'item_name' => 'author' , |
---|
321 | 'allow_bookmark' => 1 , |
---|
322 | ) , |
---|
323 | array( |
---|
324 | 'name' => 'post' , |
---|
325 | 'title' => constant('_MI_XP2_NOTCAT_POST') , |
---|
326 | 'description' => constant('_MI_XP2_NOTCAT_POSTDSC') , |
---|
327 | 'subscribe_from' => 'index.php' , |
---|
328 | 'item_name' => 'p' , |
---|
329 | 'allow_bookmark' => 1 , |
---|
330 | ) , |
---|
331 | ) , |
---|
332 | 'event' => array( |
---|
333 | array( |
---|
334 | 'name' => 'waiting' , |
---|
335 | 'category' => 'global' , |
---|
336 | 'title' => constant('_MI_XP2_NOTIFY_GLOBAL_WAITING') , |
---|
337 | 'caption' => constant('_MI_XP2_NOTIFY_GLOBAL_WAITINGCAP') , |
---|
338 | 'description' => constant('_MI_XP2_NOTIFY_GLOBAL_WAITINGCAP') , |
---|
339 | 'mail_template' => 'global_waiting' , |
---|
340 | 'mail_subject' => constant('_MI_XP2_NOTIFY_GLOBAL_WAITINGSBJ') , |
---|
341 | 'admin_only' => 1 , |
---|
342 | ) , |
---|
343 | array( |
---|
344 | 'name' => 'newpost' , |
---|
345 | 'category' => 'global' , |
---|
346 | 'title' => constant('_MI_XP2_NOTIFY_GLOBAL_NEWPOST') , |
---|
347 | 'caption' => constant('_MI_XP2_NOTIFY_GLOBAL_NEWPOSTCAP') , |
---|
348 | 'description' => constant('_MI_XP2_NOTIFY_GLOBAL_NEWPOSTCAP') , |
---|
349 | 'mail_template' => 'global_newpost' , |
---|
350 | 'mail_subject' => constant('_MI_XP2_NOTIFY_GLOBAL_NEWPOSTSBJ') , |
---|
351 | ) , |
---|
352 | array( |
---|
353 | 'name' => 'comment' , |
---|
354 | 'category' => 'global' , |
---|
355 | 'title' => constant('_MI_XP2_NOTIFY_GLOBAL_NEWCOMMENT') , |
---|
356 | 'caption' => constant('_MI_XP2_NOTIFY_GLOBAL_NEWCOMMENTCAP') , |
---|
357 | 'description' => constant('_MI_XP2_NOTIFY_GLOBAL_NEWCOMMENTCAP') , |
---|
358 | 'mail_template' => 'global_newcomment' , |
---|
359 | 'mail_subject' => constant('_MI_XP2_NOTIFY_GLOBAL_NEWCOMMENTSBJ') , |
---|
360 | ) , |
---|
361 | |
---|
362 | array( |
---|
363 | 'name' => 'newpost' , |
---|
364 | 'category' => 'category' , |
---|
365 | 'title' => constant('_MI_XP2_NOTIFY_CAT_NEWPOST') , |
---|
366 | 'caption' => constant('_MI_XP2_NOTIFY_CAT_NEWPOSTCAP') , |
---|
367 | 'description' => constant('_MI_XP2_NOTIFY_CAT_NEWPOSTCAP') , |
---|
368 | 'mail_template' => 'category_newpost' , |
---|
369 | 'mail_subject' => constant('_MI_XP2_NOTIFY_CAT_NEWPOSTSBJ') , |
---|
370 | ) , |
---|
371 | array( |
---|
372 | 'name' => 'comment' , |
---|
373 | 'category' => 'category' , |
---|
374 | 'title' => constant('_MI_XP2_NOTIFY_CAT_NEWCOMMENT') , |
---|
375 | 'caption' => constant('_MI_XP2_NOTIFY_CAT_NEWCOMMENTCAP') , |
---|
376 | 'description' => constant('_MI_XP2_NOTIFY_CAT_NEWCOMMENTCAP') , |
---|
377 | 'mail_template' => 'category_newcomment' , |
---|
378 | 'mail_subject' => constant('_MI_XP2_NOTIFY_CAT_NEWCOMMENTSBJ') , |
---|
379 | ) , |
---|
380 | |
---|
381 | array( |
---|
382 | 'name' => 'newpost' , |
---|
383 | 'category' => 'author' , |
---|
384 | 'title' => constant('_MI_XP2_NOTIFY_AUT_NEWPOST') , |
---|
385 | 'caption' => constant('_MI_XP2_NOTIFY_AUT_NEWPOSTCAP') , |
---|
386 | 'description' => constant('_MI_XP2_NOTIFY_AUT_NEWPOSTCAP') , |
---|
387 | 'mail_template' => 'author_newpost' , |
---|
388 | 'mail_subject' => constant('_MI_XP2_NOTIFY_AUT_NEWPOSTSBJ') , |
---|
389 | ) , |
---|
390 | array( |
---|
391 | 'name' => 'comment' , |
---|
392 | 'category' => 'author' , |
---|
393 | 'title' => constant('_MI_XP2_NOTIFY_AUT_NEWCOMMENT') , |
---|
394 | 'caption' => constant('_MI_XP2_NOTIFY_AUT_NEWCOMMENTCAP') , |
---|
395 | 'description' => constant('_MI_XP2_NOTIFY_AUT_NEWCOMMENTCAP') , |
---|
396 | 'mail_template' => 'author_newcomment' , |
---|
397 | 'mail_subject' => constant('_MI_XP2_NOTIFY_AUT_NEWCOMMENTSBJ') , |
---|
398 | ) , |
---|
399 | |
---|
400 | array( |
---|
401 | 'name' => 'comment' , |
---|
402 | 'category' => 'post' , |
---|
403 | 'title' => constant('_MI_XP2_NOTIFY_POST_NEWCOMMENT') , |
---|
404 | 'caption' => constant('_MI_XP2_NOTIFY_POST_NEWCOMMENTCAP') , |
---|
405 | 'description' => constant('_MI_XP2_NOTIFY_POST_NEWCOMMENTCAP') , |
---|
406 | 'mail_template' => 'post_newcomment' , |
---|
407 | 'mail_subject' => constant('_MI_XP2_NOTIFY_POST_NEWCOMMENTSBJ') , |
---|
408 | ) , |
---|
409 | ) , |
---|
410 | ) ; |
---|
411 | |
---|
412 | |
---|
413 | ?> |
---|