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 | |
---|
17 | include_once(SMILIES_PATH.'include/functions.inc.php'); |
---|
18 | include_once(SMILIES_PATH.'include/events.inc.php'); |
---|
19 | |
---|
20 | |
---|
21 | add_event_handler('init', 'init_smiliessupport'); |
---|
22 | |
---|
23 | if (defined('IN_ADMIN')) |
---|
24 | { |
---|
25 | add_event_handler('init', 'smiliessupport_action'); |
---|
26 | add_event_handler('get_admin_plugin_menu_links', 'smiliessupport_admin_menu'); |
---|
27 | } |
---|
28 | else if (!mobile_theme()) |
---|
29 | { |
---|
30 | add_event_handler('loc_after_page_header', 'add_smiliessupport', EVENT_HANDLER_PRIORITY_NEUTRAL+2); |
---|
31 | } |
---|
32 | |
---|
33 | add_event_handler('render_comment_content', 'SmiliesParse', EVENT_HANDLER_PRIORITY_NEUTRAL+10); |
---|
34 | add_event_handler('render_contact_content', 'SmiliesParse'); |
---|
35 | |
---|
36 | |
---|
37 | function init_smiliessupport() |
---|
38 | { |
---|
39 | global $conf; |
---|
40 | |
---|
41 | $conf['smiliessupport'] = safe_unserialize($conf['smiliessupport']); |
---|
42 | $conf['smiliessupport_ext'] = array('gif', 'jpg', 'png', 'GIF', 'JPG', 'PNG'); |
---|
43 | |
---|
44 | load_language('plugin.lang', SMILIES_PATH); |
---|
45 | } |
---|