[11252] | 1 | <?php |
---|
| 2 | /* |
---|
| 3 | Plugin Name: Reply To |
---|
| 4 | Version: auto |
---|
| 5 | Description: This plugin allows you to add Twitter-like reply links to comments. |
---|
| 6 | Plugin URI: http://piwigo.org/ext/extension_view.php?eid= |
---|
| 7 | Author: Mistic |
---|
| 8 | Author URI: http://www.strangeplanet.fr |
---|
| 9 | */ |
---|
| 10 | |
---|
| 11 | if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!'); |
---|
| 12 | |
---|
| 13 | global $page; |
---|
| 14 | |
---|
| 15 | define('REPLYTO_DIR' , basename(dirname(__FILE__))); |
---|
| 16 | define('REPLYTO_PATH' , PHPWG_PLUGINS_PATH . REPLYTO_DIR . '/'); |
---|
| 17 | |
---|
| 18 | include_once(REPLYTO_PATH.'reply_to.inc.php'); |
---|
| 19 | load_language('plugin.lang', REPLYTO_PATH); |
---|
| 20 | |
---|
| 21 | // add link and parse on picture page |
---|
| 22 | if (script_basename() == 'picture') |
---|
| 23 | { |
---|
| 24 | add_event_handler('loc_begin_picture', 'replyto_add_link'); |
---|
| 25 | } |
---|
| 26 | // parse on comments page (picture section) |
---|
| 27 | else if (script_basename() == 'comments' AND !isset($_GET['display_mode'])) |
---|
| 28 | { |
---|
[11299] | 29 | add_event_handler('render_comment_content', 'replyto_parse_picture', 60); |
---|
[11252] | 30 | } |
---|
[11325] | 31 | // parse comment admin side (picture section) |
---|
| 32 | else if (script_basename() == 'admin' AND isset($_GET['page']) AND $_GET['page'] == 'comments' AND ( !isset($_GET['section']) OR $_GET['section'] == 'pictures' ) ) |
---|
| 33 | { |
---|
| 34 | add_event_handler('render_comment_content', 'replyto_parse_picture', 60); |
---|
| 35 | } |
---|
[11252] | 36 | // add link and parse on album page (compatibility with Comment on Albums) |
---|
| 37 | else if (script_basename() == 'index') |
---|
| 38 | { |
---|
| 39 | add_event_handler('loc_begin_index', 'replyto_add_link'); |
---|
| 40 | } |
---|
| 41 | // parse on comments page (album section) |
---|
| 42 | else if (script_basename() == 'comments' AND $_GET['display_mode'] == 'albums') |
---|
| 43 | { |
---|
[11299] | 44 | add_event_handler('render_comment_content', 'replyto_parse_album', 60); |
---|
[11252] | 45 | } |
---|
[11325] | 46 | // parse comment admin side (album section) |
---|
| 47 | else if (script_basename() == 'admin' AND isset($_GET['page']) AND $_GET['page'] == 'comments' AND $_GET['section'] == 'albums') |
---|
| 48 | { |
---|
| 49 | add_event_handler('render_comment_content', 'replyto_parse_album', 60); |
---|
| 50 | } |
---|
[11252] | 51 | |
---|
| 52 | ?> |
---|