Sim Dynasty

View Old Forum Thread

Old Forum Index » Baseball Beta Testing » Beta News » Re-did Box Score page
tysonlowery

Re-did Box Score page

April 28, 2002 at 04:03AM View BBCode

I redid the box score page in the new look & feel. Check it out.

Note that for new games, it will be more properly formatted.
honus

April 28, 2002 at 04:02PM View BBCode

Very nice. Thanks.
DougPaz

April 28, 2002 at 05:18PM View BBCode

I would still like to see a way that I can read my game without knowing the outcome ahead of time and do an inning-by-inning broadcast that increases the tension. Of course with all of the late leads I've blown lately, it could lead to a heart attack!!
celamantia

April 28, 2002 at 08:39PM View BBCode

Tyson,

I can whip up a quick-and-dirty JavaScript version of the page that loads line-by-line, if you like. It would be a simple matter of tagging each line with a SPAN with an ID number, hiding them by default, and having a button or timer that would un-hide each ID one at a time. the only downside to the simplistic version is that the scoreboard would only update at the end of each half-inning, but we coud do a more complicated version later...

To use it, though, there would need to be a way to jump to it without going through the Results page, which would blow the secret.

What about giving owners the option to get an E-mail every time a game is played with a link to the box score page? Not only will this allow people to see their results, but it will be a constant reminder that they are in a game and may reduce people forgetting about it and having their team go ghost....

If you want to do this, let me know. It shouldn't take but an hour to figure out, and should require minimal changes to your game output code...

--Chris
tysonlowery

April 28, 2002 at 09:01PM View BBCode

I was thinking maybe I'd just have the latest 3 games on the results page say "Click Here For Result", then dive into something like you mentioned.

Any help would be great! I can email you the 3 html files that make up the boxscore page, and if you mark them up then I can redo the Game code to spit out appropriate html code to match.

celamantia

April 28, 2002 at 09:15PM View BBCode

I just saved the ones off the site, and I'm aready knee-deep in the code. Here's the basics: Right now you're using a SPAN for all special lines You'll need to add a span for ALL lines, including the inning headers:

SPAN id=Line0 Style="Display: None"

(Brackets ommited to keep BB Code from trying to interpret them)

For the special lines, just add the class:

SPAN id=Line1 Style="Display: None" class="pchange"

The number in the ID needs to increment for each line.

Finally, I'm writing a script that will simply run a timer to advance through the recap line-by-line, or have buttons to speed up the process or show the whole recap immediately.

After the last recap line, add another line that reads:

<SPAN id=Line99 style="display:hidden">END</span>

so I know when to stop.

If you would like more detail, like a working scoreboard and a men-on-base display, add the following after every line:

<SPAN ID=stat0 style="display: none">0/0/0/0/0/0/0/0/0/0/Joe Blow 4.15/Steve Schwartz .380</span>

These 0's are, in order:

Home Score
Visitor Score
Home Hits
Visitor Hits
Home Errors
Visitor Errors
Outs
Man on first? (0=no, 1=yes)
Man on second? (0=no, 1=yes)
Man on third? (0=no, 1=yes)
Pitcher's name and ERA
Batter's name and batting average

All of the stats would be as they stand after the corresponding play has been completed, except for the batter, which would represent the next batter.

I'll be able to use an innerText function to parse this information and display it on a scoreboard. Would it be a pain to add this information?
tysonlowery

April 29, 2002 at 12:36AM View BBCode

I can do everything rather easily, except for the batting average and era stuff.

Maybe I can add that later on? Actually, it would be somewhat complex because I don't add the stats to the DB until the end of the game. So I'd have to pull a few things together to get it right.

celamantia

April 29, 2002 at 01:03AM View BBCode

That's okay... the ERA and average going into the game is sufficient... it's not actually necessary at all; I'll just take whatever strings you give me for pitcher and batter and display those, so you can give me just a name now, or add stats later...

I have the basic player code done; it simply unhides each line every two seconds, then unhides the box score at the end of the game. I'm moving now to the scoreboard update, but if you can provide me those stats, the scoreboard update will take a completely different form.

To see what I have, add this after the </TITLE> tag in the header:

<SCRIPT Language=JavaScript>
var intCurID
var intInterval

intInterval=2000
intCurID=0

function AdvanceGame() {
var strCurID
var oLineTag

strCurID='Line'+intCurID.toString()
oLineTag=document.all(strCurID)

if(oLineTag.innerText=='END') {
BoxScores.style.display='block'
} else {
oLineTag.style.display='inline'
intCurID++
setTimeout('AdvanceGame()',intInterval)
}

}

</SCRIPT>

Next, find the table that holds the box scores, and add ID=BoxScores to the TABLE tag.

Finally, in the TD that holds the scoreboard, add the following AFTER the </TABLE> for the scoreboard but BEFORE the </TD> that closes the cell:

<INPUT type=button value="Advance Recap" onClick="AdvanceGame()">
<INPUT type=button value="Show All" onClick="intInterval=1;AdvanceGame()">
</p>

That will get you to where I am now. It's not done, because it currently leaves the scoreboard visible and unchanged...

--Chris
tysonlowery

April 29, 2002 at 01:08AM View BBCode

Cool, I'll try it out in my Dev area tonight and see if I can get it going. Then we can start watching games live on the Beta site for a few days!
celamantia

April 29, 2002 at 01:13AM View BBCode

If you can add the stats, so much the better; they won't hurt anything since they're hidden, andI can start on the scoreboard....

Note: The code I gave you may not work on Netscape! Anyone out there a Netscape or Opera user? I may have toadd Netscape detection and either modify how I do things or just show everything for Netscape...

--Chris

Pages: 1