[6298] | 1 | <?php |
---|
| 2 | /* |
---|
| 3 | Plugin Name: Smilies Support |
---|
[10986] | 4 | Version: auto |
---|
[6298] | 5 | Description: Allow add Smilies for comments and descriptions. |
---|
[23234] | 6 | Plugin URI: auto |
---|
[9683] | 7 | Author: Atadilo & P@t & Mistic |
---|
[3304] | 8 | */ |
---|
| 9 | |
---|
[26075] | 10 | defined('PHPWG_ROOT_PATH') or die('Hacking attempt!'); |
---|
[3304] | 11 | |
---|
[26075] | 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'); |
---|
[3304] | 17 | |
---|
[26075] | 18 | |
---|
[23234] | 19 | include_once(SMILIES_PATH.'include/functions.inc.php'); |
---|
[26075] | 20 | include_once(SMILIES_PATH.'include/events.inc.php'); |
---|
[9683] | 21 | |
---|
[26075] | 22 | |
---|
[23234] | 23 | add_event_handler('init', 'init_smiliessupport'); |
---|
[26075] | 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 | } |
---|
[27208] | 30 | else if (!mobile_theme()) |
---|
[26075] | 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); |
---|
[23204] | 36 | add_event_handler('render_contact_content', 'SmiliesParse'); |
---|
[3304] | 37 | |
---|
[23234] | 38 | |
---|
| 39 | function init_smiliessupport() |
---|
| 40 | { |
---|
| 41 | global $conf; |
---|
| 42 | |
---|
[26075] | 43 | include_once(SMILIES_PATH . 'maintain.inc.php'); |
---|
| 44 | $maintain = new SmiliesSupport_maintain(SMILIES_ID); |
---|
| 45 | $maintain->autoUpdate(SMILIES_VERSION, 'install'); |
---|
| 46 | |
---|
[23234] | 47 | $conf['smiliessupport'] = unserialize($conf['smiliessupport']); |
---|
[26075] | 48 | $conf['smiliessupport_ext'] = array('gif', 'jpg', 'png', 'GIF', 'JPG', 'PNG'); |
---|
[23234] | 49 | |
---|
| 50 | load_language('plugin.lang', SMILIES_PATH); |
---|
| 51 | } |
---|