Points in the Picks Grid

Post here to discuss topics relate to the 4.x version for the ASP Football Pool software program. All support topics should go here.
Post Reply
smilrad
Posts: 9
Joined: Tue Aug 26, 2014 11:08 pm

Points in the Picks Grid

Post by smilrad »

Has anyone added code to show the point spreads in the picks grid (weeklyResults.asp)? I'd like to be able to see those details directly in the grid. I was sort of imagining it in the row right above each game.
sledge4
Posts: 28
Joined: Mon Aug 26, 2013 6:31 pm

Re: Points in the Picks Grid

Post by sledge4 »

I've been looking for this as well.
mspslb
Posts: 17
Joined: Thu Sep 04, 2014 6:50 pm

Re: Points in the Picks Grid

Post by mspslb »

I have added this to my page. I have attached the full content of my page and a screen capture of how it looks. FYI - I have made a number of changes to the weeklyresults page, so it is a bit different than the original and is named differently (fullstandings). Two things to note is that I use confidence scoring, but have changed the logic to only require one conf. selection to be made as we use a "lock" pick and if you get it right = +2 points and if wrong =-2. I also show a full year total below the main grid as our main winner is for the year, not the week. So just note that to help explain differences in my page and in the image attached.

The below is the main section of the page that I changed to display the spreads. Up above in the code, you will see that I declared a value of "spreadreverse" (spread already exists). Then later I set spreadreverse= (rs.Fields("PointSpread").Value - (rs.Fields("PointSpread").Value * 2)). So I now have a variable for spread and the reverse of it ( so if spread was 1, spread="1" and spreadreverse="-1"). So if the below checks to see if the the pick is the home or vistor pick. Since spreads are entered based on visitor team, I show the spread value if vistor is selected and spreadreverse if home team is selected. that way each pick for each users has a pick specific spread shown. I also added a line break right before "pick" value is printed to make formatting a bit cleaner. The other piece in the code about confidence = 0 or =2 is because of what I mentioned up above. So I have a rule there to not show the "0" conf values since they mean nothing to our pool. Hope it helps - you don't have to go through all of that, you could just do the spread as is and not check for the home/visitor etc.

Code: Select all

				'When using point spreads, highlight the straight-up result.
				'if it matches the pick.
				if USE_POINT_SPREADS then
					if rs.Fields("Pick").Value = rs.Fields("Result").Value then
						pick = FormatWinner(pick)
					end if
				end if
				'Adds the point spread to the full standings/full picks sheet
				'If Visitor is Picked spread shows as is since spreads are held against visting team
				'If Home is picked, then spread is reversed using valuex(value*2) to inverse plus/minus
				'Also adds a space above pick and does not show the 0 for non-lock picks.  Makes page cleaner.
				if USE_CONFIDENCE_POINTS and rs.Fields("Pick").Value = rs.Fields("HomeID")and rs.Fields("confidence")= 2 then %>				
				<td class="small"><br/><% = pick %>&nbsp;(<%= spreadreverse%>)<br /><font color="mediumorchid"><strong><% = conf %></strong></font></td>
<%				elseif USE_CONFIDENCE_POINTS and rs.Fields("Pick").Value = rs.Fields("HomeID")and rs.Fields("confidence")= 0 then %>
				<td class="small"><% = pick %>&nbsp;(<%= spreadreverse%>)<br/></td>
<%				elseif USE_CONFIDENCE_POINTS and rs.Fields("Pick").Value = rs.Fields("VisitorID")and rs.Fields("confidence")=2 then%>
				<td class="small"><br/><% = pick %>&nbsp;(<%= spread%>)<br /><font color="mediumorchid"><strong><% = conf %></strong></font></td>
<%				elseif USE_CONFIDENCE_POINTS and rs.Fields("Pick").Value = rs.Fields("VisitorID")and rs.Fields("confidence")=0 then%>
				<td class="small"><% = pick %>&nbsp;(<%= spread%>)<br /></td>
				
<%				else %>				
				<td><% = pick %></td>
<%				end if
				rs.MoveNext[search][/search]
			loop
Attachments
fullstandings.zip
(6.04 KiB) Downloaded 298 times
ResultsPage.JPG
sledge4
Posts: 28
Joined: Mon Aug 26, 2013 6:31 pm

Re: Points in the Picks Grid

Post by sledge4 »

Really appreciate your code, will try it.
smilrad
Posts: 9
Joined: Tue Aug 26, 2014 11:08 pm

Re: Points in the Picks Grid

Post by smilrad »

Awesome! Thanks for sharing. I see that you also changed the Score to be a single number (not a ratio), and eliminated the percentage. Those are two things I wanted to do as well.

Thanks!
sledge4
Posts: 28
Joined: Mon Aug 26, 2013 6:31 pm

Re: Points in the Picks Grid

Post by sledge4 »

Has anyone been able to add point spread to only show on one line at the top instead of after every game for every player? IE, under the header row at the top (Name, Week TB, Score).

Thanks
sledge4
Posts: 28
Joined: Mon Aug 26, 2013 6:31 pm

Re: Points in the Picks Grid

Post by sledge4 »

^Bump

Hoping someone has a possible solution to only showing the spread at the top, instead next to each pick.
Post Reply