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