How to change the colors of the Winning and Losing picks on
How to change the colors of the Winning and Losing picks on
I had done this last year, and I forgot about it until today. I have changed the code in the /includes/common.asp file to make it so that a Correct pick and an Incorrect Pick now are different colors than an unplayed game.
So by default all the program did was to make a correct pick "BOLD" but still black. An incorrect pick had a line put through it, and those were good, but I wanted to have more. So now I make my correct picks turn "lime green" and my incorrect picks still have a line put through them, but they also turn "red". Any unplayed games still show in the black. So it is really easy to see results on the page.
To accomplish this open your /includes/common.asp file and then:
Find for an "Incorrect Pick":
Change it to look like this:
Now Find for a Winning Pick:
And change it to look like this:
Where you see the "color:xxxxxxx" parameter, feel free to change to to any colors you like, but here is how mine looks as of now, or at least a snippet of it so you can see a preview.
Hope this helps.
Phil
So by default all the program did was to make a correct pick "BOLD" but still black. An incorrect pick had a line put through it, and those were good, but I wanted to have more. So now I make my correct picks turn "lime green" and my incorrect picks still have a line put through them, but they also turn "red". Any unplayed games still show in the black. So it is really easy to see results on the page.
To accomplish this open your /includes/common.asp file and then:
Find for an "Incorrect Pick":
Code: Select all
'--------------------------------------------------------------------------
' Formats a string to indicate an incorrect pick.
'--------------------------------------------------------------------------
function FormatIncorrectPick(str)
FormatIncorrectPick = "<span style=""text-decoration: line-through;"">" & str & "</span>"
end function
Code: Select all
'--------------------------------------------------------------------------
' Formats a string to indicate an incorrect pick.
'--------------------------------------------------------------------------
function FormatIncorrectPick(str)
FormatIncorrectPick = "<span style=""text-decoration: line-through; color:red"">" & str & "</span>"
end function
Code: Select all
' Formats a string to indicate the game winner.
'--------------------------------------------------------------------------
function FormatWinner(str)
if USE_POINT_SPREADS then
FormatWinner = "<em>" & str & "</em>"
else
FormatWinner = "<strong>" & str & "</strong>"
end if
end function
Code: Select all
'--------------------------------------------------------------------------
' Formats a string to indicate the game winner.
'--------------------------------------------------------------------------
function FormatWinner(str)
if USE_POINT_SPREADS then
FormatWinner = "<em>" & str & "</em>"
else
FormatWinner = "<span style=""color:limegreen; Font-weight:bold;"">" & str & "</span>"
end if
end function
Hope this helps.
Phil
Re: How to change the colors of the Winning and Losing picks
Thought I would bump this to the top for 2014 as it kind of got buried. A simple change, but I think it really adds to the results page personally.
Phil
Phil
-
- Posts: 11
- Joined: Fri Jul 18, 2014 10:35 am
Re: How to change the colors of the Winning and Losing picks
nice tweak. just added it to mine.
Re: How to change the colors of the Winning and Losing picks
Very Nice.. it seems to carry over to the weekly schedule.. the winner is in green but the loser is not in red or the strike through.. is there a way to get it there also...
Re: How to change the colors of the Winning and Losing picks
I will have to look at the code more that wasn't my intention so it might take some digging. Probably won't get to it until Monday though.
Phil
Phil
Re: How to change the colors of the Winning and Losing picks
Great... thanks for taking a look at it.
Re: How to change the colors of the Winning and Losing picks
Ok, here is what you need to edit in the "weeklySchedule.asp" file:
Open your weeklySchedule.asp file in an editor and find the following:
Find this:
Replace it with this:
That will do the weekly schedule, but you can also do the Weeklyentry.asp file as well. Not sure if you want this, but I noticed it was doing it there as well, so here is how to do that also.
Open your weeklyEntry.asp file:
Find this:
Replace it with this:
Hope that is what you were looking for.
Phil
Open your weeklySchedule.asp file in an editor and find the following:
Find this:
Code: Select all
'Highlight the results.
if result = vid then
visitor = FormatWinner(visitor)
vscore = FormatWinner(vscore)
elseif result = rs.Fields("HomeID").Value then
home = FormatWinner(home)
hscore = FormatWinner(hscore)
end if
Code: Select all
'Highlight the results.
if result = vid then
visitor = FormatWinner(visitor)
vscore = FormatWinner(vscore)
home = FormatIncorrectPick(home)
hscore = (hscore)
elseif result = rs.Fields("HomeID").Value then
home = FormatWinner(home)
hscore = FormatWinner(hscore)
visitor = FormatIncorrectPick(visitor)
vscore = (vscore)
end if
Open your weeklyEntry.asp file:
Find this:
Code: Select all
'Highlight fields based on the game result.
if games(i).result = games(i).visitorID then
visitor = FormatWinner(visitor)
elseif games(i).result = games(i).homeID then
home = FormatWinner(home)
elseif games(i).result = TIE_STR then
tie = FormatWinner(TIE_STR)
end if
Code: Select all
'Highlight fields based on the game result.
if games(i).result = games(i).visitorID then
visitor = FormatWinner(visitor)
home = FormatIncorrectPick(home)
elseif games(i).result = games(i).homeID then
home = FormatWinner(home)
visitor = FormatIncorrectPick(visitor)
elseif games(i).result = TIE_STR then
tie = FormatWinner(TIE_STR)
end if
Phil
Re: How to change the colors of the Winning and Losing picks on
Got it... its working like a charm on both the weekly schedule and weekly entry !! Thanks for your help
Re: How to change the colors of the Winning and Losing picks on
I'm late to the party here, but I did all the updates noted in common.asp, yet I don't see these taking effect on the weeklyResults.asp page. Are there a different set of instructions for that page?
Re: How to change the colors of the Winning and Losing picks on
Yes see 2 posts above your last one there are separate edits to make that work.
Phil
Phil
Re: How to change the colors of the Winning and Losing picks on
Great edit. This really adds to the results pages. Thanks.
Re: How to change the colors of the Winning and Losing picks on
Glad you like it, I know my users have enjoyed that change, just makes things easier to look at with a quick glance.
Phil
Phil
Re: How to change the colors of the Winning and Losing picks on
Very nice. Thank you ซื้อบัตร Razer
Re: How to change the colors of the Winning and Losing picks on
Very informative. Thank you. ซื้อบัตร Razer