assign('REPLYTO_PATH', REPLYTO_PATH); // comment form has different id if ( (isset($_GET['action']) AND $_GET['action'] == 'edit_comment') OR (isset($page['body_id']) AND $page['body_id'] == 'theCommentsPage') ) { $template->assign('replyto_form_name', 'editComment'); } else { $template->assign('replyto_form_name', 'addComment'); } // must check our location if (script_basename() == 'comments') /* COMMENTS page */ { if ( !is_a_guest() OR $conf['comments_forall'] ) { $template->set_prefilter('comments', 'replyto_add_link_comments_prefilter'); } } else if (script_basename() == 'picture') /* PICTURE page */ { add_event_handler('user_comment_insertion', 'replyto_parse_picture_mail'); if ( !is_a_guest() OR $conf['comments_forall'] ) { $template->set_prefilter('picture', 'replyto_add_link_prefilter'); } } else if /* ALBUM page */ ( script_basename() == 'index' AND isset($page['section']) AND isset($pwg_loaded_plugins['Comments_on_Albums']) AND $page['section'] == 'categories' AND isset($page['category']) ) { add_event_handler('user_comment_insertion', 'replyto_parse_album_mail'); if ( !is_a_guest() OR $conf['comments_forall'] ) { $template->set_prefilter('comments_on_albums', 'replyto_add_link_prefilter'); } } /* we come from comments.php page */ if ( !empty($_GET['reply_to']) and !empty($_GET['reply_to_a']) ) { $lang['Comment'].= ' '; } } /** * links to commentform on comments.php page */ function replyto_add_link_comments_prefilter($content, &$smarty) { global $template; $comments = $template->get_template_vars('comments'); if (!count($comments)) return $content; foreach ($comments as $tpl_var) { $replyto_links[ $tpl_var['ID'] ] = get_absolute_root_url().$tpl_var['U_PICTURE'].'&reply_to='.$tpl_var['ID'].'&reply_to_a='.$tpl_var['AUTHOR'].'#commentform'; } $template->assign('replyto_links', $replyto_links); // style $search[0] = '