[geeklog-cvs] geeklog: Use DB_change instead of DB_query("UPDATE")
geeklog-cvs at lists.geeklog.net
geeklog-cvs at lists.geeklog.net
Sat Mar 21 13:50:06 EDT 2009
details: http://project.geeklog.net/cgi-bin/hgweb.cgi/rev/ec56b7a42fbc
changeset: 6846:ec56b7a42fbc
user: Dirk Haun <dirk at haun-online.de>
date: Sat Mar 21 16:45:41 2009 +0100
description:
Use DB_change instead of DB_query("UPDATE")
diffstat:
1 file changed, 8 insertions(+), 4 deletions(-)
public_html/admin/plugins.php | 12 ++++++++----
diffs (38 lines):
diff -r 4becf2221952 -r ec56b7a42fbc public_html/admin/plugins.php
--- a/public_html/admin/plugins.php Sat Mar 21 16:10:04 2009 +0100
+++ b/public_html/admin/plugins.php Sat Mar 21 16:45:41 2009 +0100
@@ -175,10 +175,12 @@
$P = DB_fetchArray($rst);
if (isset($pi_name_arr[$P['pi_name']]) && ($P['pi_enabled'] == 0)) { // enable it
PLG_enableStateChange($P['pi_name'], true);
- DB_query("UPDATE {$_TABLES['plugins']} SET pi_enabled = 1 WHERE pi_name = '{$P['pi_name']}'");
+ DB_change($_TABLES['plugins'], 'pi_enabled', 1,
+ 'pi_name', $P['pi_name']);
} elseif (!isset($pi_name_arr[$P['pi_name']]) && $P['pi_enabled'] == 1) { // disable it
PLG_enableStateChange($P['pi_name'], false);
- DB_query("UPDATE {$_TABLES['plugins']} SET pi_enabled = 0 WHERE pi_name = '{$P['pi_name']}'");
+ DB_change($_TABLES['plugins'], 'pi_enabled', 0,
+ 'pi_name', $P['pi_name']);
}
}
}
@@ -611,7 +613,8 @@
if ($pi_was_enabled) {
// disable temporarily while we move the files around
- DB_query("UPDATE {$_TABLES['plugins']} SET pi_enabled = 0 WHERE pi_name = '$dirname'");
+ DB_change($_TABLES['plugins'], 'pi_enabled', 0,
+ 'pi_name', $dirname);
}
require_once 'System.php';
@@ -748,7 +751,8 @@
}
if ($pi_was_enabled) {
- DB_query("UPDATE {$_TABLES['plugins']} SET pi_enabled = 1 WHERE pi_name = '$dirname'");
+ DB_change($_TABLES['plugins'], 'pi_enabled', 1,
+ 'pi_name', $dirname);
}
}
More information about the geeklog-cvs
mailing list