From f23cf990315f3dfae22378e7edd542b88e72aa09 Mon Sep 17 00:00:00 2001 From: monster860 Date: Sat, 25 Feb 2017 18:56:58 -0500 Subject: [PATCH] Remove the commented out code --- code/modules/admin/create_poll.dm | 78 ------------------------------- 1 file changed, 78 deletions(-) diff --git a/code/modules/admin/create_poll.dm b/code/modules/admin/create_poll.dm index fafcb533c06..1239bfd993a 100644 --- a/code/modules/admin/create_poll.dm +++ b/code/modules/admin/create_poll.dm @@ -199,82 +199,4 @@ function onload() { log_game("SQL ERROR obtaining id from poll_question table. Error : \[[err]\]\n") return create_poll_window("Your poll has been successfully created") - return pollid - /* - var/question = input("Write your question","Question") as message|null - if(!question) - return - question = sanitizeSQL(question) - var/DBQuery/query_polladd_question = dbcon.NewQuery("INSERT INTO [format_table_name("poll_question")] (polltype, starttime, endtime, question, adminonly, multiplechoiceoptions, createdby_ckey, createdby_ip) VALUES ('[polltype]', '[starttime]', '[endtime]', '[question]', '[adminonly]', '[choice_amount]', '[sql_ckey]', '[address]')") - if(!query_polladd_question.Execute()) - var/err = query_polladd_question.ErrorMsg() - log_game("SQL ERROR adding new poll question to table. Error : \[[err]\]\n") - return - if(polltype == POLLTYPE_TEXT) - log_admin("[key_name(usr)] has created a new server poll. Poll type: [polltype] - Admin Only: [adminonly ? "Yes" : "No"] - Question: [question]") - message_admins("[key_name_admin(usr)] has created a new server poll. Poll type: [polltype] - Admin Only: [adminonly ? "Yes" : "No"]
Question: [question]") - return - var/pollid = 0 - var/DBQuery/query_get_id = dbcon.NewQuery("SELECT id FROM [format_table_name("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() - log_game("SQL ERROR obtaining id from poll_question table. Error : \[[err]\]\n") - return - if(query_get_id.NextRow()) - pollid = query_get_id.item[1] - var/add_option = 1 - while(add_option) - var/option = input("Write your option",POLLTYPE_OPTION) as message|null - if(!option) - return pollid - option = sanitizeSQL(option) - var/percentagecalc - switch(alert("Calculate option results as percentage?",,"Yes","No","Cancel")) - if("Yes") - percentagecalc = 1 - if("No") - percentagecalc = 0 - else - return pollid - var/minval = 0 - var/maxval = 0 - var/descmin = "" - var/descmid = "" - var/descmax = "" - if(polltype == POLLTYPE_RATING) - minval = input("Set minimum rating value.","Minimum rating") as num|null - if(!minval) - return pollid - maxval = input("Set maximum rating value.","Maximum rating") as num|null - if(!maxval) - return pollid - if(minval >= maxval) - to_chat(src, "Minimum rating value can't be more than maximum rating value") - return pollid - descmin = input("Optional: Set description for minimum rating","Minimum rating description") as message|null - if(descmin) - descmin = sanitizeSQL(descmin) - else if(descmin == null) - return pollid - descmid = input("Optional: Set description for median rating","Median rating description") as message|null - if(descmid) - descmid = sanitizeSQL(descmid) - else if(descmid == null) - return pollid - descmax = input("Optional: Set description for maximum rating","Maximum rating description") as message|null - if(descmax) - descmax = sanitizeSQL(descmax) - else if(descmax == null) - return pollid - var/DBQuery/query_polladd_option = dbcon.NewQuery("INSERT INTO [format_table_name("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() - log_game("SQL ERROR adding new poll option to table. Error : \[[err]\]\n") - return pollid - switch(alert(" ",,"Add option","Finish")) - if("Add option") - add_option = 1 - if("Finish") - add_option = 0 - */ return pollid \ No newline at end of file