- Made it possible to have admin-only in-game polls.

git-svn-id: http://tgstation13.googlecode.com/svn/trunk@4156 316c924e-a436-60f5-8080-3fe189b3f50e
This commit is contained in:
baloh.matevz
2012-07-23 22:44:53 +00:00
parent e3d3f2b8e9
commit 97bb1fc04b
2 changed files with 8 additions and 2 deletions

View File

@@ -53,7 +53,10 @@
dbcon.Connect("dbi:mysql:[db]:[address]:[port]","[user]","[pass]")
if(dbcon.IsConnected())
var/DBQuery/query = dbcon.NewQuery("SELECT id FROM erro_poll_question WHERE Now() BETWEEN starttime AND endtime AND id NOT IN (SELECT pollid FROM erro_poll_vote WHERE ckey = \"[ckey]\")")
var/isadmin = 0
if(src.client && src.client.holder)
isadmin = 1
var/DBQuery/query = dbcon.NewQuery("SELECT id FROM erro_poll_question WHERE [(isadmin ? "" : "adminonly = false AND")] Now() BETWEEN starttime AND endtime AND id NOT IN (SELECT pollid FROM erro_poll_vote WHERE ckey = \"[ckey]\")")
query.Execute()
var/newpoll = 0
while(query.NextRow())

View File

@@ -67,8 +67,11 @@
var/DBConnection/dbcon = new()
dbcon.Connect("dbi:mysql:[db]:[address]:[port]","[user]","[pass]")
if(dbcon.IsConnected())
var/isadmin = 0
if(src.client && src.client.holder)
isadmin = 1
var/DBQuery/select_query = dbcon.NewQuery("SELECT id, question FROM erro_poll_question WHERE Now() BETWEEN starttime AND endtime")
var/DBQuery/select_query = dbcon.NewQuery("SELECT id, question FROM erro_poll_question WHERE [(isadmin ? "" : "adminonly = false AND")] Now() BETWEEN starttime AND endtime")
select_query.Execute()
var/output = "<div align='center'><B>Player polls</B>"