Made status dropdowns radio boxes, more moderation cleanups. Edit section now clean.
git-svn-id: http://svn.automattic.com/wordpress/trunk@560 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
a5ab0fc858
commit
099a329763
|
@ -38,8 +38,8 @@ ob_start();
|
|||
?>
|
||||
<ul id="adminmenu2">
|
||||
<li><a href="edit.php">Latest Posts</a></li>
|
||||
<li class="last"><a href="edit-comments.php" class="current">Latest Comments</a></li>
|
||||
<li><a href="wp-moderation.php">Comments Awaiting Moderation</a></li>
|
||||
<li><a href="edit-comments.php" class="current">Latest Comments</a></li>
|
||||
<li class="last"><a href="wp-moderation.php">Comments Awaiting Moderation</a></li>
|
||||
</ul>
|
||||
|
||||
<div class="wrap">
|
||||
|
@ -143,16 +143,14 @@ echo $comments_nav_bar;
|
|||
if ($comments) {
|
||||
echo '<ol>';
|
||||
foreach ($comments as $comment) {
|
||||
?>
|
||||
<li style="border-bottom: 1px solid #ccc;">
|
||||
<?php
|
||||
$comment_status = wp_get_comment_status($comment->comment_ID);
|
||||
|
||||
if ("unapproved" == $comment_status) {
|
||||
echo "<span class=\"unapproved\">";
|
||||
if ('unapproved' == $comment_status) {
|
||||
echo '<li class="unapproved" style="border-bottom: 1px solid #ccc;">';
|
||||
} else {
|
||||
echo '<li style="border-bottom: 1px solid #ccc;">';
|
||||
}
|
||||
?>
|
||||
<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>
|
||||
<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>
|
||||
|
||||
<?php comment_text() ?>
|
||||
<p>Posted <?php comment_date('M j, g:i A') ?> | <?php
|
||||
|
@ -160,12 +158,7 @@ echo $comments_nav_bar;
|
|||
echo "<a href=\"wp-post.php?action=editcomment&comment=".$comment->comment_ID."\">Edit</a>";
|
||||
echo " | <a href=\"wp-post.php?action=deletecomment&p=".$comment->comment_post_ID."&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> | ";
|
||||
} // end if any comments to show
|
||||
?> <a href="edit.php?p=<?php echo $comment->comment_post_ID; ?>">View Post</a></p>
|
||||
<?php
|
||||
if ("unapproved" == $comment_status) {
|
||||
echo "</span>";
|
||||
}
|
||||
?>
|
||||
?> <a href="edit.php?p=<?php echo $comment->comment_post_ID; ?>">Edit Post</a></p>
|
||||
</li>
|
||||
|
||||
<?php
|
||||
|
|
|
@ -37,8 +37,8 @@ ob_start();
|
|||
?>
|
||||
<ul id="adminmenu2">
|
||||
<li><a href="edit.php" class="current">Latest Posts</a></li>
|
||||
<li class="last"><a href="edit-comments.php">Latest Comments</a></li>
|
||||
<li><a href="wp-moderation.php">Comments Awaiting Moderation</a></li>
|
||||
<li><a href="edit-comments.php">Latest Comments</a></li>
|
||||
<li class="last"><a href="wp-moderation.php">Comments Awaiting Moderation</a></li>
|
||||
</ul>
|
||||
|
||||
<div class="wrap">
|
||||
|
|
|
@ -35,7 +35,7 @@ h2 {
|
|||
}
|
||||
|
||||
label {
|
||||
font-weight: bold;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
li {
|
||||
|
@ -197,6 +197,24 @@ textarea, input, select {
|
|||
clear: both;
|
||||
}
|
||||
|
||||
#post label.selectit {
|
||||
background-color: #eee;
|
||||
padding: 0 2px;
|
||||
display: block;
|
||||
margin-bottom: 1px;
|
||||
border-bottom: 1px solid #666;
|
||||
font-size: 11px;
|
||||
}
|
||||
|
||||
#post label.selectit:hover {
|
||||
background-color: #dadada;
|
||||
}
|
||||
|
||||
label input {
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
#profile {
|
||||
margin: 10px;
|
||||
}
|
||||
|
|
|
@ -8,6 +8,10 @@ function selected($selected, $current) {
|
|||
if ($selected == $current) echo ' selected="selected"';
|
||||
}
|
||||
|
||||
function checked($checked, $current) {
|
||||
if ($checked == $current) echo ' checked="checked"';
|
||||
}
|
||||
|
||||
switch($action) {
|
||||
case 'post':
|
||||
$submitbutton_text = 'Blog this!';
|
||||
|
@ -57,7 +61,7 @@ switch($action) {
|
|||
<input type="hidden" name="user_ID" value="<?php echo $user_ID ?>" />
|
||||
<input type="hidden" name="action" value='<?php echo $form_action . $form_extra ?>' />
|
||||
|
||||
<?php if ($action != "editcomment") {
|
||||
<?php if ($action != 'editcomment') {
|
||||
// this is for everything but comment editing
|
||||
?>
|
||||
<script type="text/javascript">
|
||||
|
@ -79,30 +83,23 @@ window.onload = focusit;
|
|||
<?php dropdown_categories($blog_ID, $default_post_cat); ?>
|
||||
</div>
|
||||
<div id="poststatusdiv">
|
||||
<label for="post_status"><a href="http://wordpress.org/docs/reference/post/#post_status" title="Help on post status">Post
|
||||
Status</a>:</label>
|
||||
<br />
|
||||
<select name="post_status" id="post_status">
|
||||
<option value="publish"<?php selected($post_status, 'publish'); ?>>Publish</option>
|
||||
<option value="draft"<?php selected($post_status, 'draft'); ?>>Draft</option>
|
||||
<option value="private"<?php selected($post_status, 'private'); ?>>Private</option>
|
||||
</select>
|
||||
<a href="http://wordpress.org/docs/reference/post/#post_status" title="Help on post status">Post
|
||||
Status</a>:
|
||||
<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>
|
||||
<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>
|
||||
<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>
|
||||
</div>
|
||||
<div id="commentstatusdiv">
|
||||
<label for="comment_status"><a href="http://wordpress.org/docs/reference/post/#comments" title="Help on comment status">Comments</a>:</label>
|
||||
<br />
|
||||
<select name="comment_status" id="comment_status">
|
||||
<option value="open"<?php selected($comment_status, 'open'); ?>>Open</option>
|
||||
<option value="closed"<?php selected($comment_status, 'closed'); ?>>Closed</option>
|
||||
</select>
|
||||
<a href="http://wordpress.org/docs/reference/post/#comments" title="Help on comment status">Comments</a>:
|
||||
<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>
|
||||
<label for="comment_status_closed" class="selectit"><input id="comment_status_closed" name="comment_status" type="radio" value="closed" <?php checked($comment_status, 'closed'); ?> />
|
||||
Closed</label>
|
||||
</div>
|
||||
<div id="pingstatusdiv">
|
||||
<label for="ping_status"><a href="http://wordpress.org/docs/reference/post/#pings" title="Help on ping status">Pings</a>:</label>
|
||||
<br />
|
||||
<select name="ping_status" id="ping_status">
|
||||
<option value="open"<?php selected($ping_status, 'open'); ?>>Open</option>
|
||||
<option value="closed"<?php selected($ping_status, 'closed'); ?>>Closed</option>
|
||||
</select>
|
||||
<a href="http://wordpress.org/docs/reference/post/#pings" title="Help on ping status">Pings</a>:
|
||||
<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>
|
||||
<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>
|
||||
|
||||
</div>
|
||||
<div id="postpassworddiv">
|
||||
<label for="post_password"><a href="http://wordpress.org/docs/reference/post/#post_password" title="Help on post password">Post
|
||||
|
@ -110,7 +107,7 @@ window.onload = focusit;
|
|||
<br />
|
||||
<input name="post_password" type="text" id="post_password" value="<?php echo $post_password ?>" />
|
||||
</div>
|
||||
<br clear="all" />
|
||||
<br style="clear: both" />
|
||||
<?php
|
||||
|
||||
} else {
|
||||
|
@ -148,7 +145,7 @@ window.onload = focusit;
|
|||
<?php
|
||||
if ($action != 'editcomment') {
|
||||
?>
|
||||
<p><label for="excerpt"><a href="http://wordpress.org/docs/reference/post/#excerpt" title="Help with excerpts">Excerpt</a>:</label>
|
||||
<p><a href="http://wordpress.org/docs/reference/post/#excerpt" title="Help with excerpts">Excerpt</a>:
|
||||
<br />
|
||||
<textarea rows="3" cols="40" style="width:100%" name="excerpt" tabindex="4" wrap="virtual" id="excerpt"><?php echo $excerpt ?></textarea></p>
|
||||
|
||||
|
|
|
@ -50,7 +50,7 @@ case 'update':
|
|||
|
||||
// check if comment moderation is turned on in the settings
|
||||
// if not, just give a short note and stop
|
||||
if ('none' == get_settings("comment_moderation")) {
|
||||
if ('none' == get_settings('comment_moderation')) {
|
||||
echo '<div class="wrap">
|
||||
<p>Comment moderation has been turned off.</p>
|
||||
</div>';
|
||||
|
@ -98,7 +98,13 @@ default:
|
|||
if ($user_level <= 3) {
|
||||
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>');
|
||||
}
|
||||
|
||||
?>
|
||||
<ul id="adminmenu2">
|
||||
<li><a href="edit.php">Latest Posts</a></li>
|
||||
<li><a href="edit-comments.php">Latest Comments</a></li>
|
||||
<li class="last"><a href="wp-moderation.php" class="current">Comments Awaiting Moderation</a></li>
|
||||
</ul>
|
||||
<?php
|
||||
// check if comment moderation is turned on in the settings
|
||||
// if not, just give a short note and stop
|
||||
if ('none' == get_settings('comment_moderation')) {
|
||||
|
@ -129,9 +135,9 @@ default:
|
|||
}
|
||||
if ($ignored) {
|
||||
if ($deleted == "1") {
|
||||
echo "1 comment left unchanged <br />\n";
|
||||
echo "1 comment unchanged <br />\n";
|
||||
} else {
|
||||
echo "$approved comments left unchanged <br />\n";
|
||||
echo "$approved comments unchanged <br />\n";
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -141,58 +147,47 @@ default:
|
|||
?>
|
||||
|
||||
<div class="wrap">
|
||||
|
||||
<?php
|
||||
$comments = $wpdb->get_results("SELECT * FROM $tablecomments WHERE comment_approved = '0'");
|
||||
|
||||
if ($comments) {
|
||||
// list all comments that are waiting for approval
|
||||
$file = basename(__FILE__);
|
||||
echo "The following comments wait for approval:<br /><br />";
|
||||
echo "<form name=\"approval\" action=\"$file\" method=\"post\">";
|
||||
echo "<input type=\"hidden\" name=\"action\" value=\"update\" />\n";
|
||||
echo "<ol id=\"comments\">\n";
|
||||
|
||||
?>
|
||||
<p>The following comments wait for approval:</p>
|
||||
<form name="approval" action="" method="post">
|
||||
<input type="hidden" name="action" value="update" />
|
||||
<ol id="comments">
|
||||
<?php
|
||||
foreach($comments as $comment) {
|
||||
$comment_date = mysql2date(get_settings("date_format") . " @ " . get_settings("time_format"), $comment->comment_date);
|
||||
$post_title = $wpdb->get_var("SELECT post_title FROM $tableposts WHERE ID='$comment->comment_post_ID'");
|
||||
$comment_text = stripslashes($comment->comment_content);
|
||||
$comment_text = str_replace('<trackback />', '', $comment_text);
|
||||
$comment_text = str_replace('<pingback />', '', $comment_text);
|
||||
$comment_text = convert_chars($comment_text);
|
||||
$comment_text = convert_bbcode($comment_text);
|
||||
$comment_text = convert_gmcode($comment_text);
|
||||
$comment_text = convert_smilies($comment_text);
|
||||
$comment_text = make_clickable($comment_text);
|
||||
$comment_text = balanceTags($comment_text,1);
|
||||
$comment_text = apply_filters('comment_text', $comment_text);
|
||||
|
||||
echo "<li id=\"comment-$comment->comment_ID\">";
|
||||
echo "$comment_date -> $post_title<br />";
|
||||
echo "<strong>$comment->comment_author ";
|
||||
echo "(<a href=\"mailto:$comment->comment_author_email\">$comment->comment_author_email</a> /";
|
||||
echo "<a href=\"$comment->comment_author_url\">$comment->comment_author_url</a>)</strong> ";
|
||||
echo "(IP: <a href=\"http://ws.arin.net/cgi-bin/whois.pl?queryinput=$comment->comment_author_IP\">$comment->comment_author_IP</a>)<br />";
|
||||
echo $comment_text;
|
||||
echo "<strong>Your action:</strong>";
|
||||
echo " <input type=\"radio\" name=\"comment[$comment->comment_ID]\" value=\"approve\" /> approve";
|
||||
echo " <input type=\"radio\" name=\"comment[$comment->comment_ID]\" value=\"delete\" /> delete";
|
||||
echo " <input type=\"radio\" name=\"comment[$comment->comment_ID]\" value=\"later\" checked=\"checked\" /> later";
|
||||
echo "<br /><br />";
|
||||
echo "</li>\n";
|
||||
echo "\n\t<li id='comment-$comment->comment_ID'>";
|
||||
?>
|
||||
<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>
|
||||
<?php comment_text() ?>
|
||||
<p><?php
|
||||
echo "<a href=\"wp-post.php?action=editcomment&comment=".$comment->comment_ID."\">Edit</a>";
|
||||
echo " | <a href=\"wp-post.php?action=deletecomment&p=".$comment->comment_post_ID."&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:
|
||||
<label><input type="radio" name="comment[$comment->comment_ID]" value="approve" /> Approve</label>
|
||||
<label><input type="radio" name="comment[$comment->comment_ID]" value="delete" /> Delete</label>
|
||||
<label><input type="radio" name="comment[$comment->comment_ID]" value="later" checked="checked" /> Do nothing</label>
|
||||
|
||||
</li>
|
||||
<?php
|
||||
}
|
||||
|
||||
echo "</ol>\n";
|
||||
echo "<input type=\"submit\" name=\"submit\" value=\"Continue!\" class=\"search\" style=\"font-weight: bold;\" />\n";
|
||||
echo "</form>\n";
|
||||
?>
|
||||
</ol>
|
||||
<input type="submit" name="submit" value="Moderate Comments" class="search" />
|
||||
</form>
|
||||
<?php
|
||||
} else {
|
||||
// nothing to approve
|
||||
echo "Currently there are no comments to be approved.<br />\n";
|
||||
echo "Currently there are no comments to be approved.\n";
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
<br />
|
||||
</div>
|
||||
|
||||
<?php
|
||||
|
@ -204,7 +199,7 @@ if ($comments) {
|
|||
<p>For each comment you have to choose either <em>approve</em>, <em>delete</em> or <em>later</em>:</p>
|
||||
<p><em>approve</em>: approves comment, so that it will be publically visible
|
||||
<?php
|
||||
if ("1" == get_settings("comments_notify")) {
|
||||
if ('1' == get_settings('comments_notify')) {
|
||||
echo "; the author of the post will be notified about the new comment on his post.</p>\n";
|
||||
} else {
|
||||
echo ".</p>\n";
|
||||
|
|
|
@ -321,8 +321,9 @@ switch($action) {
|
|||
}
|
||||
|
||||
// pingWeblogs($blog_ID);
|
||||
|
||||
header ('Location: ' . $HTTP_SERVER_VARS['HTTP_REFERER']);
|
||||
$sendback = $HTTP_SERVER_VARS['HTTP_REFERER'];
|
||||
if (strstr($sendback, 'wp-post')) $sendback = $siteurl .'/wp-admin/wp-post.php';
|
||||
header ('Location: ' . $sendback);
|
||||
|
||||
break;
|
||||
|
||||
|
@ -575,7 +576,7 @@ switch($action) {
|
|||
echo ', ';
|
||||
$draft->post_title = stripslashes($draft->post_title);
|
||||
if ($draft->post_title == '')
|
||||
$draft->post_title = 'post-'.$draft->ID;
|
||||
$draft->post_title = 'Post #'.$draft->ID;
|
||||
echo "<a href='wp-post.php?action=edit&post=$draft->ID' title='Edit this draft'>$draft->post_title</a>";
|
||||
++$i;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue