assign('REPLYTO_PATH', REPLYTO_PATH); $location = null; // 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'); } /* COMMENTS page */ if (script_basename() == 'comments') { if ( !is_a_guest() OR $conf['comments_forall'] ) { $comments = &$template->get_template_vars('comments'); if (!count($comments)) return; // generates urls to picture or albums with necessary url params foreach ($comments as $tpl_var) { $replyto_links[ $tpl_var['ID'] ] = get_absolute_root_url().$tpl_var['U_PICTURE'].'&rt='.$tpl_var['ID'].'&rta='.$tpl_var['AUTHOR'].'#commentform'; } $template->assign('replyto_links', $replyto_links); $template->set_prefilter('comments', 'replyto_add_link_comments_prefilter'); } } /* PICTURE page */ else if (script_basename() == 'picture') { $location = 'picture'; 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'); } } /* ALBUM page */ else if ( script_basename() == 'index' AND isset($page['section']) AND isset($pwg_loaded_plugins['Comments_on_Albums']) AND $page['section'] == 'categories' AND isset($page['category']) ) { $location = 'album'; 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['rt']) and !empty($_GET['rta']) ) { if ($location == 'picture') { $template->set_prefilter('picture', 'replyto_fillform_prefilter'); } else { $template->set_prefilter('comments_on_albums', 'replyto_fillform_prefilter'); } } } /** * add reply tag from values given in url */ function replyto_fillform_prefilter($content, &$smarty) { $search = '