The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
Ranking Dropdowns (non-duplicates)
What I'm trying to do is have the user rank from 1-25 (or something like that) a list of items. I don't want the numbers to be repeated, so there needs to be some kind of validation to where it removes or changes the selection if you pick/type a duplicate.
Are dropdowns the easiest way to go here? If so, i haven't found anywhere how to accomplish this. Can anybody point me in the right direction or give me some advice on how to accomplish this? |
#2
|
|||
|
|||
When I made a ranking system for a ladder system, I used this code.
PHP Code:
Then when I wanted to get it for a individual clan, I used this code PHP Code:
|
#3
|
|||
|
|||
Thanks for the quick reply. I'm however, looking to commit the value (eventually) to the database (and am using it on a form). My intention is to use it in the VBContest hack I created.
It is a pick 'em contest for sports. What I want to have is "confidence" ranking where you just don't pick the winner of each game, you pick the winner and assign a confidence value (1-20). If you win, you get that value. If you lose, you get zero. Adds another dimension to the game. If you do ESPN Bowl Pick 'Em -- it's just like that. |
#4
|
|||
|
|||
You can have a column in like your user table called confidence_points. This column will hold the points they have gain total. When a user goes to assign a confidence value, the game id(if are you wanting to use it or you can use a different way to tell games part) and the value is stored in a new table. When the game is finished/reported into system, the system will then find all the users that guess correct and add the points to the column confidence_points.
Then a query like this can determine who has the most points. [SQL] SELECT * FROM users ORDER BY confidence_points + 0 DESC LIMIT 30 [/SQL] There is still a lot to fill in the system but that should get you the basic ranking system. Sorry I never played ESPN Bowl Pick 'Em but this my understanding of their system after a quick look through. |
#5
|
|||
|
|||
For example:
On the entry form, we list 20 games (Texas vs Texas A&M, etc). They pick a winner, then in another field, rank it in confidence 1-20. I need a way to make sure they don't duplicate the ranking in more than one game. That's what I'm looking for. I don't want them to be able to put Texas A&M as 18 and Michigan as 18. |
#6
|
|||
|
|||
You can have a table like this.
[SQL] CREATE TABLE `games` ( `gameid` int(10) NOT NULL auto_increment, `week` mediumint(5) NOT NULL default '0', `hometeam` varchar(255) NOT NULL default '', `visitingteam` varchar(255) NOT NULL default '' ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=0 ;[/SQL] Then a table like this. [SQL] CREATE TABLE `confidence_choices` ( `gameid` int(10) NOT NULL auto_increment, `userid` int(10) NOT NULL default '0', `week` mediumint(5) NOT NULL default '0', `confidence_points` mediumint(2) NOT NULL defaut '0' )ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=0; [/SQL] Then when they send in their confidence points, you just run a query like this. PHP Code:
|
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|