]>
Commit | Line | Data |
---|---|---|
e98b5a51 BM |
1 | <?php |
2 | define('UPATH', dirname(__FILE__)); | |
3 | require_once "config.php"; | |
e010b54c | 4 | if (!defined('BASE_URL')) die("You need to define BASE_URL in config.php (see config.php.sample for documentation)"); |
55fd88eb | 5 | require_once "Classes/class-hook.php"; |
c4f272ad BM |
6 | if (!is_dir(UPATH . "/vendor")) |
7 | die("The vendor/ directory is missing. Most likely the admin forgot to run 'composer install'\n"); | |
e98b5a51 BM |
8 | require_once UPATH . '/vendor/autoload.php'; |
9 | require_once "connection.php"; | |
62d4ea03 VP |
10 | require_once "misc/strings.php"; |
11 | require_once "misc/user-lookup-misc.php"; | |
e98b5a51 BM |
12 | require_once "Classes/class-log.php"; |
13 | require_once "Classes/class-message.php"; | |
14 | require_once "Classes/class-rpc.php"; | |
55fd88eb | 15 | require_once "plugins.php"; |
1e6ffd06 | 16 | |
c9c3cd87 BM |
17 | function show_nick_only($str) |
18 | { | |
19 | $x = strpos($str, "!"); | |
20 | if ($x !== false) | |
21 | $str = substr($str, 0, $x); | |
22 | return $str; | |
23 | } | |
24 | ||
69f605af BM |
25 | $pages = Array( |
26 | "Overview" => "", | |
27 | "Users" => "users", | |
28 | "Channels" => "channels", | |
29 | "Servers" => "servers", | |
30 | "Server Bans" => "server_bans.php", | |
31 | "Spamfilter" => "spamfilter.php", | |
32 | "News" => "news.php", | |
33 | ); | |
90dc8f2b VP |
34 | |
35 | ||
36 | Hook::run(HOOKTYPE_NAVBAR, $pages); | |
37 | ||
38 | /* Example to add new menu item: | |
90dc8f2b VP |
39 | * |
40 | * class MyPlugin | |
41 | * { | |
42 | * | |
55fd88eb VP |
43 | * function __construct() |
44 | * { | |
45 | * Hook::func(HOOKTYPE_NAVBAR, [$this, 'add_menu']) | |
46 | * } | |
90dc8f2b | 47 | * |
55fd88eb VP |
48 | * function add_menu(&$pages) // this should pass by reference (using the & prefix) |
49 | * { | |
50 | * $page_name = "My New Page"; | |
51 | * $page_link = "link/to/page.php"; | |
52 | * $pages[$page_name] = $page_link; | |
53 | * } | |
90dc8f2b VP |
54 | * } |
55 | */ |