Beta multiple category support. Major style changes. You can now add, delete, edit categories through the admin interface.

git-svn-id: http://svn.automattic.com/wordpress/trunk@572 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
saxmatt 2003-12-05 09:41:27 +00:00
parent cbccab200c
commit bc2c6dad9a
7 changed files with 169 additions and 123 deletions

View File

@ -680,10 +680,10 @@ function dropdown_categories($default = 0) {
foreach($categories as $category) { foreach($categories as $category) {
++$i; ++$i;
$category->cat_name = stripslashes($category->cat_name); $category->cat_name = stripslashes($category->cat_name);
echo "<label for='category-$category->cat_ID' class='selectit'><input value='$category->cat_ID' type='checkbox' name='post_category' id='category-$category->cat_ID'"; echo "<label for='category-$i' class='selectit'><input value='$category->cat_ID' type='checkbox' name='post_category[] ' id='category-$i'";
if ($postcategories && in_array($category->cat_ID, $postcategories)) if ($postcategories && in_array($category->cat_ID, $postcategories))
echo " checked='checked'"; echo " checked='checked'";
echo ">$category->cat_name</label> "; echo " /> $category->cat_name</label> ";
} }
} }
@ -713,7 +713,7 @@ function touch_time($edit = 1) {
for ($i=1; $i < 13; $i=$i+1) { for ($i=1; $i < 13; $i=$i+1) {
echo "\t\t\t<option value=\"$i\""; echo "\t\t\t<option value=\"$i\"";
if ($i == $mm) if ($i == $mm)
echo " selected"; echo " selected='selected'";
if ($i < 10) { if ($i < 10) {
$ii = "0".$i; $ii = "0".$i;
} else { } else {

View File

@ -1247,12 +1247,14 @@ function the_category($seperator = '') {
if ('' == $seperator) { if ('' == $seperator) {
echo '<ul class="post-categories">'; echo '<ul class="post-categories">';
foreach ($categories as $category) { foreach ($categories as $category) {
$category->cat_name = stripslashes($category->cat_name);
echo "\n\t<li><a href='" . get_category_link(0, $category->category_id) . "' title='View all posts in $category->cat_name'>$category->cat_name</a></li>"; echo "\n\t<li><a href='" . get_category_link(0, $category->category_id) . "' title='View all posts in $category->cat_name'>$category->cat_name</a></li>";
} }
echo '</ul>'; echo '</ul>';
} else { } else {
$i = 0; $i = 0;
foreach ($categories as $category) { foreach ($categories as $category) {
$category->cat_name = stripslashes($category->cat_name);
if (0 < $i) echo $seperator . ' '; if (0 < $i) echo $seperator . ' ';
echo "<a href='" . get_category_link(0, $category->category_id) . "' title='View all posts in $category->cat_name'>$category->cat_name</a>"; echo "<a href='" . get_category_link(0, $category->category_id) . "' title='View all posts in $category->cat_name'>$category->cat_name</a>";
++$i; ++$i;

View File

@ -278,8 +278,9 @@ if ($pagenow != 'wp-post.php') {
if ((empty($poststart)) || (empty($postend)) || !($postend > $poststart)) { if ((empty($poststart)) || (empty($postend)) || !($postend > $poststart)) {
$where .= ' AND post_date <= \''.$now.'\''; $where .= ' AND post_date <= \''.$now.'\'';
} }
$where .= ' AND post_category > 0';
$distinct = 'DISTINCT'; $distinct = 'DISTINCT';
if ($use_gzipcompression) { if ($use_gzipcompression) {
// gzipping the output of the script // gzipping the output of the script
gzip_compression(); gzip_compression();

View File

@ -1,6 +1,7 @@
a { a {
border-bottom: 1px solid #69c;
color: #00019b; color: #00019b;
font-weight: bold; text-decoration: none;
} }
a:visited { a:visited {
@ -8,6 +9,7 @@ a:visited {
} }
a:hover { a:hover {
border-bottom: 1px solid #3a75ae;
color: #069; color: #069;
} }
@ -22,7 +24,31 @@ body, td {
font: 10pt Georgia, "Times New Roman", Times, serif; font: 10pt Georgia, "Times New Roman", Times, serif;
} }
form { fieldset {
border: 1px solid #ccc;
padding: 2px;
}
fieldset label.selectit {
background: #f0f0f0;
display: block;
font-size: 11px;
padding: 0 2px;
}
fieldset label.selectit:hover {
background: #dadada;
}
fieldset legend {
padding: .1em;
}
fieldset:hover {
border: 1px solid #999;
}
form, label input {
margin: 0; margin: 0;
padding: 0; padding: 0;
} }
@ -64,9 +90,9 @@ textarea, input, select {
.checkbox { .checkbox {
background: #fff; background: #fff;
border-width: 0px; border: none;
margin: 0px; margin: 0;
padding: 0px; padding: 0;
} }
.quicktags, .search { .quicktags, .search {
@ -75,32 +101,31 @@ textarea, input, select {
font: 12px Georgia, "Times New Roman", Times, serif; font: 12px Georgia, "Times New Roman", Times, serif;
} }
.wrap {
border: 1px solid #ccc;
margin: 20px auto 10px auto;
padding: 10px;
width: 85%;
}
.wrap h2 {
font-size: 18px;
margin: 6px 0;
}
.unapproved { .unapproved {
color: #888; color: #888;
} }
.unapproved a:link { .unapproved a:link {
color: #B9BCFF; color: #b9bcff;
} }
.unapproved a:visited { .unapproved a:visited {
color: #696DFF; color: #696dff;
} }
.unapproved a:hover { .unapproved a:hover {
color: #009EF0; color: #009ef0;
}
.wrap {
border: 1px solid #ccc;
margin: 15px 5%;
padding: 0 1em;
}
.wrap h2 {
font-size: 18px;
margin: 6px 0;
} }
#adminmenu .last, #adminmenu2 .last { #adminmenu .last, #adminmenu2 .last {
@ -112,30 +137,28 @@ textarea, input, select {
color: #333; color: #333;
font-size: 16px; font-size: 16px;
font-weight: normal; font-weight: normal;
padding: 3px; margin: 0;
padding: 3px 5px;
text-decoration: none; text-decoration: none;
margin: 0 1px;
} }
#adminmenu a:hover, .current, #adminmenu2 a:hover { #adminmenu a:hover, .current, #adminmenu2 a:hover {
background: #e9e9e9; background: #eaeaea;
border: 1px solid #808080; border: 1px solid #9d9d9d;
color: #333; color: #171717;
} }
#adminmenu li, #adminmenu2 li { #adminmenu li, #adminmenu2 li {
border-right: 1px solid #ccc;
display: inline; display: inline;
line-height: 2.0em;
list-style: none; list-style: none;
text-align: center; text-align: center;
line-height: 2.0em;
} }
#adminmenu, #adminmenu2 { #adminmenu, #adminmenu2 {
border-bottom: 2px solid #5a5a5a; border-bottom: 2px solid #5a5a5a;
margin: 2px; margin: 2px;
padding: 2px; padding: 0 2px;
padding-top: 5px;
} }
#adminmenu2 { #adminmenu2 {
@ -148,17 +171,15 @@ textarea, input, select {
} }
#categorydiv { #categorydiv {
float: right;
width: 10%;
line-height: 130%; line-height: 130%;
margin-right: 5px;
position: absolute;
right: 5%;
width: 9em;
} }
#poststuff { #categorydiv input, #poststatusdiv input, #commentstatusdiv input, #pingstatusdiv input {
width: 88%; border: none;
}
#poststuff textarea {
width: 100%;
} }
#ed_button { #ed_button {
@ -211,23 +232,16 @@ textarea, input, select {
clear: both; clear: both;
} }
#post label.selectit { #poststatusdiv, #commentstatusdiv, #pingstatusdiv {
background-color: #eee; width: 6.5em;
padding: 0 2px;
display: block;
margin-bottom: 1px;
margin-top: 1px;
border-bottom: 1px solid #666;
font-size: 11px;
} }
#post label.selectit:hover { #poststuff {
background-color: #dadada; margin-right: 11em;
} }
label input { #poststuff textarea {
padding: 0; width: 100%;
margin: 0;
} }
#profile { #profile {
@ -261,7 +275,6 @@ label input {
margin-right: 5px; margin-right: 5px;
} }
#wphead { #wphead {
background: url(../b2-img/wp-small.png) no-repeat; background: url(../b2-img/wp-small.png) no-repeat;
border-bottom: 4px solid #333; border-bottom: 4px solid #333;
@ -273,6 +286,6 @@ label input {
display: block; display: block;
height: 42px; height: 42px;
text-decoration: none; text-decoration: none;
text-indent: -100em; text-indent: -1000px;
width: 200px; width: 200px;
} }

