[9682] | 1 | <?php |
---|
| 2 | /* |
---|
[6297] | 3 | Plugin Name: BBCode Bar |
---|
[10597] | 4 | Version: auto |
---|
[6297] | 5 | Description: Allow use BBCode for comments and descriptions. |
---|
[23278] | 6 | Plugin URI: auto |
---|
[9682] | 7 | Author: Atadilo & P@t & Mistic |
---|
[3609] | 8 | */ |
---|
| 9 | |
---|
[26076] | 10 | defined('PHPWG_ROOT_PATH') or die('Hacking attempt!'); |
---|
[3609] | 11 | |
---|
[26076] | 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 | define('BBCODE_VERSION', 'auto'); |
---|
[3609] | 16 | |
---|
[26076] | 17 | |
---|
| 18 | include_once(BBCODE_PATH.'include/functions.inc.php'); |
---|
| 19 | include_once(BBCODE_PATH.'include/events.inc.php'); |
---|
| 20 | |
---|
| 21 | |
---|
[3609] | 22 | add_event_handler('init', 'init_bbcode_bar'); |
---|
| 23 | |
---|
[26076] | 24 | if (defined('IN_ADMIN')) |
---|
[3609] | 25 | { |
---|
[26076] | 26 | add_event_handler('get_admin_plugin_menu_links', 'bbcode_bar_admin_menu'); |
---|
[3609] | 27 | } |
---|
[26076] | 28 | else |
---|
| 29 | { |
---|
| 30 | add_event_handler('loc_after_page_header', 'add_bbcode_bar', EVENT_HANDLER_PRIORITY_NEUTRAL+1); |
---|
| 31 | } |
---|
[3609] | 32 | |
---|
[26076] | 33 | add_event_handler('render_comment_content', 'BBCodeParse'); |
---|
| 34 | add_event_handler('render_contact_content', 'BBCodeParse'); |
---|
| 35 | |
---|
| 36 | |
---|
| 37 | function init_bbcode_bar() |
---|
[11295] | 38 | { |
---|
[26076] | 39 | global $conf; |
---|
[10983] | 40 | |
---|
[26076] | 41 | include_once(BBCODE_PATH . 'maintain.inc.php'); |
---|
| 42 | $maintain = new bbcode_bar_maintain(BBCODE_ID); |
---|
| 43 | $maintain->autoUpdate(BBCODE_VERSION, 'install'); |
---|
[15998] | 44 | |
---|
[26076] | 45 | $conf['bbcode_bar'] = unserialize($conf['bbcode_bar']); |
---|
| 46 | $conf['bbcode_bar_codes'] = array('b','i','u','s','p','center','right','quote','ul','ol','img','url','email','size','color'); |
---|
| 47 | |
---|
| 48 | load_language('plugin.lang', BBCODE_PATH); |
---|
| 49 | |
---|
| 50 | remove_event_handler('render_comment_content', 'render_comment_content'); |
---|
[9765] | 51 | } |
---|