We hope you enjoy your visit.

You're currently viewing our forum as a guest. This means you are limited to certain areas of the board and there are some features you can't use. If you join our community, you'll be able to access member-only sections, and use many member-only features such as customizing your profile, sending personal messages, and voting in polls. Registration is simple, fast, and completely free.


Join our community!


If you're already a member please log in to your account to access all of our features:

Username:   Password:
Locked Topic
[ C ] Pool
Topic Started: Aug 11 2012, 06:07 AM (624 Views)
Pk Magic Hat
Member Avatar
Irritating requester
[ *  * ]
Board Address: s3.zetaboards.com/kazilion/index
Board Software: Zetaboards
Description:

I want a code which works with a webpage to make a football pool. Preview: http://eredivisie.voorspellen.nl/

You could fill in the scores you think and after the match an admin can fill in the score once, and the code will automatically give points (and put them into a ranking list) to the person when having the score correct, the winner correct or the score of one of the teams.
Edited by Pk Magic Hat, Aug 11 2012, 06:57 AM.
Offline Profile Goto Top
 
Ferby
Member Avatar
Developer
[ *  *  *  *  * ]
No one can do AIO requests since its hosted on a server. If you want it to give point/money you'll have to ask Viral. But as for the webpage, it'll be simple CSS+HTML. I could code it for you but I doubt I'll have the time for it since I'm mostly busy. But if no one else will I can see what I can do.
Offline Profile Goto Top
 
Pk Magic Hat
Member Avatar
Irritating requester
[ *  * ]
Thanks for the reply :)

Maybe there could be a ranking list instead then, to see the points..
Offline Profile Goto Top
 
Ferby
Member Avatar
Developer
[ *  *  *  *  * ]
Okay I'll see what I can do then. I'll try to do it with Javascript so its an easier thing to look at & work with. I can't make any promises though
Okay heres the code I wrote (with help from Cory of course)

Code:
 
<table id="resultsTable">
<tr>
<th colspan="2">Latest match</th>
</tr>
<tr>
<td class="team" id="match"></td>
<td id="results" class="results"></td>
</tr>
</table>

<script type="text/javascript">
var showResults = "yes"; // set to no if you want to disable
var disabledMessage = "Please post your prediction"; // The message that will display if disabled

var match = ["Man U", "5", "Liverpool", "2"];

if (showResults === "yes") {
document.getElementById("match").innerHTML = match[0] + " VS " + match[2];
document.getElementById("results").innerHTML = match[1] + " - " + match[3];
} else {
document.getElementById("results").innerHTML = "<em>" + disabledMessage + "</em>";
document.getElementById("match").innerHTML = match[0] + " VS " + match[2];
}
</script>

<style type="text/css">
table#resultsTable { text-align: center; }
td.team { background: url(http://z5.ifrm.com/30148/197/0/f5128866/footballbg.png); color: white; text-shadow: 2px 1px black; width: 70%; font-size: 30px; }
td.results { background: url(http://z5.ifrm.com/30148/197/0/f5128866/footballbg.png); color: #FFD326; text-shadow: 2px 1px black; font-weight: bold; font-size: 26px}
</style>

Things you should edit
Code:
 
var match = ["Man U", "5", "Liverpool", "2"];
How this works is ["TEAM1", "TEAM1_SCORE", "TEAM2", "TEAM2_SCORE"]
If the match hasn't played yet you might wanna edit showResults = 'no'. This is the message that will appear instead of the results
Code:
 
var disabledMessage = "Please post your prediction";

I just put in some basic colour for the CSS so feel free to edit that as you wish. It works best on dark themes since I based the colour scheme off the webpage you linked in the request. The only problem is that you can't put more than one match down since I'm not sure how to properly code that since I'm only a beginner with Javascript so sorry about that :/
Edited by Ferby, Aug 28 2012, 10:17 AM.
Offline Profile Goto Top
 
Pk Magic Hat
Member Avatar
Irritating requester
[ *  * ]
Thank you :D Is there also a possibility for Admins to see the predictions of the members?
Offline Profile Goto Top
 
Ferby
Member Avatar
Developer
[ *  *  *  *  * ]
I'd get people to post their predictions into a topic. I'm not very good with Javascript and I do apologise for that :/
Offline Profile Goto Top
 
Pk Magic Hat
Member Avatar
Irritating requester
[ *  * ]
Haha well thank you very much for trying Ferby :) I really appreciate your help.

I would mark this topic as completed :).
Offline Profile Goto Top
 
Steve
Member Avatar
patriot
[ *  *  *  *  *  *  *  *  *  * ]
Completed!

Your request has been completed. If you have any questions or concerns regarding the state of your request, please feel free to contact me via PM.
Offline Profile Goto Top
 
1 user reading this topic (1 Guest and 0 Anonymous)
« Previous Topic · Closed Requests · Next Topic »
Locked Topic