mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-03-31 18:54:29 +00:00
Removed mysql direct calls
git-svn-id: https://develop.svn.wordpress.org/trunk@282 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -47,8 +47,7 @@ case 'addcat':
|
||||
|
||||
$cat_name=addslashes($HTTP_POST_VARS["cat_name"]);
|
||||
|
||||
$query = "INSERT INTO $tablecategories (cat_ID,cat_name) VALUES ('0', '$cat_name')";
|
||||
$result = mysql_query($query) or die("Couldn't add category <b>$cat_name</b>");
|
||||
$wpdb->query("INSERT INTO $tablecategories (cat_ID,cat_name) VALUES ('0', '$cat_name')");
|
||||
|
||||
header('Location: b2categories.php');
|
||||
|
||||
@@ -68,12 +67,9 @@ case 'Delete':
|
||||
|
||||
if ($user_level < 3)
|
||||
die ('Cheatin’ uh?');
|
||||
|
||||
$query = "DELETE FROM $tablecategories WHERE cat_ID = $cat_ID";
|
||||
$result = mysql_query($query) or die("Couldn't delete category <b>$cat_name</b>".mysql_error());
|
||||
|
||||
$query = "UPDATE $tableposts SET post_category='1' WHERE post_category='$cat_ID'";
|
||||
$result = mysql_query($query) or die("Couldn't reset category on posts where category was <b>$cat_name</b>");
|
||||
|
||||
$wpdb->query("DELETE FROM $tablecategories WHERE cat_ID = $cat_ID");
|
||||
$wpdb->query("UPDATE $tableposts SET post_category='1' WHERE post_category='$cat_ID'");
|
||||
|
||||
header('Location: b2categories.php');
|
||||
|
||||
@@ -113,8 +109,7 @@ case 'editedcat':
|
||||
$cat_name = addslashes($HTTP_POST_VARS["cat_name"]);
|
||||
$cat_ID = addslashes($HTTP_POST_VARS["cat_ID"]);
|
||||
|
||||
$query = "UPDATE $tablecategories SET cat_name='$cat_name' WHERE cat_ID = $cat_ID";
|
||||
$result = mysql_query($query) or die("Couldn't edit category <b>$cat_name</b>: ".mysql_error());
|
||||
$wpdb->query("UPDATE $tablecategories SET cat_name='$cat_name' WHERE cat_ID = $cat_ID");
|
||||
|
||||
header('Location: b2categories.php');
|
||||
|
||||
|
||||
Reference in New Issue
Block a user