author | Dan |
Tue, 13 Nov 2007 19:39:50 -0500 | |
changeset 6 | 3f66ec435f08 |
parent 5 | 6eea55374f5b |
child 7 | 37387f84fe25 |
permissions | -rwxr-xr-x |
0 | 1 |
<?php |
2 |
/* |
|
3 |
Plugin Name: Decir |
|
4 |
Plugin URI: javascript: // No URL yet, stay tuned! |
|
5 |
Description: Decir is an advanced bulletin board system (forum) for Enano. |
|
6 |
Author: Dan Fuhry |
|
7 |
Version: 0.1 |
|
8 |
Author URI: http://www.enanocms.org/ |
|
9 |
*/ |
|
10 |
||
11 |
/* |
|
12 |
* Decir |
|
13 |
* Version 0.1 |
|
14 |
* Copyright (C) 2007 Dan Fuhry |
|
15 |
* |
|
16 |
* This program is Free Software; you can redistribute and/or modify it under the terms of the GNU General Public License |
|
17 |
* as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. |
|
18 |
* |
|
19 |
* This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied |
|
20 |
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for details. |
|
21 |
*/ |
|
22 |
||
23 |
define('ENANO_DECIR_VERSION', '0.1'); |
|
24 |
define('DECIR_ROOT', ENANO_ROOT . '/decir'); |
|
25 |
||
26 |
$plugins->attachHook('acl_rule_init', 'decir_early_init($this, $session);'); |
|
27 |
$plugins->attachHook('base_classes_initted', ' |
|
28 |
$paths->add_page(Array( |
|
29 |
\'name\'=>\'Forum\', |
|
30 |
\'urlname\'=>\'Forum\', |
|
31 |
\'namespace\'=>\'Special\', |
|
32 |
\'special\'=>0,\'visible\'=>0,\'comments_on\'=>0,\'protected\'=>1,\'delvotes\'=>0,\'delvote_ips\'=>\'\', |
|
33 |
)); |
|
34 |
'); |
|
35 |
||
6 | 36 |
require( DECIR_ROOT . '/admincp/admin_base.php' ); |
37 |
||
0 | 38 |
function decir_early_init(&$paths, &$session) |
39 |
{ |
|
40 |
$paths->addAdminNode('Decir forum configuration', 'General settings', 'DecirGeneral'); |
|
5 | 41 |
$paths->nslist['DecirForum'] = $paths->nslist['Special'] . 'Forum/ViewForum/'; |
42 |
$paths->nslist['DecirPost'] = $paths->nslist['Special'] . 'Forum/Post/'; |
|
43 |
$paths->nslist['DecirTopic'] = $paths->nslist['Special'] . 'Forum/Topic/'; |
|
3
88b85b9b9272
What can I say? More progress. Mostly bugfixes and ACL stuff now. Which reminds me - don't use this release, there are quite a few access bugs in it right now.
Dan
parents:
2
diff
changeset
|
44 |
|
0 | 45 |
$session->register_acl_type('decir_see_forum', AUTH_ALLOW, 'See forum in index', Array('read'), 'DecirForum'); |
46 |
$session->register_acl_type('decir_view_forum', AUTH_ALLOW, 'View forum', Array('decir_see_forum'), 'DecirForum'); |
|
47 |
$session->register_acl_type('decir_post', AUTH_ALLOW, 'Post new topics', Array('decir_view_forum'), 'DecirForum'); |
|
48 |
$session->register_acl_type('decir_reply', AUTH_ALLOW, 'Reply to topics', Array('decir_post'), 'DecirTopic'); |
|
49 |
} |
|
50 |
||
51 |
function page_Special_Forum() |
|
52 |
{ |
|
53 |
global $db, $session, $paths, $template, $plugins; // Common objects |
|
54 |
||
55 |
if ( getConfig('decir_version') != ENANO_DECIR_VERSION || isset($_POST['do_install_finish']) ) |
|
56 |
{ |
|
6 | 57 |
chdir(DECIR_ROOT); |
0 | 58 |
require(DECIR_ROOT . '/install.php'); |
1
6f8b7c6fac02
Let's just say: major progress and still only 20% complete. So many changes I forgot to commit.
Dan
parents:
0
diff
changeset
|
59 |
return false; |
0 | 60 |
} |
61 |
||
62 |
$act = strtolower( ( $n = $paths->getParam(0) ) ? $n : 'Index' ); |
|
63 |
||
64 |
$curdir = getcwd(); |
|
65 |
chdir(DECIR_ROOT); |
|
66 |
||
67 |
switch($act) |
|
68 |
{ |
|
69 |
case 'index': |
|
70 |
default: |
|
71 |
require('forum_index.php'); |
|
72 |
break; |
|
73 |
case 'viewforum': |
|
74 |
require('viewforum.php'); |
|
75 |
break; |
|
76 |
case 'topic': |
|
77 |
case 'post': |
|
78 |
case 'viewtopic': |
|
79 |
require('viewtopic.php'); |
|
80 |
break; |
|
81 |
case 'new': |
|
82 |
require('posting.php'); |
|
83 |
break; |
|
84 |
} |
|
85 |
||
86 |
chdir($curdir); |
|
87 |
||
88 |
} |
|
89 |
||
90 |
?> |