forked from Cavemanon/cavepaintings
use wrapped database execute function
git-svn-id: file:///home/shish/svn/shimmie2/trunk@129 7f39781d-f577-437e-ae19-be835c7a54ca
This commit is contained in:
@@ -46,15 +46,15 @@ class Config {
|
||||
foreach($this->values as $name => $value) {
|
||||
// does "or update" work with sqlite / postgres?
|
||||
$database->db->StartTrans();
|
||||
$database->db->Execute("DELETE FROM config WHERE name = ?", array($name));
|
||||
$database->db->Execute("INSERT INTO config VALUES (?, ?)", array($name, $value));
|
||||
$database->Execute("DELETE FROM config WHERE name = ?", array($name));
|
||||
$database->Execute("INSERT INTO config VALUES (?, ?)", array($name, $value));
|
||||
$database->db->CommitTrans();
|
||||
}
|
||||
}
|
||||
else {
|
||||
$database->db->StartTrans();
|
||||
$database->db->Execute("DELETE FROM config WHERE name = ?", array($name));
|
||||
$database->db->Execute("INSERT INTO config VALUES (?, ?)", array($name, $this->values[$name]));
|
||||
$database->Execute("DELETE FROM config WHERE name = ?", array($name));
|
||||
$database->Execute("INSERT INTO config VALUES (?, ?)", array($name, $this->values[$name]));
|
||||
$database->db->CommitTrans();
|
||||
}
|
||||
}
|
||||
|
@@ -157,7 +157,7 @@ class ImageIO extends Extension {
|
||||
}
|
||||
|
||||
// actually insert the info
|
||||
$database->db->Execute(
|
||||
$database->Execute(
|
||||
"INSERT INTO images(owner_id, owner_ip, filename, filesize, hash, ext, width, height, posted) ".
|
||||
"VALUES (?, ?, ?, ?, ?, ?, ?, ?, now())",
|
||||
array($user->id, $_SERVER['REMOTE_ADDR'], $image->filename, $image->filesize,
|
||||
|
@@ -77,7 +77,7 @@ class TagEdit extends Extension {
|
||||
private function mass_tag_edit($search, $replace) {
|
||||
// FIXME: deal with collisions
|
||||
global $database;
|
||||
$database->db->Execute("UPDATE tags SET tag=? WHERE tag=?", Array($replace, $search));
|
||||
$database->Execute("UPDATE tags SET tag=? WHERE tag=?", Array($replace, $search));
|
||||
}
|
||||
// }}}
|
||||
// HTML {{{
|
||||
|
@@ -156,7 +156,7 @@ class UserPage extends Extension {
|
||||
$email = isset($_POST['email']) ? $_POST['email'] : null;
|
||||
|
||||
// FIXME: send_event()
|
||||
$database->db->Execute(
|
||||
$database->Execute(
|
||||
"INSERT INTO users (name, pass, joindate, email) VALUES (?, ?, now(), ?)",
|
||||
array($name, $hash, $email));
|
||||
|
||||
@@ -209,7 +209,7 @@ class UserPage extends Extension {
|
||||
|
||||
// FIXME: send_event()
|
||||
// FIXME: $duser->set_pass();
|
||||
$database->db->Execute(
|
||||
$database->Execute(
|
||||
"UPDATE users SET pass = ? WHERE id = ?",
|
||||
array($hash, $id));
|
||||
|
||||
|
@@ -31,8 +31,7 @@ class User {
|
||||
global $database;
|
||||
|
||||
$yn = $enabled ? 'Y' : 'N';
|
||||
$database->db->Execute("UPDATE users SET enabled=? WHERE id=?",
|
||||
array($yn, $this->id));
|
||||
$database->Execute("UPDATE users SET enabled=? WHERE id=?", array($yn, $this->id));
|
||||
}
|
||||
|
||||
public function is_admin() {
|
||||
@@ -43,8 +42,7 @@ class User {
|
||||
global $database;
|
||||
|
||||
$yn = $admin ? 'Y' : 'N';
|
||||
$database->db->Execute("UPDATE users SET admin=? WHERE id=?",
|
||||
array($yn, $this->id));
|
||||
$database->Execute("UPDATE users SET admin=? WHERE id=?", array($yn, $this->id));
|
||||
}
|
||||
|
||||
public function get_days_old() {
|
||||
|
Reference in New Issue
Block a user