diff --git a/code/modules/mob/new_player/new_player.dm b/code/modules/mob/new_player/new_player.dm index ddd15680763..23fbb250f6c 100644 --- a/code/modules/mob/new_player/new_player.dm +++ b/code/modules/mob/new_player/new_player.dm @@ -48,11 +48,23 @@ output += "

Observe

" - var/DBConnection/dbcon = new() - dbcon.Connect("dbi:mysql:[db]:[address]:[port]","[user]","[pass]") - if(dbcon.IsConnected()) - output += "

Show Player Polls

" - dbcon.Disconnect() + if(!IsGuestKey(src.key)) + var/DBConnection/dbcon = new() + 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]\")") + query.Execute() + var/newpoll = 0 + while(query.NextRow()) + newpoll = 1 + break + + if(newpoll) + output += "

Show Player Polls (NEW!)

" + else + output += "

Show Player Polls

" + dbcon.Disconnect() output += ""