-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathmain.inc.php
56 lines (44 loc) · 1.58 KB
/
main.inc.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
<?php
/*
Plugin Name: Smilies Support
Version: auto
Description: Allow add Smilies for comments and descriptions.
Plugin URI: auto
Author: Atadilo & P@t & Mistic
Has Settings: true
*/
defined('PHPWG_ROOT_PATH') or die('Hacking attempt!');
if (basename(dirname(__FILE__)) != 'SmiliesSupport')
{
add_event_handler('init', 'smiliessupport_error');
function smiliessupport_error()
{
global $page;
$page['errors'][] = 'Smilies Support folder name is incorrect, uninstall the plugin and rename it to "SmiliesSupport"';
}
return;
}
define('SMILIES_PATH', PHPWG_PLUGINS_PATH . 'SmiliesSupport/');
define('SMILIES_DIR', SMILIES_PATH . 'smilies/');
define('SMILIES_ADMIN', get_root_url() . 'admin.php?page=plugin-SmiliesSupport');
include_once(SMILIES_PATH.'include/functions.inc.php');
include_once(SMILIES_PATH.'include/events.inc.php');
add_event_handler('init', 'init_smiliessupport');
if (defined('IN_ADMIN'))
{
add_event_handler('init', 'smiliessupport_action');
add_event_handler('get_admin_plugin_menu_links', 'smiliessupport_admin_menu');
}
else if (!mobile_theme())
{
add_event_handler('loc_after_page_header', 'add_smiliessupport', EVENT_HANDLER_PRIORITY_NEUTRAL+2);
}
add_event_handler('render_comment_content', 'SmiliesParse', EVENT_HANDLER_PRIORITY_NEUTRAL+10);
add_event_handler('render_contact_content', 'SmiliesParse');
function init_smiliessupport()
{
global $conf;
$conf['smiliessupport'] = safe_unserialize($conf['smiliessupport']);
$conf['smiliessupport_ext'] = array('gif', 'jpg', 'png', 'GIF', 'JPG', 'PNG');
load_language('plugin.lang', SMILIES_PATH);
}