Maginot/viewnews.cgi different output w/ same style (SOLVED)

EDIT: Removed links to example pages as they are no longer available and added an explanation of the problem instead.
Problem: Viewing a news item about softball game results with viewnews.cgi displayed the line score (that is a table with a row for each team and the runs scored in each inning by that team in a cell, total runs, hits and errors are displayed at the end of the row), but a Maginot static profile did not display the line score.
I was wondering why the line score is displaying in the viewnews.cgi output and not displaying in the Maginot output. See the next post for my solution.
I am using Maginot to create static pages for each game so that I can delete last year's schedule and enter next year's schedule.
I use the following style for both:
Problem: Viewing a news item about softball game results with viewnews.cgi displayed the line score (that is a table with a row for each team and the runs scored in each inning by that team in a cell, total runs, hits and errors are displayed at the end of the row), but a Maginot static profile did not display the line score.
I was wondering why the line score is displaying in the viewnews.cgi output and not displaying in the Maginot output. See the next post for my solution.
I am using Maginot to create static pages for each game so that I can delete last year's schedule and enter next year's schedule.
I use the following style for both:
- Code: Select all
<PerlCode>
# initialize variables
$thisOpp = "";
$titleTag = "";
#if Opponent is not determined yet use the subject or the schedule note instead
if ($CustomField_opponent ne "TBA" && $CustomField_opponent ne ""){
$thisOpp = $CustomField_opponent;
} elsif ($CustomField_opponent eq "TBA" && $Subject eq "" && $CustomField_schedNote eq "") {
$thisOpp = "To be announced";
} elsif ($Subject ne "") {
$thisOpp = $Subject;
} elsif ($CustomField_schedNote ne "") {
$thisOpp = $CustomField_schedNote;
}
# add appropriate text for home/away games if needed
if ($CustomField_site eq "Away") {
$titleTag = "CCSJ at ".$thisOpp." on ".$Month_Name." ".$Day.", ".$Year;
} elsif ($CustomField_site eq "Home" || $CustomField_site eq "Neutral") {
$titleTag = "CCSJ vs ".$thisOpp." on ".$Month_Name." ".$Day.", ".$Year;
} else {
$titleTag = $thisOpp;
}
# process the score by innings entry
if ($CustomField_oppRunsByInning ne "" && $CustomField_ourRunsByInning ne "") {
# split the score by innings entries into indexed arrays
@oppScoreByInning = split(";",$CustomField_oppRunsByInning);
@ourScoreByInning = split(";",$CustomField_ourRunsByInning);
# process the opp array
$n = 0;
$oppRow = "";
while (defined($oppScoreByInning[$n])) {
#get the opp total runs for the game
$oppRuns = $oppRuns + $oppScoreByInning[$n];
#build the opp line for the score by inning box
$oppRow = "$oppRow"."<td class=\"scores\">".$oppScoreByInning[$n]."</td>";
$n++;
}
$oppRow = "<tr class=\"scores\"><td class=\"team-name\"><strong>".$CustomField_opponent."</strong></td>".$oppRow."<td class=\"scores\">$oppRuns</td><td class=\"scores\">$CustomField_oppHits</td><td class=\"scores\">$CustomField_oppErrors</td></tr>";
# process our array
$n = 0;
$ourRow = "";
$headerRow = "<tr class=\"scores\"><th class=\"scores\"></th>";
while (defined($ourScoreByInning[$n])) {
$ourRuns = $ourRuns + $ourScoreByInning[$n];
$ourRow = $ourRow."<td class=\"scores\">".$ourScoreByInning[$n]."</td>";
$n++;
$headerRow = $headerRow."<th class=\"scores\">$n</th>";
}
$ourRow = "<tr class=\"scores\"><td class=\"team-name\"><strong>CCSJ</strong></td>".$ourRow."<td class=\"scores\">$ourRuns</td><td class=\"scores\">$CustomField_ourHits</td><td class=\"scores\">$CustomField_ourErrors</td></tr>";
$innings = $n;
$headerRow = $headerRow."<th class=\"scores\">R</th><th class=\"scores\">H</th><th class=\"scores\">E</th></tr>";
# put the score table into correct order for home/away games
if (($CustomField_site eq "Away" && $CustomField_homeTeam
== 0) || ($CustomField_site eq "Neutral" && $CustomField_homeTeam
== 0)) {
$scoreTable = $headerRow."\n".$ourRow."\n".$oppRow;
} else {
$scoreTable = $headerRow."\n".$oppRow."\n".$ourRow;
}
}
# compare the runs by inning totals to the total entered on the input page
# to prevent mistakes
if ( ($CustomField_ourScore ne "" && $ourRuns == $CustomField_ourScore) && ($CustomField_oppScore ne "" && $oppRuns == $CustomField_oppScore) ) {
$showLineScore = 1;
} else {
$showLineScore = 0;
}
</PerlCode>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>CCSJ Softball Game Details</title>
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1">
<link rel="stylesheet" type="text/css" href="../_style/style.css">
</head>
<body>
<!-- body table -->
<table width="85%" align="center">
<tr>
<td class="padding">
<table width="100%" class="box_border">
<tr>
<td class="soft_header center">
<img src="../_pics/logo.gif" width="97" height="61" alt="">
</td>
<td class="box_header">
<img src="../_pics/logo_4.gif" width="629" height="101" alt="">
</td>
</tr>
<tr>
<td class="soft_header center" colspan="2">
<h5><Field: titleTag></h5>
</td>
</tr>
<tr>
<td colspan="2" class="detail">
<p><Field: Date><If: Field: CustomField_timeOptions eq "Normal"> at <Field: Hour>:<Field: Minute><If: Field: AMPM eq "PM"> p.m.<If: Else> a.m.</If><If: Field: CustomField_tz ne "CST"> <Field: CustomField_tz></If></If><br>
<If: Field: CustomField_playingField><p>Played at <Field: CustomField_playingField><br></if>
<If: Field: CustomField_schedNote><Field: CustomField_schedNote><br></If>
<If: Field: CustomField_blurb><Field: CustomField_blurb><br></If></p>
<If: Field: showLineScore><table class="scores">
<Field: scoreTable>
</table></If>
<p><Field: Text></p>
<If: Field: CustomField_BoxScore><p><a href="<Field: CustomField_BoxScore>">Box Score and Play-by-Play</a></p></If>
<If: Field: CustomField_last_revised><hr /><p>Last Revised: <Field: CustomField_last_revised></p></If>
<!-- End Style Section -->
</td>
</tr>
</table>
</td>
<!-- end main body -->
</tr>
</table>
</body>
</html>