source: extensions/bbcode_bar/main.inc.php @ 26382

Last change on this file since 26382 was 26076, checked in by mistic100, 10 years ago

update for Piwigo 2.6 + many code and logical cleaning

File size: 1.4 KB
Line 
1<?php 
2/*
3Plugin Name: BBCode Bar
4Version: auto
5Description: Allow use BBCode for comments and descriptions.
6Plugin URI: auto
7Author: Atadilo & P@t & Mistic
8*/
9
10defined('PHPWG_ROOT_PATH') or die('Hacking attempt!');
11
12define('BBCODE_ID' ,    basename(dirname(__FILE__)));
13define('BBCODE_PATH' ,    PHPWG_PLUGINS_PATH . BBCODE_ID . '/');
14define('BBCODE_ADMIN',    get_root_url() . 'admin.php?page=plugin-' . BBCODE_ID);
15define('BBCODE_VERSION',  'auto');
16
17
18include_once(BBCODE_PATH.'include/functions.inc.php');
19include_once(BBCODE_PATH.'include/events.inc.php');
20
21
22add_event_handler('init', 'init_bbcode_bar');
23
24if (defined('IN_ADMIN'))
25{
26  add_event_handler('get_admin_plugin_menu_links', 'bbcode_bar_admin_menu');
27}
28else
29{
30  add_event_handler('loc_after_page_header', 'add_bbcode_bar', EVENT_HANDLER_PRIORITY_NEUTRAL+1);
31}
32
33add_event_handler('render_comment_content', 'BBCodeParse');
34add_event_handler('render_contact_content', 'BBCodeParse');
35
36
37function init_bbcode_bar()
38{
39  global $conf;
40 
41  include_once(BBCODE_PATH . 'maintain.inc.php');
42  $maintain = new bbcode_bar_maintain(BBCODE_ID);
43  $maintain->autoUpdate(BBCODE_VERSION, 'install');
44 
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');
51}
Note: See TracBrowser for help on using the repository browser.