Make WordPress Core


Ignore:
Timestamp:
11/30/2003 10:13:53 PM (21 years ago)
Author:
saxmatt
Message:

Made status dropdowns radio boxes, more moderation cleanups. Edit section now clean.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/wp-moderation.php

    r551 r560  
    5151    // check if comment moderation is turned on in the settings
    5252    // if not, just give a short note and stop
    53     if ('none' == get_settings("comment_moderation")) {
     53    if ('none' == get_settings('comment_moderation')) {
    5454        echo '<div class="wrap">
    5555        <p>Comment moderation has been turned off.</p>
     
    9999        die('<p>Your level is not high enough to moderate comments. Ask for a promotion from your <a href="mailto:$admin_email">blog admin</a>. :)</p>');
    100100    }
    101 
     101?>
     102<ul id="adminmenu2">
     103    <li><a href="edit.php">Latest Posts</a></li>
     104    <li><a href="edit-comments.php">Latest Comments</a></li>
     105    <li class="last"><a href="wp-moderation.php" class="current">Comments Awaiting Moderation</a></li>
     106</ul>
     107<?php
    102108    // check if comment moderation is turned on in the settings
    103109    // if not, just give a short note and stop
     
    130136        if ($ignored) {
    131137        if ($deleted == "1") {
    132             echo "1 comment left unchanged <br />\n";
    133         } else {
    134             echo "$approved comments left unchanged <br />\n";
     138            echo "1 comment unchanged <br />\n";
     139        } else {
     140            echo "$approved comments unchanged <br />\n";
    135141        }
    136142       
     
    142148   
    143149<div class="wrap">
    144 
    145     <?php
     150<?php
    146151$comments = $wpdb->get_results("SELECT * FROM $tablecomments WHERE comment_approved = '0'");
    147152
     
    149154    // list all comments that are waiting for approval
    150155    $file = basename(__FILE__);
    151     echo "The following comments wait for approval:<br /><br />";
    152     echo "<form name=\"approval\" action=\"$file\" method=\"post\">";
    153     echo "<input type=\"hidden\" name=\"action\" value=\"update\" />\n";
    154     echo "<ol id=\"comments\">\n";
    155 
     156?>
     157    <p>The following comments wait for approval:</p>
     158    <form name="approval" action="" method="post">
     159    <input type="hidden" name="action" value="update" />
     160    <ol id="comments">
     161<?php
    156162    foreach($comments as $comment) {
    157163    $comment_date = mysql2date(get_settings("date_format") . " @ " . get_settings("time_format"), $comment->comment_date);
    158164    $post_title = $wpdb->get_var("SELECT post_title FROM $tableposts WHERE ID='$comment->comment_post_ID'");
    159         $comment_text = stripslashes($comment->comment_content);
    160         $comment_text = str_replace('<trackback />', '', $comment_text);
    161         $comment_text = str_replace('<pingback />', '', $comment_text);
    162         $comment_text = convert_chars($comment_text);
    163         $comment_text = convert_bbcode($comment_text);
    164         $comment_text = convert_gmcode($comment_text);
    165         $comment_text = convert_smilies($comment_text);
    166         $comment_text = make_clickable($comment_text);
    167         $comment_text = balanceTags($comment_text,1);
    168         $comment_text = apply_filters('comment_text', $comment_text);
    169    
    170     echo "<li id=\"comment-$comment->comment_ID\">";
    171     echo "$comment_date -&gt; $post_title<br />";
    172     echo "<strong>$comment->comment_author ";
    173     echo "(<a href=\"mailto:$comment->comment_author_email\">$comment->comment_author_email</a> /";
    174     echo "<a href=\"$comment->comment_author_url\">$comment->comment_author_url</a>)</strong> ";
    175     echo "(IP: <a href=\"http://ws.arin.net/cgi-bin/whois.pl?queryinput=$comment->comment_author_IP\">$comment->comment_author_IP</a>)<br />";
    176     echo $comment_text;
    177     echo "<strong>Your action:</strong>";
    178     echo "&nbsp;&nbsp;<input type=\"radio\" name=\"comment[$comment->comment_ID]\" value=\"approve\" />&nbsp;approve";
    179     echo "&nbsp;&nbsp;<input type=\"radio\" name=\"comment[$comment->comment_ID]\" value=\"delete\" />&nbsp;delete";
    180     echo "&nbsp;&nbsp;<input type=\"radio\" name=\"comment[$comment->comment_ID]\" value=\"later\" checked=\"checked\" />&nbsp;later";
    181     echo "<br /><br />";
    182     echo "</li>\n";
     165   
     166    echo "\n\t<li id='comment-$comment->comment_ID'>";
     167    ?>
     168            <p><strong>Name:</strong> <?php comment_author() ?> <?php if ($comment->comment_author_email) { ?>| <strong>Email:</strong> <?php comment_author_email_link() ?> <?php } if ($comment->comment_author_email) { ?> | <strong>URI:</strong> <?php comment_author_url_link() ?> <?php } ?>| <strong>IP:</strong> <a href="http://ws.arin.net/cgi-bin/whois.pl?queryinput=<?php comment_author_IP() ?>"><?php comment_author_IP() ?></a></p>
     169<?php comment_text() ?>
     170<p><?php
     171echo "<a href=\"wp-post.php?action=editcomment&amp;comment=".$comment->comment_ID."\">Edit</a>";
     172                echo " | <a href=\"wp-post.php?action=deletecomment&amp;p=".$comment->comment_post_ID."&amp;comment=".$comment->comment_ID."\" onclick=\"return confirm('You are about to delete this comment by \'".$comment->comment_author."\'\\n  \'Cancel\' to stop, \'OK\' to delete.')\">Delete just this comment</a> | "; ?>Bulk action:
     173    <label><input type="radio" name="comment[$comment->comment_ID]" value="approve" /> Approve</label>
     174    <label><input type="radio" name="comment[$comment->comment_ID]" value="delete" /> Delete</label>
     175    <label><input type="radio" name="comment[$comment->comment_ID]" value="later" checked="checked" /> Do nothing</label>
     176
     177    </li>
     178<?php
    183179    }
    184    
    185     echo "</ol>\n";
    186     echo "<input type=\"submit\" name=\"submit\" value=\"Continue!\" class=\"search\" style=\"font-weight: bold;\" />\n";
    187     echo "</form>\n";
     180?>
     181    </ol>
     182    <input type="submit" name="submit" value="Moderate Comments" class="search" />
     183    </form>
     184<?php
    188185} else {
    189186    // nothing to approve
    190     echo "Currently there are no comments to be approved.<br />\n";
    191 }
    192 
    193     ?>
    194 
    195     <br />
     187    echo "Currently there are no comments to be approved.\n";
     188}
     189?>
     190
    196191</div>
    197192
     
    205200    <p><em>approve</em>: approves comment, so that it will be publically visible
    206201    <?php
    207         if ("1" == get_settings("comments_notify")) {
     202        if ('1' == get_settings('comments_notify')) {
    208203        echo "; the author of the post will be notified about the new comment on his post.</p>\n";
    209204        } else {
Note: See TracChangeset for help on using the changeset viewer.