WordPress.org

Make WordPress Core

Changeset 560


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

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

Location:
trunk/wp-admin
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/edit-comments.php

    r558 r560  
    3939<ul id="adminmenu2">
    4040    <li><a href="edit.php">Latest Posts</a></li>
    41     <li class="last"><a href="edit-comments.php" class="current">Latest Comments</a></li>
    42     <li><a href="wp-moderation.php">Comments Awaiting Moderation</a></li>
     41    <li><a href="edit-comments.php" class="current">Latest Comments</a></li>
     42    <li class="last"><a href="wp-moderation.php">Comments Awaiting Moderation</a></li>
    4343</ul>
    4444
     
    144144        echo '<ol>';
    145145        foreach ($comments as $comment) {
     146            $comment_status = wp_get_comment_status($comment->comment_ID);
     147            if ('unapproved' == $comment_status) {
     148                echo '<li class="unapproved" style="border-bottom: 1px solid #ccc;">';
     149            } else {
     150                echo '<li style="border-bottom: 1px solid #ccc;">';
     151            }
    146152        ?>     
    147         <li style="border-bottom: 1px solid #ccc;">
    148         <?php
    149             $comment_status = wp_get_comment_status($comment->comment_ID);
    150            
    151             if ("unapproved" == $comment_status) {
    152                 echo "<span class=\"unapproved\">";
    153             }
    154         ?>
    155         <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> <?php comment_author_IP() ?></p>
     153        <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>
    156154       
    157155        <?php comment_text() ?>
     
    161159                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</a> | ";
    162160            } // end if any comments to show
    163             ?> <a href="edit.php?p=<?php echo $comment->comment_post_ID; ?>">View Post</a></p>
    164         <?php
    165             if ("unapproved" == $comment_status) {
    166                 echo "</span>";
    167             }
    168         ?>
     161            ?> <a href="edit.php?p=<?php echo $comment->comment_post_ID; ?>">Edit Post</a></p>
    169162        </li>
    170163
  • trunk/wp-admin/edit.php

    r558 r560  
    3838<ul id="adminmenu2">
    3939    <li><a href="edit.php" class="current">Latest Posts</a></li>
    40     <li class="last"><a href="edit-comments.php">Latest Comments</a></li>
    41     <li><a href="wp-moderation.php">Comments Awaiting Moderation</a></li>
     40    <li><a href="edit-comments.php">Latest Comments</a></li>
     41    <li class="last"><a href="wp-moderation.php">Comments Awaiting Moderation</a></li>
    4242</ul>
    4343
  • trunk/wp-admin/wp-admin.css

    r546 r560  
    3636
    3737label {
    38     font-weight: bold;
     38    cursor: pointer;
    3939}
    4040
     
    198198}
    199199
     200#post label.selectit {
     201    background-color: #eee;
     202    padding: 0 2px;
     203    display: block;
     204    margin-bottom: 1px;
     205    border-bottom: 1px solid #666;
     206    font-size: 11px;
     207}
     208
     209#post label.selectit:hover {
     210    background-color: #dadada;
     211}
     212
     213label input {
     214    padding: 0;
     215    margin: 0;
     216}
     217
    200218#profile {
    201219    margin: 10px;
  • trunk/wp-admin/wp-edit.form.php

    r532 r560  
    77function selected($selected, $current) {
    88    if ($selected == $current) echo ' selected="selected"';
     9}
     10
     11function checked($checked, $current) {
     12    if ($checked == $current) echo ' checked="checked"';
    913}
    1014
     
    5862<input type="hidden" name="action" value='<?php echo $form_action . $form_extra ?>' />
    5963
    60 <?php if ($action != "editcomment") {
     64<?php if ($action != 'editcomment') {
    6165  // this is for everything but comment editing
    6266?>
     
    8084    </div>
    8185    <div id="poststatusdiv">
    82         <label for="post_status"><a href="http://wordpress.org/docs/reference/post/#post_status" title="Help on post status">Post
    83         Status</a>:</label>
    84         <br />         
    85         <select name="post_status" id="post_status">
    86             <option value="publish"<?php selected($post_status, 'publish'); ?>>Publish</option>
    87             <option value="draft"<?php selected($post_status, 'draft'); ?>>Draft</option>
    88             <option value="private"<?php selected($post_status, 'private'); ?>>Private</option>
    89         </select>
     86        <a href="http://wordpress.org/docs/reference/post/#post_status" title="Help on post status">Post
     87        Status</a>:
     88        <label for="post_status_publish" class="selectit"><input id="post_status_publish" name="post_status" type="radio" value="publish" <?php checked($post_status, 'publish'); ?> /> Publish</label>
     89        <label for="post_status_draft" class="selectit"><input id="post_status_draft" name="post_status" type="radio" value="draft" <?php checked($post_status, 'draft'); ?> /> Draft</label>
     90        <label for="post_status_private" class="selectit"><input id="post_status_private" name="post_status" type="radio" value="private" <?php checked($post_status, 'private'); ?> /> Private</label>
    9091    </div>
    9192    <div id="commentstatusdiv">
    92         <label for="comment_status"><a href="http://wordpress.org/docs/reference/post/#comments" title="Help on comment status">Comments</a>:</label>
    93         <br />
    94         <select name="comment_status" id="comment_status">
    95             <option value="open"<?php selected($comment_status, 'open'); ?>>Open</option>
    96             <option value="closed"<?php selected($comment_status, 'closed'); ?>>Closed</option>
    97         </select>
     93        <a href="http://wordpress.org/docs/reference/post/#comments" title="Help on comment status">Comments</a>:
     94        <label for="comment_status_open" class="selectit"><input id="comment_status_open" name="comment_status" type="radio" value="open" <?php checked($comment_status, 'open'); ?> /> Open</label>
     95      <label for="comment_status_closed" class="selectit"><input id="comment_status_closed" name="comment_status" type="radio" value="closed" <?php checked($comment_status, 'closed'); ?> />
     96      Closed</label>
    9897    </div>
    9998    <div id="pingstatusdiv">
    100         <label for="ping_status"><a href="http://wordpress.org/docs/reference/post/#pings" title="Help on ping status">Pings</a>:</label>       
    101         <br /> 
    102         <select name="ping_status" id="ping_status">
    103             <option value="open"<?php selected($ping_status, 'open'); ?>>Open</option>
    104             <option value="closed"<?php selected($ping_status, 'closed'); ?>>Closed</option>
    105         </select>
     99        <a href="http://wordpress.org/docs/reference/post/#pings" title="Help on ping status">Pings</a>:
     100        <label for="ping_status_open" class="selectit"><input id="ping_status_open" name="ping_status" type="radio" value="open"<?php checked($ping_status, 'open'); ?> /> Open</label>
     101        <label for="ping_status_closed" class="selectit"><input id="ping_status_closed" name="ping_status" type="radio" value="closed" <?php checked($ping_status, 'closed'); ?> /> Closed</label>
     102
    106103    </div>
    107104    <div id="postpassworddiv">
     
    111108        <input name="post_password" type="text" id="post_password" value="<?php echo $post_password ?>" />
    112109    </div>
    113 <br clear="all" />
     110<br style="clear: both" />
    114111<?php
    115112
     
    149146if ($action != 'editcomment') {
    150147?>
    151 <p><label for="excerpt"><a href="http://wordpress.org/docs/reference/post/#excerpt" title="Help with excerpts">Excerpt</a>:</label>
     148<p><a href="http://wordpress.org/docs/reference/post/#excerpt" title="Help with excerpts">Excerpt</a>:
    152149<br />
    153150<textarea rows="3" cols="40" style="width:100%" name="excerpt" tabindex="4" wrap="virtual" id="excerpt"><?php echo $excerpt ?></textarea></p>
  • 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 {
  • trunk/wp-admin/wp-post.php

    r546 r560  
    322322
    323323        // pingWeblogs($blog_ID);
    324 
    325         header ('Location: ' . $HTTP_SERVER_VARS['HTTP_REFERER']);
     324        $sendback = $HTTP_SERVER_VARS['HTTP_REFERER'];
     325        if (strstr($sendback, 'wp-post')) $sendback = $siteurl .'/wp-admin/wp-post.php';
     326        header ('Location: ' . $sendback);
    326327
    327328        break;
     
    576577                        $draft->post_title = stripslashes($draft->post_title);
    577578                        if ($draft->post_title == '')
    578                             $draft->post_title = 'post-'.$draft->ID;
     579                            $draft->post_title = 'Post #'.$draft->ID;
    579580                        echo "<a href='wp-post.php?action=edit&amp;post=$draft->ID' title='Edit this draft'>$draft->post_title</a>";
    580581                        ++$i;
Note: See TracChangeset for help on using the changeset viewer.