View File

@ -38,7 +38,7 @@ switch($action) {
$submitbutton_text = 'Edit this!'; $submitbutton_text = 'Edit this!';
$toprow_title = 'Editing Post #' . $postdata['ID']; $toprow_title = 'Editing Post #' . $postdata['ID'];
$form_action = 'editpost'; $form_action = 'editpost';
$form_extra = "' />\n<input type='hidden' name='post_ID' value='$post"; $form_extra = "' />\n<input type='hidden' name='post_ID' value='$post->ID";
$colspan = 2; $colspan = 2;
$form_pingback = '<input type="hidden" name="post_pingback" value="0" />'; $form_pingback = '<input type="hidden" name="post_pingback" value="0" />';
$form_prevstatus = '<input type="hidden" name="prev_status" value="'.$post_status.'" />'; $form_prevstatus = '<input type="hidden" name="prev_status" value="'.$post_status.'" />';
@ -65,51 +65,48 @@ switch($action) {
// this is for everything but comment editing // this is for everything but comment editing
?> ?>
<script type="text/javascript"> <script type="text/javascript">
<!--
function focusit() { function focusit() {
// focus on first input field // focus on first input field
document.post.title.focus(); document.post.title.focus();
} }
window.onload = focusit; window.onload = focusit;
//-->
</script> </script>
<div id="titlediv">
<label for="title"><a href="http://wordpress.org/docs/reference/post/#title" title="Help on titles">Title</a>:</label>
<br />
<input type="text" name="post_title" size="25" tabindex="1" style="width: 190px;" value="<?php echo $edited_post_title; ?>" id="title" />
</div>
<div id="categorydiv"> <a href="http://wordpress.org/docs/reference/post/#category" title="Help on categories">Categories</a>: <br />
<?php dropdown_categories($default_post_cat); ?>
</div>
<div id="poststatusdiv">
<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">
<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">
<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
Password</a>:</label>
<br />
<input name="post_password" type="text" id="post_password" value="<?php echo $post_password ?>" />
</div>
<div id="poststuff"> <div id="poststuff">
<?php <fieldset id="titlediv">
<legend><a href="http://wordpress.org/docs/reference/post/#title" title="Help on titles">Title</a></legend>
<div><input type="text" name="post_title" size="30" tabindex="1" value="<?php echo $edited_post_title; ?>" id="title" /></div>
</fieldset>
<fieldset id="categorydiv">
<legend><a href="http://wordpress.org/docs/reference/post/#category" title="Help on categories">Categories</a></legend>
<div><?php dropdown_categories($default_post_cat); ?></div>
</fieldset>
<fieldset id="poststatusdiv">
<legend><a href="http://wordpress.org/docs/reference/post/#post_status" title="Help on post status">Post Status</a></legend>
<div><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>
</fieldset>
<fieldset id="commentstatusdiv">
<legend><a href="http://wordpress.org/docs/reference/post/#comments" title="Help on comment status">Comments</a></legend>
<div><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>
</fieldset>
<fieldset id="pingstatusdiv">
<legend><a href="http://wordpress.org/docs/reference/post/#pings" title="Help on ping status">Pings</a></legend>
<div><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>
</fieldset>
<fieldset id="postpassworddiv">
<legend><a href="http://wordpress.org/docs/reference/post/#post_password" title="Help on post password">Post Password</a></legend>
<div><input name="post_password" type="text" size="18" id="post_password" value="<?php echo $post_password ?>" /></div>
</fieldset>
<?php
} else { } else {
// this is for comment editing // this is for comment editing
@ -145,41 +142,39 @@ window.onload = focusit;
<?php <?php
if ($action != 'editcomment') { if ($action != 'editcomment') {
?> ?>
<p style="clear: both;" ><a href="http://wordpress.org/docs/reference/post/#excerpt" title="Help with excerpts">Excerpt</a>: <fieldset style="clear: both">
<br /> <legend><a href="http://wordpress.org/docs/reference/post/#excerpt" title="Help with excerpts">Excerpt</a></legend>
<textarea rows="3" cols="40" name="excerpt" tabindex="4" wrap="virtual" id="excerpt"><?php echo $excerpt ?></textarea></p> <div><textarea rows="2" cols="40" name="excerpt" tabindex="4" id="excerpt"><?php echo $excerpt ?></textarea></div>
</legend>
</fieldset>
<?php <?php
} // if not a comment } // if not a comment
?> ?>
<table style="width: 100%; "> <fieldset>
<tr>
<td>
<?php <?php
if ($action != 'editcomment') { if ($action != 'editcomment') {
echo '<label for="content"><a href="http://wordpress.org/docs/reference/post/#post" title="Help with post field">Post</a>:</label>'; echo '<legend><a href="http://wordpress.org/docs/reference/post/#post" title="Help with post field">Post</a></legend>';
} else { } else {
echo '<label for="content">Comment:</label>'; echo '<legend>Comment</legend>';
} }
?> ?>
</td> <div id="quicktags">
<td id="quicktags">
<?php <?php
if ($use_quicktags) { if ($use_quicktags) {
echo '<a href="http://wordpress.org/docs/reference/post/#quicktags" title="Help with quicktags">Quicktags</a>: '; echo '<a href="http://wordpress.org/docs/reference/post/#quicktags" title="Help with quicktags">Quicktags</a>: ';
include('wp-quicktags.php'); include('wp-quicktags.php');
} }
?> ?>
</td> </div>
</tr>
</table>
<?php <?php
$rows = get_settings('default_post_edit_rows'); $rows = get_settings('default_post_edit_rows');
if (($rows < 3) || ($rows > 100)) { if (($rows < 3) || ($rows > 100)) {
$rows = 10; $rows = 10;
} }
?> ?>
<textarea rows="<?php echo $rows; ?>" cols="40" name="content" tabindex="4" wrap="virtual" id="content"><?php echo $content ?></textarea><br /> <div><textarea rows="<?php echo $rows; ?>" cols="40" name="content" tabindex="4" id="content"><?php echo $content ?></textarea></div>
</fieldset>
<?php <?php
if ($use_quicktags) { if ($use_quicktags) {
?> ?>
@ -234,6 +229,7 @@ if ('edit' == $action) echo "
<p><a href='wp-post.php?action=delete&amp;post=$post' onclick=\"return confirm('You are about to delete this post \'".$edited_post_title."\'\\n \'Cancel\' to stop, \'OK\' to delete.')\">Delete this post</a></p>"; <p><a href='wp-post.php?action=delete&amp;post=$post' onclick=\"return confirm('You are about to delete this post \'".$edited_post_title."\'\\n \'Cancel\' to stop, \'OK\' to delete.')\">Delete this post</a></p>";
?> ?>
</div>
</form> </form>
</div>
</div> </div>

View File

@ -48,7 +48,7 @@ switch($action) {
$excerpt = balanceTags($HTTP_POST_VARS['excerpt']); $excerpt = balanceTags($HTTP_POST_VARS['excerpt']);
$excerpt = format_to_post($excerpt); $excerpt = format_to_post($excerpt);
$post_title = addslashes($HTTP_POST_VARS['post_title']); $post_title = addslashes($HTTP_POST_VARS['post_title']);
$post_category = intval($HTTP_POST_VARS['post_category']); $post_categories = $HTTP_POST_VARS['post_category'];
if(get_settings('use_geo_positions')) { if(get_settings('use_geo_positions')) {
$latstr = $HTTP_POST_VARS['post_latf']; $latstr = $HTTP_POST_VARS['post_latf'];
$lonstr = $HTTP_POST_VARS['post_lonf']; $lonstr = $HTTP_POST_VARS['post_lonf'];
@ -86,15 +86,15 @@ switch($action) {
if((get_settings('use_geo_positions')) && (strlen($latstr) > 2) && (strlen($lonstr) > 2) ) { if((get_settings('use_geo_positions')) && (strlen($latstr) > 2) && (strlen($lonstr) > 2) ) {
$postquery ="INSERT INTO $tableposts $postquery ="INSERT INTO $tableposts
(ID, post_author, post_date, post_content, post_title, post_category, post_lat, post_lon, post_excerpt, post_status, comment_status, ping_status, post_password, post_name) (ID, post_author, post_date, post_content, post_title, post_lat, post_lon, post_excerpt, post_status, comment_status, ping_status, post_password, post_name)
VALUES VALUES
('0','$user_ID','$now','$content','$post_title','$post_category',$post_latf,$post_lonf,'$excerpt', '$post_status', '$comment_status', '$ping_status', '$post_password', '$post_name') ('0', '$user_ID', '$now', '$content', '$post_title', $post_latf, $post_lonf,'$excerpt', '$post_status', '$comment_status', '$ping_status', '$post_password', '$post_name')
"; ";
} else { } else {
$postquery ="INSERT INTO $tableposts $postquery ="INSERT INTO $tableposts
(ID, post_author, post_date, post_content, post_title, post_category, post_excerpt, post_status, comment_status, ping_status, post_password, post_name) (ID, post_author, post_date, post_content, post_title, post_excerpt, post_status, comment_status, ping_status, post_password, post_name)
VALUES VALUES
('0','$user_ID','$now','$content','$post_title','$post_category','$excerpt', '$post_status', '$comment_status', '$ping_status', '$post_password', '$post_name') ('0', '$user_ID', '$now', '$content', '$post_title', '$excerpt', '$post_status', '$comment_status', '$ping_status', '$post_password', '$post_name')
"; ";
} }
$postquery = $postquery =
@ -102,6 +102,21 @@ switch($action) {
$post_ID = $wpdb->get_var("SELECT ID FROM $tableposts ORDER BY ID DESC LIMIT 1"); $post_ID = $wpdb->get_var("SELECT ID FROM $tableposts ORDER BY ID DESC LIMIT 1");
// Insert categories
foreach ($post_categories as $post_category) {
// Double check it's not there already
$exists = $wpdb->get_row("SELECT * FROM $tablepost2cat WHERE post_id = $post_ID AND category_id = $post_category");
if (!$exists && $result) {
$wpdb->query("
INSERT INTO $tablepost2cat
(post_id, category_id)
VALUES
($post_ID, $post_category)
");
}
}
if (isset($sleep_after_edit) && $sleep_after_edit > 0) { if (isset($sleep_after_edit) && $sleep_after_edit > 0) {
sleep($sleep_after_edit); sleep($sleep_after_edit);
} }
@ -203,7 +218,7 @@ switch($action) {
$blog_ID = 1; $blog_ID = 1;
} }
$post_ID = $HTTP_POST_VARS['post_ID']; $post_ID = $HTTP_POST_VARS['post_ID'];
$post_category = intval($HTTP_POST_VARS['post_category']); $post_categories = $HTTP_POST_VARS['post_category'];
$post_autobr = intval($HTTP_POST_VARS['post_autobr']); $post_autobr = intval($HTTP_POST_VARS['post_autobr']);
$content = balanceTags($HTTP_POST_VARS['content']); $content = balanceTags($HTTP_POST_VARS['content']);
$content = format_to_post($content); $content = format_to_post($content);
@ -248,9 +263,9 @@ switch($action) {
UPDATE $tableposts SET UPDATE $tableposts SET
post_content = '$content', post_content = '$content',
post_excerpt = '$excerpt', post_excerpt = '$excerpt',
post_title = '$post_title', post_title = '$post_title'"
post_category = '$post_category'".$datemodif.", .$datemodif.","
".$latlonaddition." .$latlonaddition."
post_status = '$post_status', post_status = '$post_status',
comment_status = '$comment_status', comment_status = '$comment_status',
ping_status = '$ping_status', ping_status = '$ping_status',
@ -258,6 +273,23 @@ switch($action) {
post_name = '$post_name' post_name = '$post_name'
WHERE ID = $post_ID "); WHERE ID = $post_ID ");
// Now it's category time!
// First the old categories
$old_categories = $wpdb->get_col("SELECT category_id FROM $tablepost2cat WHERE post_id = $post_ID");
// Delete any?
foreach ($old_categories as $old_cat) {
if (!in_array($old_cat, $post_categories)) // If a category was there before but isn't now
$wpdb->query("DELETE FROM $tablepost2cat WHERE category_id = $old_cat AND post_id = $post_ID LIMIT 1");
}
// Add any?
foreach ($post_categories as $new_cat) {
if (!in_array($new_cat, $old_categories))
$wpdb->query("INSERT INTO $tablepost2cat (post_id, category_id) VALUES ($post_ID, $new_cat)");
}
if (isset($sleep_after_edit) && $sleep_after_edit > 0) { if (isset($sleep_after_edit) && $sleep_after_edit > 0) {
sleep($sleep_after_edit); sleep($sleep_after_edit);
} }
@ -294,7 +326,7 @@ switch($action) {
if ($user_level == 0) if ($user_level == 0)
die ('Cheatin&#8217; uh?'); die ('Cheatin&#8217; uh?');
$post = $HTTP_GET_VARS['post']; $post_id = $HTTP_GET_VARS['post'];
$postdata = get_postdata($post) or die('Oops, no post with this ID. <a href="wp-post.php">Go back</a>!'); $postdata = get_postdata($post) or die('Oops, no post with this ID. <a href="wp-post.php">Go back</a>!');
$authordata = get_userdata($postdata['Author_ID']); $authordata = get_userdata($postdata['Author_ID']);
@ -302,7 +334,7 @@ switch($action) {
die ('You don&#8217;t have the right to delete <strong>'.$authordata[1].'</strong>&#8217;s posts.'); die ('You don&#8217;t have the right to delete <strong>'.$authordata[1].'</strong>&#8217;s posts.');
// send geoURL ping to "erase" from their DB // send geoURL ping to "erase" from their DB
$query = "SELECT post_lat from $tableposts WHERE ID=$post"; $query = "SELECT post_lat from $tableposts WHERE ID=$post_id";
$rows = $wpdb->query($query); $rows = $wpdb->query($query);
$myrow = $rows[0]; $myrow = $rows[0];
$latf = $myrow->post_lat; $latf = $myrow->post_lat;
@ -310,11 +342,13 @@ switch($action) {
pingGeoUrl($post); pingGeoUrl($post);
} }
$result = $wpdb->query("DELETE FROM $tableposts WHERE ID=$post"); $result = $wpdb->query("DELETE FROM $tableposts WHERE ID=$post_id");
if (!$result) if (!$result)
die('Error in deleting... contact the <a href="mailto:$admin_email">webmaster</a>.'); die('Error in deleting... contact the <a href="mailto:$admin_email">webmaster</a>.');
$result = $wpdb->query("DELETE FROM $tablecomments WHERE comment_post_ID=$post"); $result = $wpdb->query("DELETE FROM $tablecomments WHERE comment_post_ID=$post_id");
$categories = $wpdb->query("DELETE FROM $tablepost2cat WHERE post_id = $post_id");
if (isset($sleep_after_edit) && $sleep_after_edit > 0) { if (isset($sleep_after_edit) && $sleep_after_edit > 0) {
sleep($sleep_after_edit); sleep($sleep_after_edit);

View File

@ -1,2 +1,2 @@
<script src="wp-quicktags.js" language="JavaScript" type="text/javascript"></script> <script src="wp-quicktags.js" language="JavaScript" type="text/javascript"></script>
<script language="JavaScript">edToolbar();</script> <script language="JavaScript" type="text/javascript">edToolbar();</script>