Ticket #2217: 2217.patch

File 2217.patch, 2.6 KB (added by skippy, 6 years ago)
  • edit-comments.php

     
    9292                 
    9393                <?php comment_text() ?> 
    9494 
    95         <p><?php _e('Posted'); echo ' '; comment_date('M j, g:i A');   
     95        <p><?php _e('Posted'); echo ' '; comment_date('M j, g:i A'); 
     96        echo ' <a href="' . get_permalink($comment->comment_post_ID) . '#comment-' . get_comment_ID() . '">View</a>'; 
    9697                        if ( current_user_can('edit_post', $comment->comment_post_ID) ) { 
    97                                 echo " | <a href=\"post.php?action=editcomment&amp;comment=".$comment->comment_ID."\">" . __('Edit Comment') . "</a>"; 
    98                                 echo " | <a href=\"post.php?action=deletecomment&amp;p=".$comment->comment_post_ID."&amp;comment=".$comment->comment_ID."\" onclick=\"return deleteSomething( 'comment', $comment->comment_ID, '" . sprintf(__("You are about to delete this comment by &quot;%s&quot;.\\n&quot;Cancel&quot; to stop, &quot;OK&quot; to delete."), wp_specialchars( $comment->comment_author, 1 ))  . "' );\">" . __('Delete Comment') . "</a> &#8212; "; 
     98                                echo " | <a href=\"post.php?action=editcomment&amp;comment=".$comment->comment_ID."\">" . __('Edit') . "</a>"; 
     99                                echo " | <a href=\"post.php?action=deletecomment&amp;p=".$comment->comment_post_ID."&amp;comment=".$comment->comment_ID."\" onclick=\"return deleteSomething( 'comment', $comment->comment_ID, '" . sprintf(__("You are about to delete this comment by &quot;%s&quot;.\\n&quot;Cancel&quot; to stop, &quot;OK&quot; to delete."), wp_specialchars( $comment->comment_author, 1 ))  . "' );\">" . __('Delete') . "</a> &#8212; "; 
    99100                        } // end if any comments to show 
    100101                        // Get post title 
    101                         if ( current_user_can('edit_post', $comment->comment_post_ID) ) { 
    102                                 $post_title = $wpdb->get_var("SELECT post_title FROM $wpdb->posts WHERE ID = $comment->comment_post_ID"); 
    103                                 $post_title = ('' == $post_title) ? "# $comment->comment_post_ID" : $post_title; 
    104                                 ?> <a href="post.php?action=edit&amp;post=<?php echo $comment->comment_post_ID; ?>"><?php printf(__('Edit Post &#8220;%s&#8221;'), stripslashes($post_title)); ?></a> 
    105                                 <?php } ?> 
    106                          | <a href="<?php echo get_permalink($comment->comment_post_ID); ?>"><?php _e('View Post') ?></a></p> 
     102                        $post_title = $wpdb->get_var("SELECT post_title FROM $wpdb->posts WHERE ID = $comment->comment_post_ID"); 
     103                        $post_title = ('' == $post_title) ? "# $comment->comment_post_ID" : $post_title; 
     104                        ?> 
     105                         Posted On <a href="<?php echo get_permalink($comment->comment_post_ID); ?>"><?php echo stripslashes($post_title) ?></a></p> 
    107106                </li> 
    108107 
    109108<?php } // end foreach ?>