source: extensions/reply_to/main.inc.php @ 11375

Last change on this file since 11375 was 11325, checked in by mistic100, 13 years ago

correct regex, parse on notification email and admin page

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