source: extensions/SmiliesSupport/main.inc.php @ 26873

Last change on this file since 26873 was 26075, checked in by mistic100, 11 years ago

update for Piwigo 2.6 + many code and logical cleaning

File size: 1.5 KB
Line 
1<?php
2/*
3Plugin Name: Smilies Support
4Version: auto
5Description: Allow add Smilies for comments and descriptions.
6Plugin URI: auto
7Author: Atadilo & P@t & Mistic
8*/
9
10defined('PHPWG_ROOT_PATH') or die('Hacking attempt!');
11
12define('SMILIES_ID',      basename(dirname(__FILE__)));
13define('SMILIES_PATH',    PHPWG_PLUGINS_PATH . SMILIES_ID . '/');
14define('SMILIES_DIR',     SMILIES_PATH . 'smilies/');
15define('SMILIES_ADMIN',   get_root_url() . 'admin.php?page=plugin-' . SMILIES_ID);
16define('SMILIES_VERSION', 'auto');
17
18
19include_once(SMILIES_PATH.'include/functions.inc.php');
20include_once(SMILIES_PATH.'include/events.inc.php');
21
22
23add_event_handler('init', 'init_smiliessupport');
24
25if (defined('IN_ADMIN'))
26{
27  add_event_handler('init', 'smiliessupport_action');
28  add_event_handler('get_admin_plugin_menu_links', 'smiliessupport_admin_menu');
29}
30else
31{
32  add_event_handler('loc_after_page_header', 'add_smiliessupport', EVENT_HANDLER_PRIORITY_NEUTRAL+2);
33}
34
35add_event_handler('render_comment_content', 'SmiliesParse', EVENT_HANDLER_PRIORITY_NEUTRAL+10);
36add_event_handler('render_contact_content', 'SmiliesParse');
37
38
39function 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}
Note: See TracBrowser for help on using the repository browser.