adds dontshow column to poll creation and schema

This commit is contained in:
Jordie0608
2016-07-03 17:25:26 +10:00
parent c5db00bd00
commit c7f567e65a
4 changed files with 21 additions and 1 deletions

View File

@@ -1,3 +1,13 @@
3 July 2016, by Jordie0608
Modified table 'poll_question', adding column 'dontshow' which was recently added to the server schema.
ALTER TABLE `feedback`.`poll_question` ADD COLUMN `dontshow` TINYINT(1) NOT NULL DEFAULT '0' AFTER `for_trialmin`
Remember to add a prefix to the table name if you use them
----------------------------------------------------
16th April 2016
Added ipintel table, only required if ip intel is enabled in the config

View File

@@ -266,6 +266,7 @@ CREATE TABLE `poll_question` (
`createdby_ckey` varchar(45) NULL DEFAULT NULL,
`createdby_ip` varchar(45) NULL DEFAULT NULL,
`for_trialmin` varchar(45) NULL DEFAULT NULL,
`dontshow` tinyint(1) NOT NULL DEFAULT '0',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;

View File

@@ -261,6 +261,7 @@ CREATE TABLE `SS13_poll_question` (
`createdby_ckey` varchar(45) NULL DEFAULT NULL,
`createdby_ip` varchar(45) NULL DEFAULT NULL,
`for_trialmin` varchar(45) NULL DEFAULT NULL,
`dontshow` tinyint(1) NOT NULL DEFAULT '0',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;

View File

@@ -81,12 +81,20 @@
adminonly = 0
else
return
var/dontshow
switch(alert("Hide poll results from tracking until completed?",,"Yes","No","Cancel"))
if("Yes")
dontshow = 1
if("No")
dontshow = 0
else
return
var/sql_ckey = sanitizeSQL(ckey)
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]')")
var/DBQuery/query_polladd_question = dbcon.NewQuery("INSERT INTO [format_table_name("poll_question")] (polltype, starttime, endtime, question, adminonly, multiplechoiceoptions, createdby_ckey, createdby_ip, dontshow) VALUES ('[polltype]', '[starttime]', '[endtime]', '[question]', '[adminonly]', '[choice_amount]', '[sql_ckey]', '[address]', '[dontshow]')")
if(!query_polladd_question.Execute())
var/err = query_polladd_question.ErrorMsg()
log_game("SQL ERROR adding new poll question to table. Error : \[[err]\]\n")