1 | <?php |
---|
2 | /* |
---|
3 | Plugin Name: BBCode Bar |
---|
4 | Version: auto |
---|
5 | Description: Allow use BBCode for comments and descriptions. |
---|
6 | Plugin URI: auto |
---|
7 | Author: Atadilo & P@t & Mistic |
---|
8 | */ |
---|
9 | |
---|
10 | defined('PHPWG_ROOT_PATH') or die('Hacking attempt!'); |
---|
11 | |
---|
12 | define('BBCODE_ID' , basename(dirname(__FILE__))); |
---|
13 | define('BBCODE_PATH' , PHPWG_PLUGINS_PATH . BBCODE_ID . '/'); |
---|
14 | define('BBCODE_ADMIN', get_root_url() . 'admin.php?page=plugin-' . BBCODE_ID); |
---|
15 | |
---|
16 | include_once(BBCODE_PATH.'include/functions.inc.php'); |
---|
17 | include_once(BBCODE_PATH.'include/events.inc.php'); |
---|
18 | |
---|
19 | |
---|
20 | add_event_handler('init', 'init_bbcode_bar'); |
---|
21 | |
---|
22 | if (defined('IN_ADMIN')) |
---|
23 | { |
---|
24 | add_event_handler('get_admin_plugin_menu_links', 'bbcode_bar_admin_menu'); |
---|
25 | } |
---|
26 | else |
---|
27 | { |
---|
28 | add_event_handler('loc_after_page_header', 'add_bbcode_bar', EVENT_HANDLER_PRIORITY_NEUTRAL+1); |
---|
29 | } |
---|
30 | |
---|
31 | add_event_handler('render_comment_content', 'BBCodeParse'); |
---|
32 | add_event_handler('render_contact_content', 'BBCodeParse'); |
---|
33 | |
---|
34 | |
---|
35 | function init_bbcode_bar() |
---|
36 | { |
---|
37 | global $conf; |
---|
38 | |
---|
39 | $conf['bbcode_bar'] = safe_unserialize($conf['bbcode_bar']); |
---|
40 | $conf['bbcode_bar_codes'] = array('b','i','u','s','p','center','right','quote','ul','ol','img','url','email','size','color'); |
---|
41 | |
---|
42 | load_language('plugin.lang', BBCODE_PATH); |
---|
43 | |
---|
44 | remove_event_handler('render_comment_content', 'render_comment_content'); |
---|
45 | } |
---|