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