1 | <?php |
---|
2 | /* |
---|
3 | Plugin Name: Smilies Support |
---|
4 | Version: auto |
---|
5 | Description: Allow add Smilies 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('SMILIES_ID', basename(dirname(__FILE__))); |
---|
13 | define('SMILIES_PATH', PHPWG_PLUGINS_PATH . SMILIES_ID . '/'); |
---|
14 | define('SMILIES_DIR', SMILIES_PATH . 'smilies/'); |
---|
15 | define('SMILIES_ADMIN', get_root_url() . 'admin.php?page=plugin-' . SMILIES_ID); |
---|
16 | define('SMILIES_VERSION', 'auto'); |
---|
17 | |
---|
18 | |
---|
19 | include_once(SMILIES_PATH.'include/functions.inc.php'); |
---|
20 | include_once(SMILIES_PATH.'include/events.inc.php'); |
---|
21 | |
---|
22 | |
---|
23 | add_event_handler('init', 'init_smiliessupport'); |
---|
24 | |
---|
25 | if (defined('IN_ADMIN')) |
---|
26 | { |
---|
27 | add_event_handler('init', 'smiliessupport_action'); |
---|
28 | add_event_handler('get_admin_plugin_menu_links', 'smiliessupport_admin_menu'); |
---|
29 | } |
---|
30 | else |
---|
31 | { |
---|
32 | add_event_handler('loc_after_page_header', 'add_smiliessupport', EVENT_HANDLER_PRIORITY_NEUTRAL+2); |
---|
33 | } |
---|
34 | |
---|
35 | add_event_handler('render_comment_content', 'SmiliesParse', EVENT_HANDLER_PRIORITY_NEUTRAL+10); |
---|
36 | add_event_handler('render_contact_content', 'SmiliesParse'); |
---|
37 | |
---|
38 | |
---|
39 | function init_smiliessupport() |
---|
40 | { |
---|
41 | global $conf; |
---|
42 | |
---|
43 | include_once(SMILIES_PATH . 'maintain.inc.php'); |
---|
44 | $maintain = new SmiliesSupport_maintain(SMILIES_ID); |
---|
45 | $maintain->autoUpdate(SMILIES_VERSION, 'install'); |
---|
46 | |
---|
47 | $conf['smiliessupport'] = unserialize($conf['smiliessupport']); |
---|
48 | $conf['smiliessupport_ext'] = array('gif', 'jpg', 'png', 'GIF', 'JPG', 'PNG'); |
---|
49 | |
---|
50 | load_language('plugin.lang', SMILIES_PATH); |
---|
51 | } |
---|