Forums › Forums › Get Technical › Software › Displaying places in the voting results page
- This topic has 31 replies, 13 voices, and was last updated 7 years, 3 months ago by
CauseISaidSo.
-
AuthorPosts
-
August 12, 2010 at 10:53 pm #1968
CauseISaidSo
ParticipantI love schnee’s statistics (it’s part of what makes farktography fun, IMHO), but I wish the rankings refreshed a little more frequently.
Maybe I’m the only one, but I check the voting results page often to see how things are going. Since I’m not U-Man or soosh :), I have to count down many (often times many many) entries to see where my pix have placed and how badly my average standings evar stat will be affected.
I considered creating my own stats site, but I just don’t have the time to do that right now, so I went with the next best thing – I whipped up some java script to add places to the existing voting results page. Each entry will look something like this:
I’ve tested this in both IE and Chrome (no Firefox or Safari, but it should work there, too; at worst, it can’t do any harm). To add places to the voting results page:
1) Open the voting results page (you do have it bookmarked, right?)
2) Paste the javascript below (the entire script should be one single line) into the address bar of your browser and press enter.
That’s it! It should work for any week’s contest. Here’s the script:
javascript:var%20n=0,p=0,lv=0,x=$(‘td.commentHeaderRow[colSpan=”3″]%20font’).each(function(){n=n+1;var%20a=$(this).text();a=a.substr(0,a.indexOf(“%20″));if(a!=lv){p=n;lv=a}var%20b=”th”,d=p%25100;if(d<4||d>20){var%20c=p%2510;if(c==1)b=”st”;else%20if(c==2)b=”nd”;else%20if(c==3)b=”rd”}$(this).before(‘‘+p+b+”%20Place%20(Entry%20#”+n+”)“)})
Edited on 2012-Feb-4 to add:
The script above has been updated to match recent Fark HTML changes. Also note that it works on either Best or Funny vote results pages (and also on Photoshop contests).Important note for IE9 users: For some reason, IE9 eats the leading “javascript:” when you first paste it into the broswer address bar. Just go back to front of the address bar and type it back in before pressing Enter and it’ll work.
August 13, 2010 at 12:25 am #32460sleeping
ParticipantNice! And if you paste the code into a bookmark instead of the address bar it’s re-usable.
August 13, 2010 at 12:52 am #32461ravnostic
ParticipantHrmm…why didn’t my comment stick? I think this is way cool. I’ve faired really well these past couple of weeks, but since that isn’t usually the case, this is useful stuff! Thanks for the innovation!
August 13, 2010 at 2:11 am #32462U-Man
ParticipantYep. Works with Firefox, too. Very cool. And thank you for the compliment.
I like this sort of mix of creativity and technical ability. Good stuff.
August 13, 2010 at 2:14 am #32463nobigdeal
ParticipantCool!
August 13, 2010 at 2:47 am #32464Kestrana
ParticipantNvm I got it to work
August 13, 2010 at 2:56 am #32465olavf
ParticipantVery cool. And depressing at the same time…
😉
August 13, 2010 at 3:42 am #32466CauseISaidSo
ParticipantVery cool. And depressing at the same time…
Thanks. And I hear ya.
I think I picked the wrong contest to implement this. Fare thee well, oh Greatest Averages Evar list, I hardly knew ye. 🙁
August 13, 2010 at 4:16 am #32467olavf
ParticipantVery cool. And depressing at the same time…
Thanks. And I hear ya.
I think I picked the wrong contest to implement this. Fare thee well, oh Greatest Averages Evar list, I hardly knew ye. 🙁
You’re pretty new, so it comes and goes. A lot. Give it time 😉
August 13, 2010 at 4:47 am #32468LeicaLens
ParticipantVery useful!
And slightly depressing at the same time.
August 13, 2010 at 7:14 am #32469lokisbong
ParticipantVery cool. And depressing at the same time…
😉
thats what I was just gonna post.
August 13, 2010 at 5:23 pm #32470orionid
ParticipantNice! And if you paste the code into a bookmark instead of the address bar it’s re-usable.
Huzzah!
Awesome code, ’cause. Now, if you write a neat little script to add the bookmark button to the top of the browser, you could market it as a chrome/ie plugin to all the PSers! 😉
September 29, 2010 at 10:47 pm #32471kashari
ParticipantMaybe this would be a good place to ask this question: Why do the final stats skip places? i.e., it will go 1, 2, 4, 5 7, etc.. Awhile ago I looked around and didn’t find an answer, but I may have missed it.
And thanks for this tip, I’ll give it a shot!
September 29, 2010 at 11:28 pm #32472orionid
ParticipantIf there is a tie, it will assign everyone with that number of votes the highest place, then resume at the next available place. So, in your above example, there would be a two-way tie for second place (eating up the #3), and a two way tie for fifth (eating up the #6).
September 29, 2010 at 11:29 pm #32473Kestrana
ParticipantIf there’s a tie, the next rank will be skipped so that the total number of photographs for any given sequence is the same.
So if two people tie for 2nd place, 3rd place will be skipped and the next highest picture will be 4th.
-
AuthorPosts
- The topic ‘Displaying places in the voting results page’ is closed to new replies.