mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2026-08-24 21:40:55 +01:00
Ports the TG globals controller and converts globals. (#18057)
* SDQL2 update * fix that verb * cl * fix that * toworld * this is pointless * update info * siiiiick.. * vv edit update * fix that * fix editing vars * fix VV * Port the /TG/ globals controller. * part 1 * part 2 * oops * part 3 * Hollow Purple * sadas * bsbsdb * muda na agaki ta * ids 1-15 * 16-31 * 41-75 * bring me back to how things used to be before i lost it all * the strength of mayhem * final touches * cl * protect some vars * update sdql2 to use glob * stuff? * forgot that is not defined there * whoops * observ * but it never gets better * a --------- Co-authored-by: Matt Atlas <liermattia@gmail.com>
This commit is contained in:
@@ -4,7 +4,7 @@
|
||||
|
||||
if(!check_rights(R_DEV))
|
||||
return
|
||||
if(!establish_db_connection(dbcon))
|
||||
if(!establish_db_connection(GLOB.dbcon))
|
||||
to_chat(src,"<span class='danger'>Failed to establish database connection.</span>")
|
||||
return
|
||||
var/polltype = input("Choose poll type.","Poll Type") in list("Single Option","Text Reply","Rating","Multiple Choice")
|
||||
@@ -24,7 +24,7 @@
|
||||
if(!endtime)
|
||||
return
|
||||
endtime = sanitizeSQL(endtime)
|
||||
var/DBQuery/query_validate_time = dbcon.NewQuery("SELECT STR_TO_DATE('[endtime]','%Y-%c-%d %T')")
|
||||
var/DBQuery/query_validate_time = GLOB.dbcon.NewQuery("SELECT STR_TO_DATE('[endtime]','%Y-%c-%d %T')")
|
||||
if(!query_validate_time.Execute())
|
||||
var/err = query_validate_time.ErrorMsg()
|
||||
to_chat(src, "SQL ERROR validating endtime. Error : \[[err]\]\n")
|
||||
@@ -34,7 +34,7 @@
|
||||
if(!endtime)
|
||||
to_chat(src, "Datetime entered is invalid.")
|
||||
return
|
||||
var/DBQuery/query_time_later = dbcon.NewQuery("SELECT DATE('[endtime]') < NOW()")
|
||||
var/DBQuery/query_time_later = GLOB.dbcon.NewQuery("SELECT DATE('[endtime]') < NOW()")
|
||||
if(!query_time_later.Execute())
|
||||
var/err = query_time_later.ErrorMsg()
|
||||
to_chat(src, "SQL ERROR comparing endtime to NOW(). Error : \[[err]\]\n")
|
||||
@@ -73,13 +73,13 @@
|
||||
if(!question)
|
||||
return
|
||||
question = sanitizeSQL(question)
|
||||
var/DBQuery/query_polladd_question = dbcon.NewQuery("INSERT INTO ss13_poll_question (polltype, starttime, endtime, question, adminonly, multiplechoiceoptions, createdby_ckey, createdby_ip, publicresult, viewtoken, link) VALUES ('[polltype]', '[starttime]', '[endtime]', '[question]', '[adminonly]', '[choice_amount]', '[sql_ckey]', '[address]', '[publicresult]', [viewtoken], [link])")
|
||||
var/DBQuery/query_polladd_question = GLOB.dbcon.NewQuery("INSERT INTO ss13_poll_question (polltype, starttime, endtime, question, adminonly, multiplechoiceoptions, createdby_ckey, createdby_ip, publicresult, viewtoken, link) VALUES ('[polltype]', '[starttime]', '[endtime]', '[question]', '[adminonly]', '[choice_amount]', '[sql_ckey]', '[address]', '[publicresult]', [viewtoken], [link])")
|
||||
if(!query_polladd_question.Execute())
|
||||
var/err = query_polladd_question.ErrorMsg()
|
||||
to_chat(src,"SQL ERROR adding new poll question to table. Error : \[[err]\]\n")
|
||||
return
|
||||
var/pollid = 0
|
||||
var/DBQuery/query_get_id = dbcon.NewQuery("SELECT id FROM ss13_poll_question WHERE question = '[question]' AND starttime = '[starttime]' AND endtime = '[endtime]' AND createdby_ckey = '[sql_ckey]' AND createdby_ip = '[address]'")
|
||||
var/DBQuery/query_get_id = GLOB.dbcon.NewQuery("SELECT id FROM ss13_poll_question WHERE question = '[question]' AND starttime = '[starttime]' AND endtime = '[endtime]' AND createdby_ckey = '[sql_ckey]' AND createdby_ip = '[address]'")
|
||||
if(!query_get_id.Execute())
|
||||
var/err = query_get_id.ErrorMsg()
|
||||
to_chat(src,"SQL ERROR obtaining id from poll_question table. Error : \[[err]\]\n")
|
||||
@@ -130,7 +130,7 @@
|
||||
descmax = input("Optional: Set description for maximum rating","Maximum rating description") as message
|
||||
if(descmax)
|
||||
descmax = sanitizeSQL(descmax)
|
||||
var/DBQuery/query_polladd_option = dbcon.NewQuery("INSERT INTO ss13_poll_option (pollid, text, percentagecalc, minval, maxval, descmin, descmid, descmax) VALUES ('[pollid]', '[option]', '[percentagecalc]', '[minval]', '[maxval]', '[descmin]', '[descmid]', '[descmax]')")
|
||||
var/DBQuery/query_polladd_option = GLOB.dbcon.NewQuery("INSERT INTO ss13_poll_option (pollid, text, percentagecalc, minval, maxval, descmin, descmid, descmax) VALUES ('[pollid]', '[option]', '[percentagecalc]', '[minval]', '[maxval]', '[descmin]', '[descmid]', '[descmax]')")
|
||||
if(!query_polladd_option.Execute())
|
||||
var/err = query_polladd_option.ErrorMsg()
|
||||
to_chat(src, "SQL ERROR adding new poll option to table. Error : \[[err]\]\n")
|
||||
|
||||
Reference in New Issue
Block a user