Click here to Skip to main content
15,886,026 members
Please Sign up or sign in to vote.
2.40/5 (5 votes)
See more:
I want to create a vote system and I have two ideas:

  1. A vote system where a member will only write player's vote like in boardgame geek site, and the members vote will automatically be submited and then a message from a standard member will be posted summarising the votes of every player. But this sound so difficult to me.
  2. Here's my second idea: This voting system should be a hook or application for my board, where you will input players name [candidates] first from the ADMIN CP. Then a button named "Vote" should appear when a user of a specifiec group wants to post a message. Then it prompt a message which ask you "For whom do you vote?", confirm message, and it will print the results. In the section you vote you can also write a substring of that name of the person you are voting.


So here are my problems:

First about memory & persistence

  1. How to save the members vote in a Database?
  2. How can I stop member if he has voted already?
  3. How to change ones vote?

Second about appearance

  1. How to set this button to the user who created the post?
  2. How to make this button exist only in a specific thread or threads?
  3. How to make this button appear only for users that are in a specifie group?

Third about control and maintaining state

  1. How can I control everytime the candidates, the thread where the button will exist and in which group will it appear?
  2. how will the system react after a vote submitted? It should sent a post of a Specifiec Member (changable everytime) summarizing the votes and after 10-15 posts of other user, it will send again this message.

Please help me! Here is what I tried: http://www.mediafire.com/?au4eqxif6ymqoya[^]

Thanks in advance!

[Moved from Non-Solution by MRB]
Ok here is what should go to ADMIN Control Panel as a Hook probably and the button "vote" should be available when a specific group in a specific thread will post. Below is the code that I had uploaded. This is not about homework, I am studying medicine and I have no idea how to go that deep into these things. I want to do this vote system for my site iPalermo.gr where we are playing the greek version of Werewolf. Anyway thank you for considering to answer me.

HTML
<html>
<head>
<script type="text/javascript">
<!--
var name1 = window.prompt("Admin: input name1")
var name11 = name1.substring(0,3)
var name12 = name1.substring(0,4)
var name13 = name1.substring(0,5)
var name14 = name1.substring(0,6)
var name15 = name1.substring(0,7)
var name16 = name1.substring(0,8)
var name17 = name1.substring(0,9)
var name18 = name1.substring(0,10)
var name19 = name1.substring(0,11)
var name2 = window.prompt("Admin: input name2")


function confirmation(){
var i1=0
var i2=0
	var answer = window.prompt("Player: Which player do you vote for?")
        if (answer===name1 || answer===name11 || answer===name12 || answer===name13 || answer===name14 || answer===name15 || answer===name16 || answer===name17 || answer===name18 || answer===name19){var answer = confirm("are you sure?")
if (answer){i1++
document.write(name1+" "+i1+"<p>"+name2+" "+i2)}}
else if (answer===name2){var answer = confirm("are your sure?")
if (answer){i2++
document.write(name1+" "+i1+"<p>"+name2+" "+i2)}}
else {document.write("this player doesn't exist "+answer)}
	}

-->
</script>
</head>
<body>
<form>
<input type="button" onclick="confirmation()" value="vote">
</form>
</body>
</html>
Posted
Updated 13-Jan-12 3:34am
v3
Comments
R. Giskard Reventlov 12-Jan-12 19:20pm    
No one is going to download a file when they have no idea what's in it, no matter what you say. Second, try doing it first then ask some questions when you get stuck though I would say CP gets hundreds of questions around voting systems every week because they're homework. We don't do homework.
dannaros 13-Jan-12 11:15am    
If you divide the code in 3 parts, the first part where we have the input values. this must be in admin cp. the second is the counting system which, and the third is the button.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900