Changeset 2165
- Timestamp:
- 01/31/05 04:22:01 (4 years ago)
- Files:
-
- trunk/wp-admin/edit-form-comment.php (modified) (3 diffs)
- trunk/wp-admin/post.php (modified) (3 diffs)
- trunk/wp-content/themes/default/comments.php (modified) (1 diff)
- trunk/wp-includes/comment-functions.php (modified) (4 diffs)
- trunk/wp-rdf.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/wp-admin/edit-form-comment.php
r1631 r2165 1 1 <?php 2 3 2 $submitbutton_text = __('Edit Comment »'); 4 3 $toprow_title = sprintf(__('Editing Comment # %s'), $commentdata['comment_ID']); … … 6 5 $form_extra = "' />\n<input type='hidden' name='comment_ID' value='$comment' />\n<input type='hidden' name='comment_post_ID' value='".$commentdata["comment_post_ID"]; 7 6 ?> 8 <div class="wrap">9 7 10 8 <form name="post" action="post.php" method="post" id="post"> 9 <div class="wrap"> 11 10 <input type="hidden" name="user_ID" value="<?php echo $user_ID ?>" /> 12 11 <input type="hidden" name="action" value='<?php echo $form_action . $form_extra ?>' /> … … 60 59 </p> 61 60 61 </div> 62 62 63 <?php 63 <div class="wrap"> 64 <h2><?php _e('Advanced'); ?></h2> 64 65 66 <table width="100%" cellspacing="2" cellpadding="5" class="editform"> 67 <tr> 68 <th scope="row" valign="top"><?php _e('Comment Status') ?>:</th> 69 <td><label for="comment_status_approved" class="selectit"><input id="comment_status_approved" name="comment_status" type="radio" value="1" <?php checked($comment_status, '1'); ?> /> <?php _e('Approved') ?></label><br /> 70 <label for="comment_status_moderated" class="selectit"><input id="comment_status_moderated" name="comment_status" type="radio" value="0" <?php checked($comment_status, '0'); ?> /> <?php _e('Moderated') ?></label><br /> 71 <label for="comment_status_spam" class="selectit"><input id="comment_status_spam" name="comment_status" type="radio" value="spam" <?php checked($comment_status, 'spam'); ?> /> <?php _e('Spam') ?></label></td> 72 </tr> 65 73 66 // if the level is 5+, allow user to edit the timestamp - not on 'new post' screen though 67 // if (($user_level > 4) && ($action != "post")) 68 if ($user_level > 4) { 69 touch_time(($action == 'edit')); 70 } 71 ?> 74 <?php if ($user_level > 4) : ?> 75 <tr> 76 <th scope="row"><?php _e('Edit time'); ?>:</th> 77 <td><?php touch_time(($action == 'edit')); ?></td> 78 </tr> 79 <?php endif; ?> 80 81 <tr> 82 <th scope="row"><?php _e('Delete'); ?>:</th> 83 <td><p><a class="delete" href="post.php?action=confirmdeletecomment&noredir=true&comment=<?php echo $commentdata['comment_ID']; ?>&p=<?php echo $commentdata['comment_post_ID']; ?>"><?php _e('Delete comment') ?></a></p></td> 84 </tr> 85 </table> 86 87 </div> 72 88 73 89 </form> 74 <p><a class="delete" href="post.php?action=confirmdeletecomment&noredir=true&comment=<?php echo $commentdata['comment_ID']; ?>&p=<?php echo $commentdata['comment_post_ID']; ?>"><?php _e('Delete comment') ?></a></p>75 </div>trunk/wp-admin/post.php
r2122 r2165 430 430 $content = format_to_edit($content); 431 431 $content = apply_filters('comment_edit_pre', $content); 432 433 $comment_status = $commentdata['comment_approved']; 432 434 433 435 include('edit-form-comment.php'); … … 586 588 $newcomment_author_email = $_POST['newcomment_author_email']; 587 589 $newcomment_author_url = $_POST['newcomment_author_url']; 590 $comment_status = $_POST['comment_status']; 588 591 589 592 if (!user_can_edit_post_comments($user_ID, $comment_post_ID)) { … … 613 616 comment_author = '$newcomment_author', 614 617 comment_author_email = '$newcomment_author_email', 618 comment_approved = '$comment_status', 615 619 comment_author_url = '$newcomment_author_url'".$datemodif." 616 620 WHERE comment_ID = $comment_ID" trunk/wp-content/themes/default/comments.php
r2135 r2165 28 28 29 29 <li class="<?php echo $oddcomment; ?>" id="comment-<?php comment_ID() ?>"> 30 <cite><?php comment_author_link() ?></cite> Says:<br /> 31 <!--<small class="commentmetadata"><a href="#comment-<?php comment_ID() ?>" title="<?php comment_date('l, F jS, Y') ?> at <?php comment_time() ?>"><?php /* $entry_datetime = abs(strtotime($post->post_date)); $comment_datetime = abs(strtotime($comment->comment_date)); echo time_since($entry_datetime, $comment_datetime) */ ?></a> after publication. <?php edit_comment_link('e','',''); ?></small>--> 30 <cite><?php comment_author_link() ?></cite> Says: 31 <?php if ($comment->comment_approved == '0') : ?> 32 <em>Your comment is awaiting moderation.</em> 33 <?php endif; ?> 34 <br /> 35 36 37 32 38 <small class="commentmetadata"><a href="#comment-<?php comment_ID() ?>" title=""><?php comment_date('F jS, Y') ?> at <?php comment_time() ?></a> <?php edit_comment_link('e','',''); ?></small> 33 39 trunk/wp-includes/comment-functions.php
r2144 r2165 8 8 if ( is_single() || is_page() || $withcomments ) : 9 9 $req = get_settings('require_name_email'); 10 $comment_author = isset($_COOKIE['comment_author_'.COOKIEHASH]) ? trim(stripslashes($_COOKIE['comment_author_'.COOKIEHASH])) : '';10 $comment_author = isset($_COOKIE['comment_author_'.COOKIEHASH]) ? trim(stripslashes($_COOKIE['comment_author_'.COOKIEHASH])) : ''; 11 11 $comment_author_email = isset($_COOKIE['comment_author_email_'.COOKIEHASH]) ? trim(stripslashes($_COOKIE['comment_author_email_'.COOKIEHASH])) : ''; 12 12 $comment_author_url = isset($_COOKIE['comment_author_url_'.COOKIEHASH]) ? trim(stripslashes($_COOKIE['comment_author_url_'.COOKIEHASH])) : ''; 13 if ( empty($comment_author) ) { 13 14 $comments = $wpdb->get_results("SELECT * FROM $wpdb->comments WHERE comment_post_ID = '$post->ID' AND comment_approved = '1' ORDER BY comment_date"); 15 } else { 16 $author_db = addslashes($comment_author); 17 $email_db = addslashes($comment_author_email); 18 $comments = $wpdb->get_results("SELECT * FROM $wpdb->comments WHERE comment_post_ID = '$post->ID' AND ( comment_approved = '1' OR ( comment_author = '$author_db' AND comment_author_email = '$email_db' AND comment_approved = '0' ) ) ORDER BY comment_date"); 19 } 14 20 15 21 if ( file_exists( TEMPLATEPATH . '/comments.php') ) … … 662 668 } 663 669 $notify_message .= get_permalink($comment->comment_post_ID) . '#comments'; 664 $notify_message .= "\r\n\r\nTo delete this comment , visit:" . get_settings('siteurl') . "/wp-admin/post.php?action=confirmdeletecomment&p=".$comment->comment_post_ID."&comment=$comment_id";670 $notify_message .= "\r\n\r\nTo delete this comment:\r\n" . get_settings('siteurl') . "/wp-admin/post.php?action=confirmdeletecomment&p=".$comment->comment_post_ID."&comment=$comment_id"; 665 671 666 672 if ('' == $comment->comment_author_email || '' == $comment->comment_author) { … … 733 739 return false; // Check # of external links 734 740 735 // Comment whitelisting:736 if ( 1 == get_settings('comment_whitelist')) {737 if ( 'trackback' == $comment_type || 'pingback' == $comment_type ) { // check if domain is in blogroll738 $uri = parse_url($url);739 $domain = $uri['host'];740 $in_blogroll = $wpdb->get_var("SELECT link_id FROM $wpdb->links WHERE link_url LIKE ('%$domain%') LIMIT 1");741 if ( $in_blogroll )742 return true;743 } elseif( $author != '' && $email != '' ) {744 $ok_to_comment = $wpdb->get_var("SELECT comment_approved FROM $wpdb->comments WHERE comment_author = '$author' AND comment_author_email = '$email' and comment_approved = '1' ");745 if ( 1 == $ok_to_comment && false === strpos( $email, get_settings('moderation_keys')) )746 return true;747 else748 return false;749 } else {750 return false;751 }752 }753 754 741 $mod_keys = trim( get_settings('moderation_keys') ); 755 742 if ('' == $mod_keys ) … … 776 763 } 777 764 765 // Comment whitelisting: 766 if ( 1 == get_settings('comment_whitelist')) { 767 if ( 'trackback' == $comment_type || 'pingback' == $comment_type ) { // check if domain is in blogroll 768 $uri = parse_url($url); 769 $domain = $uri['host']; 770 if ( $wpdb->get_var("SELECT link_id FROM $wpdb->links WHERE link_url LIKE ('%$domain%') LIMIT 1") ) 771 return true; 772 } elseif( $author != '' && $email != '' ) { 773 $ok_to_comment = $wpdb->get_var("SELECT comment_approved FROM $wpdb->comments WHERE comment_author = '$author' AND comment_author_email = '$email' and comment_approved = '1' "); 774 if ( 1 == $ok_to_comment && false === strpos( $email, get_settings('moderation_keys')) ) 775 return true; 776 else 777 return false; 778 } else { 779 return false; 780 } 781 } 782 778 783 return true; 779 784 } trunk/wp-rdf.php
r2068 r2165 44 44 <link><?php permalink_single_rss() ?></link> 45 45 <dc:date><?php echo mysql2date('Y-m-d\TH:i:s\Z', $post->post_date_gmt); ?></dc:date> 46 <dc:creator><?php the_author() ?> (mailto:<?php the_author_email() ?>)</dc:creator>46 <dc:creator><?php the_author() ?></dc:creator> 47 47 <?php the_category_rss('rdf') ?> 48 48 <?php if (get_settings('rss_use_excerpt')) : ?>
