[add_zero(isbn, 4)] | [query.item[2]] | [query.item[3]] | [query.item[4]] | "
dat += "View Content"
dat += "Unflag"
dat += "Delete"
diff --git a/code/modules/library/lib_machines.dm b/code/modules/library/lib_machines.dm
index 316fc48657e..9c9180b4683 100644
--- a/code/modules/library/lib_machines.dm
+++ b/code/modules/library/lib_machines.dm
@@ -26,6 +26,7 @@ GLOBAL_LIST_INIT(library_section_names, list("Any", "Fiction", "Non-Fiction", "A
var/forbidden=0
var/path = /obj/item/book // Type path of the book to generate
var/flagged = 0
+ var/flaggedby
/datum/cachedbook/proc/LoadFromRow(var/list/row)
id = row["id"]
@@ -34,6 +35,7 @@ GLOBAL_LIST_INIT(library_section_names, list("Any", "Fiction", "Non-Fiction", "A
category = row["category"]
ckey = row["ckey"]
flagged = row["flagged"]
+ flaggedby = row["flaggedby"]
if("content" in row)
content = row["content"]
programmatic=0
@@ -80,8 +82,9 @@ GLOBAL_LIST_INIT(library_section_names, list("Any", "Fiction", "Non-Fiction", "A
log_game("[user] (ckey: [user.key]) has flagged book #[id] as inappropriate.")
- var/datum/db_query/query = SSdbcore.NewQuery("UPDATE [format_table_name("library")] SET flagged = flagged + 1 WHERE id=:id", list(
- "id" = text2num(id)
+ var/datum/db_query/query = SSdbcore.NewQuery("UPDATE [format_table_name("library")] SET flagged = flagged + 1, flaggedby=:flaggedby WHERE id=:id", list(
+ "id" = text2num(id),
+ "flaggedby" = user.key
))
if(!query.warn_execute())
qdel(query)
@@ -107,7 +110,7 @@ GLOBAL_LIST_INIT(library_section_names, list("Any", "Fiction", "Non-Fiction", "A
if("[id]" in cached_books)
return cached_books["[id]"]
- var/datum/db_query/query = SSdbcore.NewQuery("SELECT id, author, title, category, content, ckey, flagged FROM [format_table_name("library")] WHERE id=:id", list(
+ var/datum/db_query/query = SSdbcore.NewQuery("SELECT id, author, title, category, content, ckey, flagged, flaggedby FROM [format_table_name("library")] WHERE id=:id", list(
"id" = text2num(id)
))
if(!query.warn_execute())
@@ -124,7 +127,8 @@ GLOBAL_LIST_INIT(library_section_names, list("Any", "Fiction", "Non-Fiction", "A
"category"=query.item[4],
"content" =query.item[5],
"ckey" =query.item[6],
- "flagged" =query.item[7]
+ "flagged" =query.item[7],
+ "flaggedby"=query.item[8]
))
results += CB
cached_books["[id]"]=CB
diff --git a/config/example/dbconfig.txt b/config/example/dbconfig.txt
index 0315c714374..fc1daabda54 100644
--- a/config/example/dbconfig.txt
+++ b/config/example/dbconfig.txt
@@ -9,7 +9,7 @@
## This value must be set to the version of the paradise schema in use.
## If this value does not match, the SQL database will not be loaded and an error will be generated.
## Roundstart will be delayed.
-DB_VERSION 32
+DB_VERSION 33
## Server the MySQL database can be found at.
# Examples: localhost, 200.135.5.43, www.mysqldb.com, etc.
diff --git a/tools/ci/dbconfig.txt b/tools/ci/dbconfig.txt
index 2ad92d39687..6e11f058733 100644
--- a/tools/ci/dbconfig.txt
+++ b/tools/ci/dbconfig.txt
@@ -2,7 +2,7 @@
# Dont use it ingame
# Remember to update this when you increase the SQL version! -aa
SQL_ENABLED
-DB_VERSION 32
+DB_VERSION 33
ADDRESS 127.0.0.1
PORT 3306
FEEDBACK_DATABASE feedback
|