Top 25 Members' Cars/Motorcycles of Final Gear 2012

No one has called me Mr. Delorean. Hmmm, could get use to it!
 
Ooo, this sounds fun.

What sort of rules? One entry per person? Does it need a thread in Post Your Car or just a good picture and a proof picture?
 
Last edited:
As always it will require a thread in PYC with a proof pic.
 
I was rather bored the other day so I wrote a webscript.
http://jupix.info/fgcar2012/
The back end is about 90% done. Oh and I did change the point system to utilize whole integers and no decimals.

I would just need the help of someone who knows javascript... It is a far better solution to check the "ballot" before the user clicks submit, rather than only doing it in PHP when the form is processed. So, I would need javascript to check that there are under 10 (or 5) checkbox ticks in each category, and that those cars are only ticked in one category. If anyone could write it, that would be awesome.
 
Last edited:
I was rather bored the other day so I wrote a webscript.
http://jupix.info/fgcar2012/
The back end is about 90% done. Oh and I did change the point system to utilize whole integers and no decimals.

I would just need the help of someone who knows javascript... It is a far better solution to check the "ballot" before the user clicks submit, rather than only doing it in PHP when the form is processed. So, I would need javascript to check that there are under 10 (or 5) checkbox ticks in each category, and that those cars are only ticked in one category. If anyone could write it, that would be awesome.

Thats fantastic. To prevent cheating I was thinking about having members PM me for a special per user code then for them to use that to vote.
 
I would just need the help of someone who knows javascript... It is a far better solution to check the "ballot" before the user clicks submit, rather than only doing it in PHP when the form is processed. So, I would need javascript to check that there are under 10 (or 5) checkbox ticks in each category, and that those cars are only ticked in one category. If anyone could write it, that would be awesome.

Give the <form> an ID of "votingform", i.e. <form id="votingform" ... > and then add this to your <head>:

HTML:
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
<script type="text/javascript">
	jQuery(document).ready(function($){

		// Bind some code to the form submit event
		$("#votingform").submit(function(event) {

			// Select all checked checkboxes and count them
			var checked_count = $("#votingform input:checked").length;

			// If there's too many checked...
			if ( checked_count > 5 ) {

				// Tell the user
				alert( "You voted for " + checked_count + " items which is more than the 5 item maximum!" );

				// And prevent the action from occurring (the form submission)
				event.preventDefault();
			}
		});
	});
</script>

jQuery makes Javascript easy. :)

Note that of course you still need to enforce this on the PHP side too because someone could disable Javascript.


EDIT: Oh, I just noticed that the form is more complicated than I thought (people vote for their 1st, 2nd, and 3rd choices). You'll need to modify my code but it's easy enough. http://api.jquery.com/category/selectors/

Also I would randomly sort the cars on each page load so that there's no bias.

If you need any help with this, let me know. I literally do this (PHP development) for a living. :)
 
Last edited:
Thats fantastic. To prevent cheating I was thinking about having members PM me for a special per user code then for them to use that to vote.

That's a real nice idea if you can be arsed to handle the pm thing. I coded the webapp under the assumption you'd had enough of the administrative overhead.


Give the <form> an ID of "votingform", i.e. <form id="votingform" ... > and then add this to your <head>:
(snip)

jQuery makes Javascript easy. :)

Note that of course you still need to enforce this on the PHP side too because someone could disable Javascript.


EDIT: Oh, I just noticed that the form is more complicated than I thought (people vote for their 1st, 2nd, and 3rd choices). You'll need to modify my code but it's easy enough. http://api.jquery.com/category/selectors/

Also I would randomly sort the cars on each page load so that there's no bias.

If you need any help with this, let me know. I literally do this (PHP development) for a living. :)

Thanks for your interest and effort so far! Unfortunately making the necessary modifications would require learning the js syntax and aforementioned library from scratch, which I don't have time for (or interest tbh) at present. The webapps I've written with php so far have utilized very little js and the few scripts I've used have been stock clips. If you could finish the script that would be awesome. I'm guessing to you it would be a breeze.
 
Last edited:
That's a real nice idea if you can be arsed to handle the pm thing. I coded the webapp under the assumption you'd had enough of the administrative overhead.

It's not a big issue for me.
 
Thanks for your interest and effort so far! Unfortunately making the necessary modifications would require learning the js syntax and aforementioned library from scratch, which I don't have time for (or interest tbh) at present. The webapps I've written with php so far have utilized very little js and the few scripts I've used have been stock clips. If you could finish the script that would be awesome. I'm guessing to you it would be a breeze.

If you know PHP, HTML, and CSS, then picking up jQuery wouldn't be that hard but whatever. :?

HTML:
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
<script type="text/javascript">
	jQuery(document).ready(function($){

		// Bind some code to the form submit event
		$("#votingform").submit(function(event) {

			var max_votes_per_type = 5;

			// Each grouping of checkboxes, identified by "name" value
			var voting_types = new Array(
				"v1_options",
				"v2_options",
				"v4_options" // No trailing comma! IE is a piece of shit
			);

			// Loop through each group
			var array_len = voting_types.length;
			for ( var i = 0; i < array_len; i++ ) {
				
				// Select all checked checkboxes and count them
				var checked_count = $("#votingform input[name='" + voting_types[i] + "[]']:checked").length;

				// If there's too many checked...
				if ( checked_count > max_votes_per_type ) {

					// Tell the user
					alert( "You voted for " + checked_count + " items in a single column which is more than the " + max_votes_per_type + " item maximum!" );

					// And prevent the action from occurring (the form submission)
					event.preventDefault();

					// No need to check the other columns
					return;
				}
			}
		});
	});
</script>
 
I will keep the rules as it was last time. 50 post minimum with six months of membership required to have your car nominated. Anyone who meets these requirements may nominate an eligible vehicle.

If there are over 25 nominations there wil be two votes. The first will be for all cars nominated with the top 25 being included in the final vote.
 
All right, the webscript is complete.

I had to make some changes to the js because max_votes_per_type varies between columns.

Anyway, feel free to test: http://jupix.info/fgcar2012/
You can use these codes to test: http://jupix.info/fgcar2012/test_codes.html

edit: mikas didn't want the columns shuffled with respect to each other so they are just "overall" random now
 
Last edited:
edit: mikas didn't want the columns shuffled with respect to each other so they are just "overall" random now

That's the best way IMO.
 
soooo.. Now that Viper's got his Viper hanging out, when's the nomination?
 
Once nominations are done, I'm thinking of having a shorter voting period than last time. Perhaps two weeks?
 
I think we can draw some conclusions from the nomination activity; 2 weeks is plenty, and pretty much an absolute maximum. We might want to consider even going as short as 1 week.
 
Top