fix fourm errors under postgresql
This commit is contained in:
parent
87065d08f6
commit
ddb6d32e29
@ -330,7 +330,7 @@ class Forum extends Extension {
|
|||||||
private function save_new_thread($user)
|
private function save_new_thread($user)
|
||||||
{
|
{
|
||||||
$title = html_escape($_POST["title"]);
|
$title = html_escape($_POST["title"]);
|
||||||
$sticky = html_escape($_POST["sticky"]);
|
$sticky = !empty($_POST["sticky"]) ? html_escape($_POST["sticky"]) : "N";
|
||||||
|
|
||||||
if($sticky == ""){
|
if($sticky == ""){
|
||||||
$sticky = "N";
|
$sticky = "N";
|
||||||
@ -344,11 +344,11 @@ class Forum extends Extension {
|
|||||||
(?, ?, ?, now(), now())",
|
(?, ?, ?, now(), now())",
|
||||||
array($title, $sticky, $user->id));
|
array($title, $sticky, $user->id));
|
||||||
|
|
||||||
$result = $database->get_row("SELECT LAST_INSERT_ID() AS threadID", array());
|
$threadID = $database->get_last_insert_id("forum_threads_id_seq");
|
||||||
|
|
||||||
log_info("forum", "Thread {$result["threadID"]} created by {$user->name}");
|
log_info("forum", "Thread {$threadID} created by {$user->name}");
|
||||||
|
|
||||||
return $result["threadID"];
|
return $threadID;
|
||||||
}
|
}
|
||||||
|
|
||||||
private function save_new_post($threadID, $user)
|
private function save_new_post($threadID, $user)
|
||||||
@ -367,9 +367,9 @@ class Forum extends Extension {
|
|||||||
(?, ?, now(), ?)"
|
(?, ?, now(), ?)"
|
||||||
, array($threadID, $userID, $message));
|
, array($threadID, $userID, $message));
|
||||||
|
|
||||||
$result = $database->get_row("SELECT LAST_INSERT_ID() AS postID", array());
|
$postID = $database->get_last_insert_id("forum_posts_id_seq");
|
||||||
|
|
||||||
log_info("forum", "Post {$result["postID"]} created by {$user->name}");
|
log_info("forum", "Post {$postID} created by {$user->name}");
|
||||||
|
|
||||||
$database->execute("UPDATE forum_threads SET uptodate=now() WHERE id=?", array ($threadID));
|
$database->execute("UPDATE forum_threads SET uptodate=now() WHERE id=?", array ($threadID));
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user