mirror of
https://github.com/yogstation13/Yogstation.git
synced 2025-02-26 09:04:50 +00:00
adds dontshow column to poll creation and schema
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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 */;
|
||||
|
||||
@@ -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 */;
|
||||
|
||||
@@ -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")
|
||||
|
||||
Reference in New Issue
Block a user