📄 post.php
字号:
header ('Location: ' . $location); break; case 'delete': $standalone = 1; require_once('./admin-header.php'); wp_refcheck("/wp-admin"); if ($user_level == 0) die ('Cheatin’ uh?'); $post_id = intval($_GET['post']); $postdata = get_postdata($post_id) or die('Oops, no post with this ID. <a href="post.php">Go back</a>!'); $authordata = get_userdata($postdata['Author_ID']); if ($user_level < $authordata->user_level) die ('You don’t have the right to delete <strong>'.$authordata[1].'</strong>’s posts.'); // send geoURL ping to "erase" from their DB $query = "SELECT post_lat from {$wpdb->posts} WHERE ID=$post_id"; $rows = $wpdb->query($query); $myrow = $rows[0]; $latf = $myrow->post_lat; if($latf != null ) { pingGeoUrl($post); } $result = $wpdb->query("DELETE FROM {$wpdb->posts} WHERE ID=$post_id"); if (!$result) die('Error in deleting... contact the <a href="mailto:'.get_settings('admin_email').'">webmaster</a>.'); $result = $wpdb->query("DELETE FROM {$wpdb->comments} WHERE comment_post_ID=$post_id"); $categories = $wpdb->query("DELETE FROM {$wpdb->post2cat} WHERE post_id = $post_id"); if (isset($sleep_after_edit) && $sleep_after_edit > 0) { sleep($sleep_after_edit); } do_action('delete_post', $post_ID); $sendback = $_SERVER['HTTP_REFERER']; if (strstr($sendback, 'post.php')) $sendback = $siteurl .'/wp-admin/post.php'; header ('Location: ' . $sendback); break; case 'editcomment': $title = '编辑评论'; $standalone = 0; require_once ('admin-header.php'); get_currentuserinfo(); if ($user_level == 0) { die (_LANG_P_CHEATING_ERROR); } $comment = $_GET['comment']; $commentdata = get_commentdata($comment, 1, true) or die('Oops, no comment with this ID. <a href="javascript:history.go(-1)">Go back</a>!'); $content = $commentdata['comment_content']; $content = format_to_edit($content); include('edit-form-comment.php'); break; case 'confirmdeletecomment': $standalone = 0; require_once('./admin-header.php'); if ($user_level == 0) die (_LANG_P_CHEATING_ERROR); $comment = $_GET['comment']; $comment = intval($comment); $p = $_GET['p']; $p = intval($p); $commentdata = get_commentdata($comment, 1, true) or die('Oops, no comment with this ID. <a href="edit.php">Go back</a>!'); echo "<div class=\"wrap\">\n"; echo "<p><strong>Caution:</strong> "._LANG_P_ABOUT_FOLLOW."</p>\n"; echo "<table border=\"0\">\n"; echo "<tr><td>Author:</td><td>" . $commentdata["comment_author"] . "</td></tr>\n"; echo "<tr><td>E-Mail:</td><td>" . $commentdata["comment_author_email"] . "</td></tr>\n"; echo "<tr><td>URL:</td><td>" . $commentdata["comment_author_url"] . "</td></tr>\n"; echo "<tr><td>Comment:</td><td>" . stripslashes($commentdata["comment_content"]) . "</td></tr>\n"; echo "</table>\n"; echo "<p>"._LANG_P_SURE_THAT."</p>\n"; echo "<form action=\"$siteurl/wp-admin/post.php\" method=\"get\">\n"; echo "<input type=\"hidden\" name=\"action\" value=\"deletecomment\" />\n"; echo "<input type=\"hidden\" name=\"p\" value=\"$p\" />\n"; echo "<input type=\"hidden\" name=\"comment\" value=\"$comment\" />\n"; echo "<input type=\"hidden\" name=\"noredir\" value=\"1\" />\n"; echo "<input type=\"submit\" value=\"Yes\" />"; echo " "; echo "<input type=\"button\" value=\"No\" onClick=\"self.location='$siteurl/wp-admin/edit.php?p=$p&c=1#comments';\" />\n"; echo "</form>\n"; echo "</div>\n"; break; case 'deletecomment': $standalone = 1; require_once('./admin-header.php'); wp_refcheck("/wp-admin"); if ($user_level == 0) die (_LANG_P_CHEATING_ERROR); $comment = $_GET['comment']; $p = $_GET['p']; if (isset($_GET['noredir'])) { $noredir = true; } else { $noredir = false; } $postdata = get_postdata($p) or die('Oops, no post with this ID. <a href="edit.php">Go back</a>!'); $commentdata = get_commentdata($comment, 1, true) or die('Oops, no comment with this ID. <a href="post.php">Go back</a>!'); $authordata = get_userdata($postdata['Author_ID']); if ($user_level < $authordata->user_level) die ('You don’t have the right to delete <strong>'.$authordata->user_nickname.'</strong>’s post comments. <a href="post.php">Go back</a>!'); wp_set_comment_status($comment, "delete"); do_action('delete_comment', $comment); if (($_SERVER['HTTP_REFERER'] != "") && (false == $noredir)) { header('Location: ' . $_SERVER['HTTP_REFERER']); } else { header('Location: '.$siteurl.'/wp-admin/edit.php?p='.$p.'&c=1#comments'); } break; case 'unapprovecomment': $standalone = 1; require_once('./admin-header.php'); wp_refcheck("/wp-admin"); if ($user_level == 0) die (_LANG_P_CHEATING_ERROR); $comment = $_GET['comment']; $p = $_GET['p']; if (isset($_GET['noredir'])) { $noredir = true; } else { $noredir = false; } $commentdata = get_commentdata($comment) or die('Oops, no comment with this ID. <a href="edit.php">Go back</a>!'); wp_set_comment_status($comment, "hold"); if (($_SERVER['HTTP_REFERER'] != "") && (false == $noredir)) { header('Location: ' . $_SERVER['HTTP_REFERER']); } else { header('Location: '.$siteurl.'/wp-admin/edit.php?p='.$p.'&c=1#comments'); } break; case 'mailapprovecomment': $standalone = 0; require_once('./admin-header.php'); if ($user_level == 0) die (_LANG_P_CHEATING_ERROR); $comment = $_GET['comment']; $p = $_GET['p']; $commentdata = get_commentdata($comment, 1, true) or die('Oops, no comment with this ID. <a href="edit.php">Go back</a>!'); wp_set_comment_status($comment, "approve"); if (get_settings("comments_notify") == true) { wp_notify_postauthor($comment); } echo "<div class=\"wrap\">\n"; echo "<p>"._LANG_P_COMHAS_APPR."</p>\n"; echo "<form action=\"$siteurl/wp-admin/edit.php?p=$p&c=1#comments\" method=\"get\">\n"; echo "<input type=\"hidden\" name=\"p\" value=\"$p\" />\n"; echo "<input type=\"hidden\" name=\"c\" value=\"1\" />\n"; echo "<input type=\"submit\" value=\"Ok\" />"; echo "</form>\n"; echo "</div>\n"; break; case 'approvecomment': $standalone = 1; require_once('./admin-header.php'); wp_refcheck("/wp-admin"); if ($user_level == 0) die (_LANG_P_CHEATING_ERROR); $comment = $_GET['comment']; $p = $_GET['p']; if (isset($_GET['noredir'])) { $noredir = true; } else { $noredir = false; } $commentdata = get_commentdata($comment) or die('Oops, no comment with this ID. <a href="edit.php">Go back</a>!'); wp_set_comment_status($comment, "approve"); if (get_settings("comments_notify") == true) { wp_notify_postauthor($comment); } if (($_SERVER['HTTP_REFERER'] != "") && (false == $noredir)) { header('Location: ' . $_SERVER['HTTP_REFERER']); } else { header('Location: '.$siteurl.'/wp-admin/edit.php?p='.$p.'&c=1#comments'); } break; case 'editedcomment': $standalone = 1; require_once('./admin-header.php'); wp_refcheck("/wp-admin"); if ($user_level == 0) die (_LANG_P_CHEATING_ERROR); $comment_ID = $_POST['comment_ID']; $comment_ID = intval($comment_ID); $comment_post_ID = $_POST['comment_post_ID']; $newcomment_author = $_POST['newcomment_author']; $newcomment_author_email = $_POST['newcomment_author_email']; $newcomment_author_url = $_POST['newcomment_author_url']; $newcomment_author = addslashes($newcomment_author); $newcomment_author_email = addslashes($newcomment_author_email); $newcomment_author_url = addslashes($newcomment_author_url); if (($user_level > 4) && (!empty($_POST['edit_date']))) { $aa = $_POST['aa']; $mm = $_POST['mm']; $jj = $_POST['jj']; $hh = $_POST['hh']; $mn = $_POST['mn']; $ss = $_POST['ss']; $jj = ($jj > 31) ? 31 : $jj; $hh = ($hh > 23) ? $hh - 24 : $hh; $mn = ($mn > 59) ? $mn - 60 : $mn; $ss = ($ss > 59) ? $ss - 60 : $ss; $datemodif = ", comment_date = '$aa-$mm-$jj $hh:$mn:$ss'"; } else { $datemodif = ''; } $content = balanceTags($_POST['wp_content']); $content = format_to_post($content); $result = $wpdb->query(" UPDATE {$wpdb->comments} SET comment_content = '$content', comment_author = '$newcomment_author', comment_author_email = '$newcomment_author_email', comment_author_url = '$newcomment_author_url'".$datemodif." WHERE comment_ID = $comment_ID" ); do_action('edit_comment', $comment_ID); $referredby = $_POST['referredby']; if (!empty($referredby)) header('Location: ' . $referredby); else header ("Location: edit.php?p=$comment_post_ID&c=1#comments"); break; default: $title = '发表新文章'; $standalone = 0; require_once ('./admin-header.php'); if ($user_level > 0) { if ((!$withcomments) && (!$c)) { $action = 'post'; get_currentuserinfo(); $drafts = $wpdb->get_results("SELECT ID, post_title FROM {$wpdb->posts} WHERE post_status = 'draft' AND post_author = $user_ID"); if ($drafts) { ?> <div class="wrap"> <p><strong><?php echo _LANG_P_YOUR_DRAFTS; ?></strong> <?php $i = 0; foreach ($drafts as $draft) { if (0 != $i) echo ', '; $draft->post_title = stripslashes($draft->post_title); if ($draft->post_title == '') $draft->post_title = '文章 #'.$draft->ID; echo "<a href='post.php?action=edit&post=$draft->ID' title='编辑草稿'>$draft->post_title</a>"; ++$i; } ?>.</p> </div> <?php } //set defaults $post_status = get_settings('default_post_status'); $comment_status = get_settings('default_comment_status'); $ping_status = get_settings('default_ping_status'); $post_pingback = get_settings('default_pingback_flag'); $default_post_cat = get_settings('default_post_category'); $post = 0; $postdata = ''; $content = ''; $post_password = ''; $to_ping = ''; $pinged = ''; $form_action = 'post'; include('edit-form.php'); }?><div class="wrap"><h2>WordPress bookmarklet</h2><p><?php echo _LANG_P_WP_BOOKMARKLET; ?></p><p><?php$bookmarklet_height= (get_settings('use_trackback')) ? 460 : 420;if ($is_NS4 || $is_gecko) {?> <a href="javascript:if(navigator.userAgent.indexOf('Safari') >= 0){Q=getSelection();}else{Q=document.selection?document.selection.createRange().text:document.getSelection();}void(window.open('<?php echo $siteurl ?>/wp-admin/bookmarklet.php?text='+escape(Q)+'&popupurl='+escape(location.href)+'&popuptitle='+escape(document.title),'WordPress bookmarklet','scrollbars=yes,width=600,height=460,left=100,top=150,status=yes'));"><?php echo _LANG_P_PRESS_IT?> - <?php echo get_settings('blogname') ?></a> <?php} else if ($is_winIE) { if ($wp_use_spaw) { $range_text = "htmlText"; } else { $range_text = "text"; }?> <a href="javascript:Q='';if(top.frames.length==0)Q=document.selection.createRange().<?php echo $range_text ?>;void(btw=window.open('<?php echo $siteurl ?>/wp-admin/bookmarklet.php?text='+escape(Q)+'<?php echo $bookmarklet_tbpb ?>&popupurl='+escape(location.href)+'&popuptitle='+escape(document.title),'bookmarklet','scrollbars=yes,width=600,height=<?php echo $bookmarklet_height ?>,left=100,top=50,status=yes'));btw.focus();"><?php echo _LANG_P_PRESS_IT?> - <?php echo get_settings('blogname') ?></a> <script type="text/javascript" language="JavaScript"><!--function oneclickbookmarklet(blah) { window.open ("profile.php?action=IErightclick", "oneclickbookmarklet", "width=500, height=450, location=0, menubar=0, resizable=0, scrollbars=1, status=1, titlebar=0, toolbar=0, screenX=120, left=120, screenY=120, top=120");}// --></script> <br /> <br /> <a href="javascript:oneclickbookmarklet(0);">快捷书签</a> <?php} else if ($is_opera) {?> <a href="javascript:void(window.open('<?php echo $siteurl ?>/wp-admin/bookmarklet.php?popupurl='+escape(location.href)+'&popuptitle='+escape(document.title)+'<?php echo $bookmarklet_tbpb ?>','bookmarklet','scrollbars=yes,width=600,height=<?php echo $bookmarklet_height ?>,left=100,top=150,status=yes'));"><?php echo _LANG_P_PRESS_IT?> - <?php echo get_settings('blogname') ?></a> <?php} else if ($is_macIE) {?> <a href="javascript:Q='';if(top.frames.length==0);void(btw=window.open('<?php echo $siteurl ?>/wp-admin/bookmarklet.php?text='+escape(document.getSelection())+'&popupurl='+escape(location.href)+'&popuptitle='+escape(document.title)+'<?php echo $bookmarklet_tbpb ?>','bookmarklet','scrollbars=yes,width=600,height=<?php echo $bookmarklet_height ?>,left=100,top=150,status=yes'));btw.focus();"><?php echo _LANG_P_PRESS_IT?> - <?php echo get_settings('blogname') ?></a> <?php}?></p></div><?php } else {?><div class="wrap"> <p><?php echo _LANG_P_NEWCOMER_MESS." : <a href=\"mailto:".get_settings('admin_email')."?subject=Promotion\">E-Mail</a>"; ?></p></div><?php } break;} // end switch/* </Edit> */include('admin-footer.php');?>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -