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

Last change on this file since 26855 was 26075, checked in by mistic100, 10 years ago

update for Piwigo 2.6 + many code and logical cleaning

File size: 1.5 KB
RevLine 
[6298]1<?php
2/*
3Plugin Name: Smilies Support
[10986]4Version: auto
[6298]5Description: Allow add Smilies for comments and descriptions.
[23234]6Plugin URI: auto
[9683]7Author: Atadilo & P@t & Mistic
[3304]8*/
9
[26075]10defined('PHPWG_ROOT_PATH') or die('Hacking attempt!');
[3304]11
[26075]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');
[3304]17
[26075]18
[23234]19include_once(SMILIES_PATH.'include/functions.inc.php');
[26075]20include_once(SMILIES_PATH.'include/events.inc.php');
[9683]21
[26075]22
[23234]23add_event_handler('init', 'init_smiliessupport');
[26075]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);
[23204]36add_event_handler('render_contact_content', 'SmiliesParse');
[3304]37
[23234]38
39function 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}
Note: See TracBrowser for help on using the repository browser.