|
||||
|
02-20-2007, 08:50 PM | #21 |
Hall Of Famer
Join Date: Jun 2002
Location: Canuckistan
Posts: 5,157
|
It is better, I now only have 4 extra lines on the NL side, but that is not a huge deal
Thanks ! |
02-21-2007, 12:50 AM | #22 |
Minors (Rookie Ball)
Join Date: Sep 2004
Posts: 23
|
I am trying to get it running as well.
I edited the PHP file to have 'exports' as the dir to look for the .EXP files (I removed the .. after it did not work and it did not help. The "exports" folder is a sub folder of where I am placing the teamexports.php file ("/Nobs"). I am getting the following msg: Parse error: parse error, unexpected '/' in /home/content/n/e/m/nemman1963/html/Nobs/teamexports.php on line 44 Any help would be appreciated. Thanks in Advance! Last edited by Morgan1963; 02-21-2007 at 12:52 AM. |
02-21-2007, 05:58 AM | #23 | |
Global Moderator
Join Date: Nov 2002
Location: Vancouver, Canada
Posts: 10,701
|
Quote:
$basedir = 'exports/'; will probably work for you too on that line. If it doesn't, zip and attach your file too. Dave's ".." was in there because his file structure was different in that he had his exports folder in, I believe, a sibling folder whereas most probably have it in a child folder like us. The ".." tells it to go back a generation of folders and then start looking from there. If all it needs to do is start looking from where the php file is, though, then it doesn't need the dots. |
|
02-21-2007, 11:01 AM | #24 |
All Star Starter
Join Date: Aug 2003
Posts: 1,146
|
Wow this tracker really has developed a life of its own. Sorry I didn't see this thread earlier I only pop in here every so often.
Anyone can feel free to email me at dave AT hitforthecycle.com and attach their export tracker php file in its current state and give me all the details of their league and I can try to get them going. I'll have to get around to making a simpler version of my tracker with better directions to help folks. |
07-19-2007, 09:59 PM | #25 |
Minors (Double A)
Join Date: Nov 2002
Location: Northern Virginia
Posts: 164
|
hmmm I think I need some help..anyone??? Please
I have tried all sorts of settings on the paths. The files are in my root and the exports dir is exports! I am getting the following Parse error: parse error, unexpected '/' in /home/content/J/o/n/JonPapp/html/teamexports.php on line 40 Here is my file... <?php // Directions for use of this file // Set the 5 (line #10-#14) variables below so they are appropriate to your league server set up // Modify the getTeamName function (line #156) below so the program knows the name of each of your teams $exportDir = exports; // this must point to the directory where team exports and FA/ST files are stored $leagueFile = league.zip; // full path and name to your league file here $numTeams = 24; // set this equal to the total number of your teams in your league $L1 = 'National League'; $L2 = 'American League'; print("<HTML>"); print("<TITLE>Team Export List</TITLE>"); print("<BODY>"); $files = scandir($exportDir); //print('<pre>'); //print_r($files); //print('</pre>'); print('<table border="0" width="100%" cellpadding="2" cellspacing="0">'); print('<tr bgcolor="#0E3259">'); $curDate = date("n.d g:ia"); print("<th colspan=\"6\"><font color=\"WHITE\">NOBL Team Export File Status - Current Time: $curDate (PST)</font></th>"); print('</tr>'); print('<tr bgcolor="#0E3259">'); print('<th colspan="3"><font color="WHITE">'.$L1.'</font></th>'); print('<th colspan="3"><font color="WHITE">'.$L2.'</font></th>'); print('</tr>'); print('<tr bgcolor="#5E658C">'); print(' <td width=\"25%\"><font color="WHITE">Team</font></td> <td width=\"15%\"><font color="WHITE">Export Date</font></td> <td width=\"10%\"><font color="WHITE">ST </font></td> <td width=\"25%\"><font color="WHITE">Team</font></td> <td width=\"15%\"><font color="WHITE">Export Date</font></td> <td width=\"10%\"><font color="WHITE">ST </font></td> print('</tr>'); $basedir = $exportDir; $base = "Team"; $stbase = "Teamst"; $ext = ".exp"; $fabase = "fat"; $faext = ".dat"; for ($i = 1; $i <= 25; $i++) { $NL = $base.$i.$ext; $NLST = $stbase.$i.$ext; $j = $i + 12; $SL = $base.$j.$ext; $SLST = $stbase.$j.$ext; if (checkDate($NL, $basedir)) { print("<tr><td bgcolor=\"#EA947B\">".getTeamName($NL)."</td><td bgcolor=\"#EA947B\">".getFileDate($NL, $basedir)."</td>"); } else { print("<tr><td bgcolor=\"#95D096\">".getTeamName($NL)."</td><td bgcolor=\"#95D096\">".getFileDate($NL, $basedir)."</td>"); } if (file_exists($NLST)) { print("<td><img src=\"checkmark_red.jpg\" border=\"0\"></td>"); } else { print("<td> </td>"); } if (checkDate($SL, $basedir)) { print("<td bgcolor=\"#EA947B\">".getTeamName($SL)."</td><td bgcolor=\"#EA947B\">".getFileDate($SL, $basedir)."</td>"); } else { print("<td bgcolor=\"#95D096\">".getTeamName($SL)."</td><td bgcolor=\"#95D096\">".getFileDate($SL, $basedir)."</td>"); } if (file_exists($SLST)) { print("<td><img src=\"checkmark_red.jpg\" border=\"0\"></td>"); } else { print("<td> </td>"); } print("</tr>"); } print("<tr></tr><tr></tr>"); print("<tr><td bgcolor=\"#EA947B\">Team Export Old</td></tr>"); print("<tr><td bgcolor=\"#95D096\">Team Export OK</td></tr>"); print("<tr><td><img src=\"checkmark_red.jpg\" border=\"0\"> File Submitted</td></tr>"); print("<tr><td>ST = Spring Training</td></tr>"); print('</table>'); print("</BODY>"); print("</HTML>"); return; function checkDate($file, $basedir, $leaguefile) { //print(filemtime($leaguefile)); $teamfile = $basedir.$file; if (!file_exists($teamfile)) { $teamfile = $basedir.strtoupper($file); } if (file_exists($teamfile) && file_exists($leaguefile)) { //print("here1"); if (filemtime($leaguefile) > filemtime($teamfile)) { return true; } else { //print("here2"); return false; } } else { //print("here3"); return true; } } function getFileDate($file, $basedir) { $teamfile = $basedir.$file; //print "looking for $teamfile or "; if (file_exists($teamfile)) { return date("n.d g:ia", filemtime($teamfile)); } $teamfile = $basedir.strtoupper($file); //print "$teamfile <br> "; if (file_exists($teamfile)) { return date("n.d g:ia", filemtime($teamfile)); } else { return 'No File'; } } function getTeamName($file) { $file = strtolower($file); switch ($file) { case 'team1.exp': return 'BOS'; case 'team2.exp': return 'NYN'; case 'team3.exp': return 'PHI'; case 'team4.exp': return 'WAS'; case 'team5.exp': return 'ATL'; case 'team6.exp': return 'FLA'; case 'team7.exp': return 'HOU'; case 'team8.exp': return 'LA'; case 'team9.exp': return 'CHI'; case 'team10.exp': return 'MIL'; case 'team11.exp': return 'SF'; case 'team12.exp': return 'STL'; case 'team13.exp': return 'DET'; case 'team14.exp': return 'NYA'; case 'team15.exp': return 'PIT'; case 'team16.exp': return 'TOR'; case 'team17.exp': return 'CIN'; case 'team18.exp': return 'CLE'; case 'team19.exp': return 'KC'; case 'team20.exp': return 'TEX'; case 'team17.exp': return 'MIN'; case 'team18.exp': return 'OAK'; case 'team19.exp': return 'SD'; case 'team20.exp': return 'SEA'; } } function scandir($dirstr) { // php.net/scandir (PHP5) $files = array(); $fh = opendir($dirstr); while (false !== ($filename = readdir($fh))) { array_push($files, $filename); } closedir($fh); return $files; } ?> using this code: <?php // Directions for use of this file // Set the 5 (line #10-#14) variables below so they are appropriate to your league server set up // Modify the getTeamName function (line #156) below so the program knows the name of each of your teams $exportDir = exports; // this must point to the directory where team exports and FA/ST files are stored $leagueFile = league.zip; // full path and name to your league file here $numTeams = 24; // set this equal to the total number of your teams in your league $L1 = 'National League'; $L2 = 'American League'; print("<HTML>"); print("<TITLE>Team Export List</TITLE>"); print("<BODY>"); $files = scandir($exportDir); //print('<pre>'); //print_r($files); //print('</pre>'); print('<table border="0" width="100%" cellpadding="2" cellspacing="0">'); print('<tr bgcolor="#0E3259">'); $curDate = date("n.d g:ia"); print("<th colspan=\"6\"><font color=\"WHITE\">NOBL Team Export File Status - Current Time: $curDate (PST)</font></th>"); print('</tr>'); print('<tr bgcolor="#0E3259">'); print('<th colspan="3"><font color="WHITE">'.$L1.'</font></th>'); print('<th colspan="3"><font color="WHITE">'.$L2.'</font></th>'); print('</tr>'); print('<tr bgcolor="#5E658C">'); print(' <td width=\"25%\"><font color="WHITE">Team</font></td> <td width=\"15%\"><font color="WHITE">Export Date</font></td> <td width=\"10%\"><font color="WHITE">ST </font></td> <td width=\"25%\"><font color="WHITE">Team</font></td> <td width=\"15%\"><font color="WHITE">Export Date</font></td> <td width=\"10%\"><font color="WHITE">ST </font></td> print('</tr>'); $basedir = $exportDir; $base = "Team"; $stbase = "Teamst"; $ext = ".exp"; $fabase = "fat"; $faext = ".dat"; for ($i = 1; $i <= 25; $i++) { $NL = $base.$i.$ext; $NLST = $stbase.$i.$ext; $j = $i + 12; $SL = $base.$j.$ext; $SLST = $stbase.$j.$ext; if (checkDate($NL, $basedir)) { print("<tr><td bgcolor=\"#EA947B\">".getTeamName($NL)."</td><td bgcolor=\"#EA947B\">".getFileDate($NL, $basedir)."</td>"); } else { print("<tr><td bgcolor=\"#95D096\">".getTeamName($NL)."</td><td bgcolor=\"#95D096\">".getFileDate($NL, $basedir)."</td>"); } if (file_exists($NLST)) { print("<td><img src=\"checkmark_red.jpg\" border=\"0\"></td>"); } else { print("<td> </td>"); } if (checkDate($SL, $basedir)) { print("<td bgcolor=\"#EA947B\">".getTeamName($SL)."</td><td bgcolor=\"#EA947B\">".getFileDate($SL, $basedir)."</td>"); } else { print("<td bgcolor=\"#95D096\">".getTeamName($SL)."</td><td bgcolor=\"#95D096\">".getFileDate($SL, $basedir)."</td>"); } if (file_exists($SLST)) { print("<td><img src=\"checkmark_red.jpg\" border=\"0\"></td>"); } else { print("<td> </td>"); } print("</tr>"); } print("<tr></tr><tr></tr>"); print("<tr><td bgcolor=\"#EA947B\">Team Export Old</td></tr>"); print("<tr><td bgcolor=\"#95D096\">Team Export OK</td></tr>"); print("<tr><td><img src=\"checkmark_red.jpg\" border=\"0\"> File Submitted</td></tr>"); print("<tr><td>ST = Spring Training</td></tr>"); print('</table>'); print("</BODY>"); print("</HTML>"); return; function checkDate($file, $basedir, $leaguefile) { //print(filemtime($leaguefile)); $teamfile = $basedir.$file; if (!file_exists($teamfile)) { $teamfile = $basedir.strtoupper($file); } if (file_exists($teamfile) && file_exists($leaguefile)) { //print("here1"); if (filemtime($leaguefile) > filemtime($teamfile)) { return true; } else { //print("here2"); return false; } } else { //print("here3"); return true; } } function getFileDate($file, $basedir) { $teamfile = $basedir.$file; //print "looking for $teamfile or "; if (file_exists($teamfile)) { return date("n.d g:ia", filemtime($teamfile)); } $teamfile = $basedir.strtoupper($file); //print "$teamfile <br> "; if (file_exists($teamfile)) { return date("n.d g:ia", filemtime($teamfile)); } else { return 'No File'; } } function getTeamName($file) { $file = strtolower($file); switch ($file) { case 'team1.exp': return 'BOS'; case 'team2.exp': return 'NYN'; case 'team3.exp': return 'PHI'; case 'team4.exp': return 'WAS'; case 'team5.exp': return 'ATL'; case 'team6.exp': return 'FLA'; case 'team7.exp': return 'HOU'; case 'team8.exp': return 'LA'; case 'team9.exp': return 'CHI'; case 'team10.exp': return 'MIL'; case 'team11.exp': return 'SF'; case 'team12.exp': return 'STL'; case 'team13.exp': return 'DET'; case 'team14.exp': return 'NYA'; case 'team15.exp': return 'PIT'; case 'team16.exp': return 'TOR'; case 'team17.exp': return 'CIN'; case 'team18.exp': return 'CLE'; case 'team19.exp': return 'KC'; case 'team20.exp': return 'TEX'; case 'team17.exp': return 'MIN'; case 'team18.exp': return 'OAK'; case 'team19.exp': return 'SD'; case 'team20.exp': return 'SEA'; } } function scandir($dirstr) { // php.net/scandir (PHP5) $files = array(); $fh = opendir($dirstr); while (false !== ($filename = readdir($fh))) { array_push($files, $filename); } closedir($fh); return $files; } ?>
__________________
Current Leagues: (All years in "game" years) NOBL - Boston Red Sox (2002-present) NOBL - Commish (2006 - present) TTWB - Farmingdale Frunkus (2011 - present) My OOTP graveyard: LLM - Yucatan Leones (2012 - folded) CPL - Detroit Tigers (2011 - folded) FHBL -Cincinnati Reds (2006 - folded) Maverick Baseball - Boston Red Sox (2005 - folded) BPLA - Portland (2004: folded) Last edited by Officespace99; 07-19-2007 at 10:02 PM. |
Bookmarks |
|
|