1 | <?php |
---|
2 | /* |
---|
3 | Plugin Name: Smilies Support |
---|
4 | Version: auto |
---|
5 | Description: Allow add Smilies for comments and descriptions. |
---|
6 | Plugin URI: http://piwigo.org/ext/extension_view.php?eid=159 |
---|
7 | Author: Atadilo & P@t & Mistic |
---|
8 | */ |
---|
9 | |
---|
10 | if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!'); |
---|
11 | |
---|
12 | define('SMILIES_DIR' , basename(dirname(__FILE__))); |
---|
13 | define('SMILIES_PATH' , PHPWG_PLUGINS_PATH . SMILIES_DIR . '/'); |
---|
14 | |
---|
15 | include_once(SMILIES_PATH.'smiliessupport.inc.php'); |
---|
16 | |
---|
17 | add_event_handler('render_comment_content', 'SmiliesParse', 60); |
---|
18 | add_event_handler('loc_after_page_header', 'add_smiliessupport'); |
---|
19 | |
---|
20 | function add_smiliessupport() |
---|
21 | { |
---|
22 | global $page, $pwg_loaded_plugins; |
---|
23 | |
---|
24 | // if BBCodeBar is installed let him manage smilies |
---|
25 | if (isset($pwg_loaded_plugins['bbcode_bar'])) return; |
---|
26 | |
---|
27 | if (isset($page['body_id']) AND $page['body_id'] == 'thePicturePage') |
---|
28 | { |
---|
29 | $prefilter = 'picture'; |
---|
30 | } |
---|
31 | else if ( |
---|
32 | script_basename() == 'index' and isset($pwg_loaded_plugins['Comments_on_Albums']) |
---|
33 | and isset($page['section']) and $page['section'] == 'categories' and isset($page['category']) |
---|
34 | ) |
---|
35 | { |
---|
36 | $prefilter = 'comments_on_albums'; |
---|
37 | } |
---|
38 | else if (isset($_GET['/guestbook'])) |
---|
39 | { |
---|
40 | $prefilter = 'index'; |
---|
41 | } |
---|
42 | |
---|
43 | if (isset($prefilter)) |
---|
44 | { |
---|
45 | set_smiliessupport($prefilter); |
---|
46 | } |
---|
47 | } |
---|
48 | |
---|
49 | if (script_basename() == 'admin') |
---|
50 | { |
---|
51 | add_event_handler('get_admin_plugin_menu_links', 'smiliessupport_admin_menu'); |
---|
52 | function smiliessupport_admin_menu($menu) |
---|
53 | { |
---|
54 | array_push($menu, array( |
---|
55 | 'NAME' => 'Smilies Support', |
---|
56 | 'URL' => get_root_url().'admin.php?page=plugin-' . SMILIES_DIR |
---|
57 | )); |
---|
58 | return $menu; |
---|
59 | } |
---|
60 | } |
---|
61 | ?> |
---|