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.19"; |
---|
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'] = "r142"; |
---|
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 | $modversion['sub'][3]['name'] = constant( '_MI_XPRESS_MENU_ADMIN'); |
---|
90 | $modversion['sub'][3]['url'] = "wp-admin/"; |
---|
91 | $modversion['sub'][4]['name'] = constant( '_MI_XPRESS_MENU_XPRESS'); |
---|
92 | $modversion['sub'][4]['url'] = "wp-admin/options-general.php?page=xpressme_config"; |
---|
93 | } |
---|
94 | |
---|
95 | // Use smarty |
---|
96 | $modversion["use_smarty"] = 1; |
---|
97 | |
---|
98 | /** |
---|
99 | * Templates |
---|
100 | */ |
---|
101 | // All Templates can't be touched by modulesadmin. |
---|
102 | $modversion['templates'] = array() ; |
---|
103 | |
---|
104 | $modversion['hasconfig'] = 1; |
---|
105 | |
---|
106 | //BLOCKS |
---|
107 | $b_no =1; |
---|
108 | $modversion['blocks'][$b_no] = array( |
---|
109 | 'file' => 'recent_posts_content_block.php' , |
---|
110 | 'name' => constant('_MI_XPRESS_BLOCK_CONTENT') , |
---|
111 | 'description' => '' , |
---|
112 | 'show_func' => "b_". $mydirname . "_content_show" , |
---|
113 | 'edit_func' => "b_". $mydirname . "_content_edit" , |
---|
114 | 'template' => '' , |
---|
115 | 'options' => $mydirname. '||10|0|100||||0' , |
---|
116 | 'can_clone' => true , |
---|
117 | 'func_num' => $b_no, |
---|
118 | ); |
---|
119 | $b_no++; |
---|
120 | $modversion['blocks'][$b_no] = array( |
---|
121 | 'file' => 'recent_posts_list_block.php' , |
---|
122 | 'name' => constant('_MI_XPRESS_BLOCK_POSTS') , |
---|
123 | 'description' => '' , |
---|
124 | 'show_func' => "b_". $mydirname . "_posts_show" , |
---|
125 | 'edit_func' => "b_". $mydirname . "_posts_edit" , |
---|
126 | 'options' => $mydirname. '||10|1|7||||0' , |
---|
127 | 'can_clone' => true , |
---|
128 | 'func_num' => $b_no, |
---|
129 | ); |
---|
130 | $b_no++; |
---|
131 | $modversion['blocks'][$b_no] = array( |
---|
132 | 'file' => 'popular_posts_block.php' , |
---|
133 | 'name' => constant('_MI_XPRESS_BLOCK_POPULAR') , |
---|
134 | 'description' => '' , |
---|
135 | 'show_func' => "b_". $mydirname . "_popular_show" , |
---|
136 | 'edit_func' => "b_". $mydirname . "_popular_edit" , |
---|
137 | 'options' => $mydirname. '||10|0||||0' , |
---|
138 | 'can_clone' => true , |
---|
139 | 'func_num' => $b_no, |
---|
140 | ); |
---|
141 | $b_no++; |
---|
142 | $modversion['blocks'][$b_no] = array( |
---|
143 | 'file' => 'page_block.php' , |
---|
144 | 'name' => constant('_MI_XPRESS_BLOCK_PAGE') , |
---|
145 | 'description' => '' , |
---|
146 | 'show_func' => "b_". $mydirname . "_page_show" , |
---|
147 | 'edit_func' => "b_". $mydirname . "_page_edit" , |
---|
148 | 'options' => $mydirname. '||post_title|asc||0||0|0|none||1||' , |
---|
149 | 'can_clone' => true , |
---|
150 | 'func_num' => $b_no, |
---|
151 | ); |
---|
152 | $b_no++; |
---|
153 | $modversion['blocks'][$b_no] = array( |
---|
154 | 'file' => 'recent_comments_block.php' , |
---|
155 | 'name' => constant('_MI_XPRESS_BLOCK_COMMENTS') , |
---|
156 | 'description' => '' , |
---|
157 | 'show_func' => "b_". $mydirname . "_comments_show" , |
---|
158 | 'edit_func' => "b_". $mydirname . "_comments_edit" , |
---|
159 | 'template' => '' , |
---|
160 | 'options' => $mydirname. '||10|30|||0' , |
---|
161 | 'can_clone' => true , |
---|
162 | 'func_num' => $b_no, |
---|
163 | ); |
---|
164 | $b_no++; |
---|
165 | $modversion['blocks'][$b_no] = array( |
---|
166 | 'file' => 'sidebar_block.php' , |
---|
167 | 'name' => constant('_MI_XPRESS_BLOCK_SIDEBAR') , |
---|
168 | 'description' => '' , |
---|
169 | 'show_func' => "b_". $mydirname . "_sidebar_show" , |
---|
170 | 'edit_func' => '' , |
---|
171 | 'options' => '' , |
---|
172 | 'can_clone' => false , |
---|
173 | 'func_num' => $b_no, |
---|
174 | ); |
---|
175 | $b_no++; |
---|
176 | $modversion['blocks'][$b_no] = array( |
---|
177 | 'file' => 'search_block.php' , |
---|
178 | 'name' => constant('_MI_XPRESS_BLOCK_SEARCH') , |
---|
179 | 'description' => '' , |
---|
180 | 'show_func' => "b_". $mydirname . "_search_show" , |
---|
181 | 'edit_func' => "b_". $mydirname . "_search_edit" , |
---|
182 | 'options' => $mydirname. '||18' , |
---|
183 | 'can_clone' => false , |
---|
184 | 'func_num' => $b_no , |
---|
185 | ); |
---|
186 | $b_no++; |
---|
187 | $modversion['blocks'][$b_no] = array( |
---|
188 | 'file' => 'calender_block.php' , |
---|
189 | 'name' => constant('_MI_XPRESS_BLOCK_CALENDER') , |
---|
190 | 'description' => '' , |
---|
191 | 'show_func' => "b_". $mydirname . "_calender_show" , |
---|
192 | 'edit_func' => "b_". $mydirname . "_calender_edit" , |
---|
193 | 'options' => $mydirname. '||#DB0000|#004D99' , |
---|
194 | 'can_clone' => false , |
---|
195 | 'func_num' => $b_no, |
---|
196 | ); |
---|
197 | $b_no++; |
---|
198 | $modversion['blocks'][$b_no] = array( |
---|
199 | 'file' => 'archives_block.php' , |
---|
200 | 'name' => constant('_MI_XPRESS_BLOCK_ARCHIVE') , |
---|
201 | 'description' => '' , |
---|
202 | 'show_func' => "b_". $mydirname . "_archives_show" , |
---|
203 | 'edit_func' => "b_". $mydirname . "_archives_edit" , |
---|
204 | 'options' => $mydirname. '||monthly|0|1|0' , |
---|
205 | 'can_clone' => true , |
---|
206 | 'func_num' => $b_no, |
---|
207 | ); |
---|
208 | $b_no++; |
---|
209 | $modversion['blocks'][$b_no] = array( |
---|
210 | 'file' => 'authors_block.php' , |
---|
211 | 'name' => constant('_MI_XPRESS_BLOCK_AUTHORS') , |
---|
212 | 'description' => '' , |
---|
213 | 'show_func' => "b_". $mydirname . "_authors_show" , |
---|
214 | 'edit_func' => "b_". $mydirname . "_authors_edit" , |
---|
215 | 'options' => $mydirname. '||0|1|0|1' , |
---|
216 | 'can_clone' => false , |
---|
217 | 'func_num' => $b_no, |
---|
218 | ); |
---|
219 | $b_no++; |
---|
220 | $modversion['blocks'][$b_no] = array( |
---|
221 | 'file' => 'tag_cloud_block.php' , |
---|
222 | 'name' => constant('_MI_XPRESS_BLOCK_TAG') , |
---|
223 | 'description' => '' , |
---|
224 | 'show_func' => "b_". $mydirname . "_tag_cloud_show" , |
---|
225 | 'edit_func' => "b_". $mydirname . "_tag_cloud_edit" , |
---|
226 | 'options' => $mydirname. '||8|22|pt|45|flat|name|ASC||' , |
---|
227 | 'can_clone' => false , |
---|
228 | 'func_num' => $b_no, |
---|
229 | ); |
---|
230 | $b_no++; |
---|
231 | $modversion['blocks'][$b_no] = array( |
---|
232 | 'file' => 'category_block.php' , |
---|
233 | 'name' => constant('_MI_XPRESS_BLOCK_CATEGORY') , |
---|
234 | 'description' => '' , |
---|
235 | 'show_func' => "b_". $mydirname . "_category_show" , |
---|
236 | 'edit_func' => "b_". $mydirname . "_category_edit" , |
---|
237 | 'options' => $mydirname. '||ALL|name|ASC|0|0|1|1|||1|0' , |
---|
238 | 'can_clone' => false , |
---|
239 | 'func_num' => $b_no, |
---|
240 | ); |
---|
241 | $b_no++; |
---|
242 | $modversion['blocks'][$b_no] = array( |
---|
243 | 'file' => 'meta_block.php' , |
---|
244 | 'name' => constant('_MI_XPRESS_BLOCK_META') , |
---|
245 | 'description' => '' , |
---|
246 | 'show_func' => "b_". $mydirname . "_meta_show" , |
---|
247 | 'edit_func' => "b_". $mydirname . "_meta_edit" , |
---|
248 | 'options' => $mydirname. '||1|1|1|1|1|1|1|1' , |
---|
249 | 'can_clone' => false , |
---|
250 | 'func_num' => $b_no, |
---|
251 | ); |
---|
252 | $b_no++; |
---|
253 | $modversion['blocks'][$b_no] = array( |
---|
254 | 'file' => 'widget_block.php' , |
---|
255 | 'name' => constant('_MI_XPRESS_BLOCK_WIDGET') , |
---|
256 | 'description' => '' , |
---|
257 | 'show_func' => "b_". $mydirname . "_widget_show" , |
---|
258 | 'edit_func' => "b_". $mydirname . "_widget_edit" , |
---|
259 | 'options' => $mydirname. '||' , |
---|
260 | 'can_clone' => true , |
---|
261 | 'func_num' => $b_no, |
---|
262 | ); |
---|
263 | $b_no++; |
---|
264 | $modversion['blocks'][$b_no] = array( |
---|
265 | 'file' => 'enhanced_block.php' , |
---|
266 | 'name' => constant('_MI_XPRESS_BLOCK_ENHANCED') , |
---|
267 | 'description' => '' , |
---|
268 | 'show_func' => "b_". $mydirname . "_enhanced_show" , |
---|
269 | 'edit_func' => "b_". $mydirname . "_enhanced_edit" , |
---|
270 | 'options' => $mydirname. '||' , |
---|
271 | 'can_clone' => true , |
---|
272 | 'func_num' => $b_no, |
---|
273 | ); |
---|
274 | |
---|
275 | |
---|
276 | // Notification |
---|
277 | $modversion['hasNotification'] = 1; |
---|
278 | $modversion['notification'] = array( |
---|
279 | 'lookup_file' => 'include/notification.inc.php' , |
---|
280 | 'lookup_func' => "xpress_notify" , |
---|
281 | 'category' => array( |
---|
282 | array( |
---|
283 | 'name' => 'global' , |
---|
284 | 'title' => constant('_MI_XPRESS_NOTCAT_GLOBAL') , |
---|
285 | 'description' => constant('_MI_XPRESS_NOTCAT_GLOBALDSC') , |
---|
286 | 'subscribe_from' => 'index.php' , |
---|
287 | ) , |
---|
288 | array( |
---|
289 | 'name' => 'category' , |
---|
290 | 'title' => constant('_MI_XPRESS_NOTCAT_CAT') , |
---|
291 | 'description' => constant('_MI_XPRESS_NOTCAT_CATDSC') , |
---|
292 | 'subscribe_from' => 'index.php' , |
---|
293 | 'item_name' => 'cat' , |
---|
294 | 'allow_bookmark' => 1 , |
---|
295 | ) , |
---|
296 | array( |
---|
297 | 'name' => 'author' , |
---|
298 | 'title' => constant('_MI_XPRESS_NOTCAT_AUTHOR') , |
---|
299 | 'description' => constant('_MI_XPRESS_NOTCAT_AUTHORDSC') , |
---|
300 | 'subscribe_from' => 'index.php' , |
---|
301 | 'item_name' => 'author' , |
---|
302 | 'allow_bookmark' => 1 , |
---|
303 | ) , |
---|
304 | array( |
---|
305 | 'name' => 'post' , |
---|
306 | 'title' => constant('_MI_XPRESS_NOTCAT_POST') , |
---|
307 | 'description' => constant('_MI_XPRESS_NOTCAT_POSTDSC') , |
---|
308 | 'subscribe_from' => 'index.php' , |
---|
309 | 'item_name' => 'p' , |
---|
310 | 'allow_bookmark' => 1 , |
---|
311 | ) , |
---|
312 | ) , |
---|
313 | 'event' => array( |
---|
314 | array( |
---|
315 | 'name' => 'waiting' , |
---|
316 | 'category' => 'global' , |
---|
317 | 'title' => constant('_MI_XPRESS_NOTIFY_GLOBAL_WAITING') , |
---|
318 | 'caption' => constant('_MI_XPRESS_NOTIFY_GLOBAL_WAITINGCAP') , |
---|
319 | 'description' => constant('_MI_XPRESS_NOTIFY_GLOBAL_WAITINGCAP') , |
---|
320 | 'mail_template' => 'global_waiting' , |
---|
321 | 'mail_subject' => constant('_MI_XPRESS_NOTIFY_GLOBAL_WAITINGSBJ') , |
---|
322 | 'admin_only' => 1 , |
---|
323 | ) , |
---|
324 | array( |
---|
325 | 'name' => 'newpost' , |
---|
326 | 'category' => 'global' , |
---|
327 | 'title' => constant('_MI_XPRESS_NOTIFY_GLOBAL_NEWPOST') , |
---|
328 | 'caption' => constant('_MI_XPRESS_NOTIFY_GLOBAL_NEWPOSTCAP') , |
---|
329 | 'description' => constant('_MI_XPRESS_NOTIFY_GLOBAL_NEWPOSTCAP') , |
---|
330 | 'mail_template' => 'global_newpost' , |
---|
331 | 'mail_subject' => constant('_MI_XPRESS_NOTIFY_GLOBAL_NEWPOSTSBJ') , |
---|
332 | ) , |
---|
333 | array( |
---|
334 | 'name' => 'comment' , |
---|
335 | 'category' => 'global' , |
---|
336 | 'title' => constant('_MI_XPRESS_NOTIFY_GLOBAL_NEWCOMMENT') , |
---|
337 | 'caption' => constant('_MI_XPRESS_NOTIFY_GLOBAL_NEWCOMMENTCAP') , |
---|
338 | 'description' => constant('_MI_XPRESS_NOTIFY_GLOBAL_NEWCOMMENTCAP') , |
---|
339 | 'mail_template' => 'global_newcomment' , |
---|
340 | 'mail_subject' => constant('_MI_XPRESS_NOTIFY_GLOBAL_NEWCOMMENTSBJ') , |
---|
341 | ) , |
---|
342 | |
---|
343 | array( |
---|
344 | 'name' => 'newpost' , |
---|
345 | 'category' => 'category' , |
---|
346 | 'title' => constant('_MI_XPRESS_NOTIFY_CAT_NEWPOST') , |
---|
347 | 'caption' => constant('_MI_XPRESS_NOTIFY_CAT_NEWPOSTCAP') , |
---|
348 | 'description' => constant('_MI_XPRESS_NOTIFY_CAT_NEWPOSTCAP') , |
---|
349 | 'mail_template' => 'category_newpost' , |
---|
350 | 'mail_subject' => constant('_MI_XPRESS_NOTIFY_CAT_NEWPOSTSBJ') , |
---|
351 | ) , |
---|
352 | array( |
---|
353 | 'name' => 'comment' , |
---|
354 | 'category' => 'category' , |
---|
355 | 'title' => constant('_MI_XPRESS_NOTIFY_CAT_NEWCOMMENT') , |
---|
356 | 'caption' => constant('_MI_XPRESS_NOTIFY_CAT_NEWCOMMENTCAP') , |
---|
357 | 'description' => constant('_MI_XPRESS_NOTIFY_CAT_NEWCOMMENTCAP') , |
---|
358 | 'mail_template' => 'category_newcomment' , |
---|
359 | 'mail_subject' => constant('_MI_XPRESS_NOTIFY_CAT_NEWCOMMENTSBJ') , |
---|
360 | ) , |
---|
361 | |
---|
362 | array( |
---|
363 | 'name' => 'newpost' , |
---|
364 | 'category' => 'author' , |
---|
365 | 'title' => constant('_MI_XPRESS_NOTIFY_AUT_NEWPOST') , |
---|
366 | 'caption' => constant('_MI_XPRESS_NOTIFY_AUT_NEWPOSTCAP') , |
---|
367 | 'description' => constant('_MI_XPRESS_NOTIFY_AUT_NEWPOSTCAP') , |
---|
368 | 'mail_template' => 'author_newpost' , |
---|
369 | 'mail_subject' => constant('_MI_XPRESS_NOTIFY_AUT_NEWPOSTSBJ') , |
---|
370 | ) , |
---|
371 | array( |
---|
372 | 'name' => 'comment' , |
---|
373 | 'category' => 'author' , |
---|
374 | 'title' => constant('_MI_XPRESS_NOTIFY_AUT_NEWCOMMENT') , |
---|
375 | 'caption' => constant('_MI_XPRESS_NOTIFY_AUT_NEWCOMMENTCAP') , |
---|
376 | 'description' => constant('_MI_XPRESS_NOTIFY_AUT_NEWCOMMENTCAP') , |
---|
377 | 'mail_template' => 'author_newcomment' , |
---|
378 | 'mail_subject' => constant('_MI_XPRESS_NOTIFY_AUT_NEWCOMMENTSBJ') , |
---|
379 | ) , |
---|
380 | |
---|
381 | array( |
---|
382 | 'name' => 'comment' , |
---|
383 | 'category' => 'post' , |
---|
384 | 'title' => constant('_MI_XPRESS_NOTIFY_POST_NEWCOMMENT') , |
---|
385 | 'caption' => constant('_MI_XPRESS_NOTIFY_POST_NEWCOMMENTCAP') , |
---|
386 | 'description' => constant('_MI_XPRESS_NOTIFY_POST_NEWCOMMENTCAP') , |
---|
387 | 'mail_template' => 'post_newcomment' , |
---|
388 | 'mail_subject' => constant('_MI_XPRESS_NOTIFY_POST_NEWCOMMENTSBJ') , |
---|
389 | ) , |
---|
390 | ) , |
---|
391 | ) ; |
---|
392 | |
---|
393 | |
---|
394 | ?> |
---|