and finally, the modules folder. Now I can publish and take a break
This commit is contained in:
@@ -206,7 +206,7 @@
|
||||
if(dat)
|
||||
user << browse("<TT><I>Penned by [author].</I></TT> <BR>" + "[dat]", "window=book[window_size != null ? ";size=[window_size]" : ""]")
|
||||
user.visible_message("[user] opens a book titled \"[title]\" and begins reading intently.")
|
||||
user.SendSignal(COMSIG_ADD_MOOD_EVENT, "book_nerd", /datum/mood_event/book_nerd)
|
||||
SEND_SIGNAL(user, COMSIG_ADD_MOOD_EVENT, "book_nerd", /datum/mood_event/book_nerd)
|
||||
onclose(user, "book")
|
||||
else
|
||||
to_chat(user, "<span class='notice'>This book is completely blank!</span>")
|
||||
|
||||
@@ -41,6 +41,8 @@
|
||||
if(1)
|
||||
if (!SSdbcore.Connect())
|
||||
dat += "<font color=red><b>ERROR</b>: Unable to contact External Archive. Please contact your system administrator for assistance.</font><BR>"
|
||||
else if(QDELETED(user))
|
||||
return
|
||||
else if(!SQLquery)
|
||||
dat += "<font color=red><b>ERROR</b>: Malformed search request. Please contact your system administrator for assistance.</font><BR>"
|
||||
else
|
||||
@@ -50,12 +52,16 @@
|
||||
var/datum/DBQuery/query_library_list_books = SSdbcore.NewQuery(SQLquery)
|
||||
if(!query_library_list_books.Execute())
|
||||
dat += "<font color=red><b>ERROR</b>: Unable to retrieve book listings. Please contact your system administrator for assistance.</font><BR>"
|
||||
while(query_library_list_books.NextRow())
|
||||
var/author = query_library_list_books.item[1]
|
||||
var/title = query_library_list_books.item[2]
|
||||
var/category = query_library_list_books.item[3]
|
||||
var/id = query_library_list_books.item[4]
|
||||
dat += "<tr><td>[author]</td><td>[title]</td><td>[category]</td><td>[id]</td></tr>"
|
||||
else
|
||||
while(query_library_list_books.NextRow())
|
||||
var/author = query_library_list_books.item[1]
|
||||
var/title = query_library_list_books.item[2]
|
||||
var/category = query_library_list_books.item[3]
|
||||
var/id = query_library_list_books.item[4]
|
||||
dat += "<tr><td>[author]</td><td>[title]</td><td>[category]</td><td>[id]</td></tr>"
|
||||
qdel(query_library_list_books)
|
||||
if(QDELETED(user))
|
||||
return
|
||||
dat += "</table><BR>"
|
||||
dat += "<A href='?src=[REF(src)];back=1'>\[Go Back\]</A><BR>"
|
||||
var/datum/browser/popup = new(user, "publiclibrary", name, 600, 400)
|
||||
@@ -135,6 +141,7 @@ GLOBAL_LIST(cachedbooks) // List of our cached book datums
|
||||
GLOB.cachedbooks = list()
|
||||
var/datum/DBQuery/query_library_cache = SSdbcore.NewQuery("SELECT id, author, title, category FROM [format_table_name("library")] WHERE isnull(deleted)")
|
||||
if(!query_library_cache.Execute())
|
||||
qdel(query_library_cache)
|
||||
return
|
||||
while(query_library_cache.NextRow())
|
||||
var/datum/cachedbook/newbook = new()
|
||||
@@ -143,6 +150,7 @@ GLOBAL_LIST(cachedbooks) // List of our cached book datums
|
||||
newbook.title = query_library_cache.item[3]
|
||||
newbook.category = query_library_cache.item[4]
|
||||
GLOB.cachedbooks += newbook
|
||||
qdel(query_library_cache)
|
||||
|
||||
|
||||
|
||||
@@ -414,12 +422,15 @@ GLOBAL_LIST(cachedbooks) // List of our cached book datums
|
||||
var/sqlauthor = sanitizeSQL(scanner.cache.author)
|
||||
var/sqlcontent = sanitizeSQL(scanner.cache.dat)
|
||||
var/sqlcategory = sanitizeSQL(upload_category)
|
||||
var/msg = "[key_name(usr)] has uploaded the book titled [scanner.cache.name], [length(scanner.cache.dat)] signs"
|
||||
var/datum/DBQuery/query_library_upload = SSdbcore.NewQuery("INSERT INTO [format_table_name("library")] (author, title, content, category, ckey, datetime, round_id_created) VALUES ('[sqlauthor]', '[sqltitle]', '[sqlcontent]', '[sqlcategory]', '[usr.ckey]', Now(), '[GLOB.round_id]')")
|
||||
if(!query_library_upload.Execute())
|
||||
qdel(query_library_upload)
|
||||
alert("Database error encountered uploading to Archive")
|
||||
return
|
||||
else
|
||||
log_game("[key_name(usr)] has uploaded the book titled [scanner.cache.name], [length(scanner.cache.dat)] signs")
|
||||
log_game(msg)
|
||||
qdel(query_library_upload)
|
||||
alert("Upload Complete. Uploaded title will be unavailable for printing for a short period")
|
||||
if(href_list["newspost"])
|
||||
if(!GLOB.news_network)
|
||||
@@ -452,20 +463,23 @@ GLOBAL_LIST(cachedbooks) // List of our cached book datums
|
||||
cooldown = world.time + PRINTER_COOLDOWN
|
||||
var/datum/DBQuery/query_library_print = SSdbcore.NewQuery("SELECT * FROM [format_table_name("library")] WHERE id=[sqlid] AND isnull(deleted)")
|
||||
if(!query_library_print.Execute())
|
||||
qdel(query_library_print)
|
||||
say("PRINTER ERROR! Failed to print document (0x0000000F)")
|
||||
return
|
||||
while(query_library_print.NextRow())
|
||||
var/author = query_library_print.item[2]
|
||||
var/title = query_library_print.item[3]
|
||||
var/content = query_library_print.item[4]
|
||||
var/obj/item/book/B = new(get_turf(src))
|
||||
B.name = "Book: [title]"
|
||||
B.title = title
|
||||
B.author = author
|
||||
B.dat = content
|
||||
B.icon_state = "book[rand(1,8)]"
|
||||
visible_message("[src]'s printer hums as it produces a completely bound book. How did it do that?")
|
||||
if(!QDELETED(src))
|
||||
var/obj/item/book/B = new(get_turf(src))
|
||||
B.name = "Book: [title]"
|
||||
B.title = title
|
||||
B.author = author
|
||||
B.dat = content
|
||||
B.icon_state = "book[rand(1,8)]"
|
||||
visible_message("[src]'s printer hums as it produces a completely bound book. How did it do that?")
|
||||
break
|
||||
qdel(query_library_print)
|
||||
if(href_list["printbible"])
|
||||
if(cooldown < world.time)
|
||||
var/obj/item/storage/book/bible/B = new /obj/item/storage/book/bible(src.loc)
|
||||
|
||||
@@ -60,8 +60,7 @@
|
||||
B.dat = query_get_random_books.item[4]
|
||||
B.name = "Book: [B.title]"
|
||||
B.icon_state= "book[rand(1,8)]"
|
||||
else
|
||||
return
|
||||
qdel(query_get_random_books)
|
||||
|
||||
/obj/structure/bookcase/random/fiction
|
||||
name = "bookcase (Fiction)"
|
||||
|
||||
Reference in New Issue
Block a user