You can subscribe to this list here.
| 2004 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(115) |
Sep
(81) |
Oct
(19) |
Nov
(6) |
Dec
(7) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2005 |
Jan
|
Feb
|
Mar
(3) |
Apr
|
May
|
Jun
|
Jul
|
Aug
(6) |
Sep
(37) |
Oct
|
Nov
|
Dec
|
| 2006 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(6) |
Aug
(4) |
Sep
(28) |
Oct
|
Nov
|
Dec
|
| 2007 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(25) |
Oct
|
Nov
|
Dec
|
| 2008 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(7) |
Oct
|
Nov
|
Dec
|
| 2009 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(2) |
Oct
|
Nov
|
Dec
|
|
From: Job R. <jo...@us...> - 2009-09-10 17:26:01
|
Update of /cvsroot/offl/offl/sql/load In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv31178/sql/load Modified Files: load_control.sql Log Message: end of 2008 cleanups Index: load_control.sql =================================================================== RCS file: /cvsroot/offl/offl/sql/load/load_control.sql,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** load_control.sql 25 Sep 2008 15:47:42 -0000 1.12 --- load_control.sql 10 Sep 2009 17:25:46 -0000 1.13 *************** *** 101,105 **** insert into `control` (`control_key`,`control_value`,`control_desc`) values ('SCORING_INT','-2','Points awarded per interception thrown'); insert into `control` (`control_key`,`control_value`,`control_desc`) values ('SCORING_FMBL_LOST','-2','Points awarded per fumble lost'); ! insert into `control` (`control_key`,`control_value`,`control_desc`) values ('SCORING_TWOPT','2','Points awarded per two-point conversion completed (run, pass, or catch)'); insert into `control` (`control_key`,`control_value`,`control_desc`) values ('SCORING_FG_0_19','3','Points awarded per field goal, 0-19 yards'); insert into `control` (`control_key`,`control_value`,`control_desc`) values ('SCORING_FG_20_29','3','Points awarded per field goal, 20-29 yards'); --- 101,106 ---- insert into `control` (`control_key`,`control_value`,`control_desc`) values ('SCORING_INT','-2','Points awarded per interception thrown'); insert into `control` (`control_key`,`control_value`,`control_desc`) values ('SCORING_FMBL_LOST','-2','Points awarded per fumble lost'); ! insert into `control` (`control_key`,`control_value`,`control_desc`) values ('SCORING_TWOPT','2','Points awarded per two-point conversion completed (run or catch)'); ! insert into `control` (`control_key`,`control_value`,`control_desc`) values ('SCORING_TWOPTP','2','Points awarded per two-point conversion completed (pass)'); insert into `control` (`control_key`,`control_value`,`control_desc`) values ('SCORING_FG_0_19','3','Points awarded per field goal, 0-19 yards'); insert into `control` (`control_key`,`control_value`,`control_desc`) values ('SCORING_FG_20_29','3','Points awarded per field goal, 20-29 yards'); |
|
From: Job R. <jo...@us...> - 2009-09-10 17:25:58
|
Update of /cvsroot/offl/offl/sql/tables In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv31178/sql/tables Modified Files: playerstats.sql Log Message: end of 2008 cleanups Index: playerstats.sql =================================================================== RCS file: /cvsroot/offl/offl/sql/tables/playerstats.sql,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** playerstats.sql 25 Sep 2008 15:43:48 -0000 1.3 --- playerstats.sql 10 Sep 2009 17:25:46 -0000 1.4 *************** *** 31,34 **** --- 31,35 ---- `fmbl_lost` int DEFAULT 0, `twopt` int DEFAULT 0, + `twoptp` int DEFAULT 0, #Passer 2pt conv `fg_0_19` int DEFAULT 0, #field goals `fg_20_29` int DEFAULT 0, |
|
From: Job R. <jo...@us...> - 2008-09-09 14:51:02
|
Update of /cvsroot/offl/offl/sql/load In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv5211 Added Files: teamdef.sql Log Message: team defense module --- NEW FILE: teamdef.sql --- insert into players (lname,fname,nflteam_id,position_id,active) values ("Ravens",'BAL',1,8,1); insert into players (lname,fname,nflteam_id,position_id,active) values ("Bills",'BUF',2,8,1); insert into players (lname,fname,nflteam_id,position_id,active) values ("Bengals",'CIN',3,8,1); insert into players (lname,fname,nflteam_id,position_id,active) values ("Browns",'CLE',4,8,1); insert into players (lname,fname,nflteam_id,position_id,active) values ("Broncos",'DEN',5,8,1); insert into players (lname,fname,nflteam_id,position_id,active) values ("Texans",'HOU',6,8,1); insert into players (lname,fname,nflteam_id,position_id,active) values ("Colts",'IND',7,8,1); insert into players (lname,fname,nflteam_id,position_id,active) values ("Jaguars",'JAC',8,8,1); insert into players (lname,fname,nflteam_id,position_id,active) values ("Chiefs",'KC',9,8,1); insert into players (lname,fname,nflteam_id,position_id,active) values ("Dolphins",'MIA',10,8,1); insert into players (lname,fname,nflteam_id,position_id,active) values ("Patriots",'NE',11,8,1); insert into players (lname,fname,nflteam_id,position_id,active) values ("Jets",'NYJ',12,8,1); insert into players (lname,fname,nflteam_id,position_id,active) values ("Raiders",'OAK',13,8,1); insert into players (lname,fname,nflteam_id,position_id,active) values ("Steelers",'PIT',14,8,1); insert into players (lname,fname,nflteam_id,position_id,active) values ("Chargers",'SD',15,8,1); insert into players (lname,fname,nflteam_id,position_id,active) values ("Titans",'TEN',16,8,1); insert into players (lname,fname,nflteam_id,position_id,active) values ("Cardinals",'ARI',17,8,1); insert into players (lname,fname,nflteam_id,position_id,active) values ("Falcons",'ATL',18,8,1); insert into players (lname,fname,nflteam_id,position_id,active) values ("Panthers",'CAR',19,8,1); insert into players (lname,fname,nflteam_id,position_id,active) values ("Bears",'CHI',20,8,1); insert into players (lname,fname,nflteam_id,position_id,active) values ("Cowboys",'DAL',21,8,1); insert into players (lname,fname,nflteam_id,position_id,active) values ("Lions",'DET',22,8,1); insert into players (lname,fname,nflteam_id,position_id,active) values ("Packers",'GB',23,8,1); insert into players (lname,fname,nflteam_id,position_id,active) values ("Vikings",'MIN',24,8,1); insert into players (lname,fname,nflteam_id,position_id,active) values ("Saints",'NO',25,8,1); insert into players (lname,fname,nflteam_id,position_id,active) values ("Giants",'NYG',26,8,1); insert into players (lname,fname,nflteam_id,position_id,active) values ("Eagles",'PHI',27,8,1); insert into players (lname,fname,nflteam_id,position_id,active) values ("49ers",'SF',28,8,1); insert into players (lname,fname,nflteam_id,position_id,active) values ("Rams",'STL',29,8,1); insert into players (lname,fname,nflteam_id,position_id,active) values ("Seahawks",'SEA',30,8,1); insert into players (lname,fname,nflteam_id,position_id,active) values ("Buccaneers",'TB',31,8,1); insert into players (lname,fname,nflteam_id,position_id,active) values ("Redskins",'WAS',32,8,1); |
|
From: Job R. <jo...@us...> - 2008-09-09 14:48:29
|
Update of /cvsroot/offl/offl/sql/load In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv4006 Modified Files: load_control.sql Log Message: added MISC_SEASON_START_2008 season start Index: load_control.sql =================================================================== RCS file: /cvsroot/offl/offl/sql/load/load_control.sql,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** load_control.sql 6 Sep 2007 13:16:39 -0000 1.10 --- load_control.sql 9 Sep 2008 14:48:36 -0000 1.11 *************** *** 20,23 **** --- 20,24 ---- -- when does the season actually start? insert into `control` (`control_key`,`control_value`,`control_desc`,`all_leagues`) values ('MISC_SEASON_START_2007','2007-09-04 03:00:00','Should be set to the Tuesday or Wednesday prior to the first game. Governs `control` of current week relative to the NFL.',1); + insert into `control` (`control_key`,`control_value`,`control_desc`,`all_leagues`) values ('MISC_SEASON_START_2008','2008-09-03 03:00:00','Should be set to the Tuesday or Wednesday prior to the first game. Governs `control` of current week relative to the NFL.',1); -- Use draft system |
|
From: Job R. <jo...@us...> - 2008-09-05 19:53:55
|
Update of /cvsroot/offl/offl/www In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv26298 Modified Files: playoffseedings.php Log Message: correct syntax error line 21 Index: playoffseedings.php =================================================================== RCS file: /cvsroot/offl/offl/www/playoffseedings.php,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** playoffseedings.php 22 Sep 2004 04:00:55 -0000 1.2 --- playoffseedings.php 5 Sep 2008 19:54:02 -0000 1.3 *************** *** 19,23 **** } ! $game_lookup = new )FFL_Game(); $week = getCurrentWeek($_GET["year"]); $x = new OFFL_FFLTeam(); --- 19,23 ---- } ! $game_lookup = new FFL_Game(); $week = getCurrentWeek($_GET["year"]); $x = new OFFL_FFLTeam(); |
|
From: Job R. <jo...@us...> - 2008-09-04 16:11:22
|
Update of /cvsroot/offl/offl/sql/load In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv30817 Modified Files: load_nflteams.sql Log Message: fixed error in load data for ATL (sql/load/load_nflteams.sql) Index: load_nflteams.sql =================================================================== RCS file: /cvsroot/offl/offl/sql/load/load_nflteams.sql,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** load_nflteams.sql 4 Sep 2008 11:40:00 -0000 1.2 --- load_nflteams.sql 4 Sep 2008 16:11:29 -0000 1.3 *************** *** 22,26 **** insert into nflteams values (16,'Tennessee','Titans','Tennessee','TEN'); insert into nflteams values (17,'Arizona','Cardinals','Arizona','ARI'); ! insert into nflteams values (18,'Atlanta','Falcons''Atlanta','ATL'); insert into nflteams values (19,'Carolina','Panthers','Carolina','CAR'); insert into nflteams values (20,'Chicago','Bears','Chicago','CHI'); --- 22,26 ---- insert into nflteams values (16,'Tennessee','Titans','Tennessee','TEN'); insert into nflteams values (17,'Arizona','Cardinals','Arizona','ARI'); ! insert into nflteams values (18,'Atlanta','Falcons','Atlanta','ATL'); insert into nflteams values (19,'Carolina','Panthers','Carolina','CAR'); insert into nflteams values (20,'Chicago','Bears','Chicago','CHI'); |
|
From: Job R. <jo...@us...> - 2008-09-04 11:39:55
|
Update of /cvsroot/offl/offl/sql/load In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv21400 Modified Files: load_nflteams.sql Log Message: added field nflteam_schedulename data for 2008 schedule processing Index: load_nflteams.sql =================================================================== RCS file: /cvsroot/offl/offl/sql/load/load_nflteams.sql,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** load_nflteams.sql 16 Aug 2004 00:31:36 -0000 1.1.1.1 --- load_nflteams.sql 4 Sep 2008 11:40:00 -0000 1.2 *************** *** 5,38 **** -- these abbreviations match those on NFL.com and should allow for automatic roster detection later. ! insert into nflteams values (1,'Baltimore','Ravens','BAL'); ! insert into nflteams values (2,'Buffalo','Bills','BUF'); ! insert into nflteams values (3,'Cincinnati','Bengals','CIN'); ! insert into nflteams values (4,'Cleveland','Browns','CLE'); ! insert into nflteams values (5,'Denver','Broncos','DEN'); ! insert into nflteams values (6,'Houston','Texans','HOU'); ! insert into nflteams values (7,'Indianapolis','Colts','IND'); ! insert into nflteams values (8,'Jacksonville','Jaguars','JAC'); ! insert into nflteams values (9,'Kansas City','Chiefs','KC'); ! insert into nflteams values (10,'Miami','Dolphins','MIA'); ! insert into nflteams values (11,'New England','Patriots','NE'); ! insert into nflteams values (12,'New York','Jets','NYJ'); ! insert into nflteams values (13,'Oakland','Raiders','OAK'); ! insert into nflteams values (14,'Pittsburgh','Steelers','PIT'); ! insert into nflteams values (15,'San Diego','Chargers','SD'); ! insert into nflteams values (16,'Tennessee','Titans','TEN'); ! insert into nflteams values (17,'Arizona','Cardinals','ARI'); ! insert into nflteams values (18,'Atlanta','Falcons','ATL'); ! insert into nflteams values (19,'Carolina','Panthers','CAR'); ! insert into nflteams values (20,'Chicago','Bears','CHI'); ! insert into nflteams values (21,'Dallas','Cowboys','DAL'); ! insert into nflteams values (22,'Detroit','Lions','DET'); ! insert into nflteams values (23,'Green Bay','Packers','GB'); ! insert into nflteams values (24,'Minnesota','Vikings','MIN'); ! insert into nflteams values (25,'New Orleans','Saints','NO'); ! insert into nflteams values (26,'New York','Giants','NYG'); ! insert into nflteams values (27,'Philadelphia','Eagles','PHI'); ! insert into nflteams values (28,'San Francisco','49ers','SF'); ! insert into nflteams values (29,'St. Louis','Rams','STL'); ! insert into nflteams values (30,'Seattle','Seahawks','SEA'); ! insert into nflteams values (31,'Tampa Bay','Buccaneers','TB'); ! insert into nflteams values (32,'Washington','Redskins','WAS'); --- 5,38 ---- -- these abbreviations match those on NFL.com and should allow for automatic roster detection later. ! insert into nflteams values (1,'Baltimore','Ravens','Baltimore','BAL'); ! insert into nflteams values (2,'Buffalo','Bills','Buffalo','BUF'); ! insert into nflteams values (3,'Cincinnati','Bengals','Cincinnati','CIN'); ! insert into nflteams values (4,'Cleveland','Browns','Cleveland','CLE'); ! insert into nflteams values (5,'Denver','Broncos','Denver','DEN'); ! insert into nflteams values (6,'Houston','Texans','Houston','HOU'); ! insert into nflteams values (7,'Indianapolis','Colts','Indianapolis','IND'); ! insert into nflteams values (8,'Jacksonville','Jaguars','Jacksonville','JAC'); ! insert into nflteams values (9,'Kansas City','Chiefs','Kansas City','KC'); ! insert into nflteams values (10,'Miami','Dolphins','Miami','MIA'); ! insert into nflteams values (11,'New England','Patriots','New England','NE'); ! insert into nflteams values (12,'New York','Jets','N.Y. Jets','NYJ'); ! insert into nflteams values (13,'Oakland','Raiders','Oakland','OAK'); ! insert into nflteams values (14,'Pittsburgh','Steelers','Pittsburgh','PIT'); ! insert into nflteams values (15,'San Diego','Chargers','San Diego','SD'); ! insert into nflteams values (16,'Tennessee','Titans','Tennessee','TEN'); ! insert into nflteams values (17,'Arizona','Cardinals','Arizona','ARI'); ! insert into nflteams values (18,'Atlanta','Falcons''Atlanta','ATL'); ! insert into nflteams values (19,'Carolina','Panthers','Carolina','CAR'); ! insert into nflteams values (20,'Chicago','Bears','Chicago','CHI'); ! insert into nflteams values (21,'Dallas','Cowboys','Dallas','DAL'); ! insert into nflteams values (22,'Detroit','Lions','Detroit','DET'); ! insert into nflteams values (23,'Green Bay','Packers','Green Bay','GB'); ! insert into nflteams values (24,'Minnesota','Vikings','Minnesota','MIN'); ! insert into nflteams values (25,'New Orleans','Saints','New Orleans','NO'); ! insert into nflteams values (26,'New York','Giants','N.Y. Giants','NYG'); ! insert into nflteams values (27,'Philadelphia','Eagles','Philadelphia','PHI'); ! insert into nflteams values (28,'San Francisco','49ers','San Francisco','SF'); ! insert into nflteams values (29,'St. Louis','Rams','St. Louis','STL'); ! insert into nflteams values (30,'Seattle','Seahawks','Seattle','SEA'); ! insert into nflteams values (31,'Tampa Bay','Buccaneers','Tampa Bay','TB'); ! insert into nflteams values (32,'Washington','Redskins','Washington','WAS'); |
|
From: Job R. <jo...@us...> - 2008-09-04 11:39:00
|
Update of /cvsroot/offl/offl/sql/tables In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv20985 Modified Files: nflteams.sql Log Message: added field nflteam_schedulename for 2008 schedule processing Index: nflteams.sql =================================================================== RCS file: /cvsroot/offl/offl/sql/tables/nflteams.sql,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** nflteams.sql 16 Aug 2004 00:31:36 -0000 1.1.1.1 --- nflteams.sql 4 Sep 2008 11:39:09 -0000 1.2 *************** *** 5,8 **** --- 5,9 ---- `nflteam_city` varchar(50), `nflteam_name` varchar(50), + `nflteam_schedulename` varchar(50), `nflteam_abbv` char(3), primary key (`nflteam_id`) |
|
From: Job R. <jo...@us...> - 2008-09-03 21:32:02
|
Update of /cvsroot/offl/offl/www In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv23513 Modified Files: games.php Log Message: fixed parsing for 2008 NFL Schedule from sportsline Index: games.php =================================================================== RCS file: /cvsroot/offl/offl/www/games.php,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** games.php 11 Sep 2007 02:37:02 -0000 1.11 --- games.php 3 Sep 2008 21:32:11 -0000 1.12 *************** *** 83,89 **** //echo $schedstring; ! $parser = new HtmlParser ($schedstring); while ($parser->parse()) { //echo "iNodeName: " . $parser->iNodeName . ", iNodeValue: " . $parser->iNodeValue . ", iNodeType: " . $parser->iNodeType . "<br/>"; --- 83,97 ---- //echo $schedstring; ! //$f = fopen("g08.txt", "w"); ! //fwrite( $f, $schedstring); ! //fclose( $f); ! $parser = new HtmlParser ($schedstring); + $t1 = ""; + $t2 = ""; + $t3 = ""; + $at_found = false; + while ($parser->parse()) { //echo "iNodeName: " . $parser->iNodeName . ", iNodeValue: " . $parser->iNodeValue . ", iNodeType: " . $parser->iNodeType . "<br/>"; *************** *** 100,103 **** --- 108,133 ---- } + // rotary buffer for 2008 game schedule listing + // each game team is href'd with 'at' between + // so parsing is splitting into seperate elements + // + if ($parser->iNodeName == "Text") { + $t3 = $t2; + $t2 = $t1; + $t1 = $parser->iNodeValue; + if ($at_found) { + $at_found = false; + $vteam = $t3; + $hteam = $t1; + echo "<br/>----" . $t3 . " at " . $parser->iNodeValue; + $x = new OFFL_NFLTeam(); + $vabbv = $x->getNFLTeamBySchedName($vteam); + $habbv = $x->getNFLTeamBySchedName($hteam); + }; + }; + + if (strpos(" " . trim($parser->iNodeValue) . " ", " at ") !== false) { + $at_found = true; + }; if (strpos(trim($parser->iNodeValue), " at ") !== false) { list($vteam, $hteam) = explode(" at ", $parser->iNodeValue, 2); *************** *** 118,122 **** //http://www.sportsline.com/nfl/gamecenter/live//NFL_20070817_MIN@NYJ ! echo " -- " . "http://www.sportsline.com/nfl/gamecenter/live//NFL_" . $gamedate . "_" . $vabbv->getNFLTeamAbbv() . "@" . $habbv->getNFLTeamAbbv(); $thisGame = new OFFL_NFLGame(); --- 148,152 ---- //http://www.sportsline.com/nfl/gamecenter/live//NFL_20070817_MIN@NYJ ! echo " -- " . "http://www.sportsline.com/nfl/gamecenter/live/NFL_" . $gamedate . "_" . $vabbv->getNFLTeamAbbv() . "@" . $habbv->getNFLTeamAbbv(); $thisGame = new OFFL_NFLGame(); *************** *** 269,273 **** $timeDiff = time() - $game->getGametime(); if ($timeDiff > 0) ! { $url="http://www.sportsline.com/nfl/gamecenter/live//NFL_" . date("Ymd", $game->getGametime()) . "_" . $game->getVNFLTeamAbbv() . "@" . $game->getHNFLTeamAbbv(); } echo "<tr class=\""; --- 299,303 ---- $timeDiff = time() - $game->getGametime(); if ($timeDiff > 0) ! { $url="http://www.sportsline.com/nfl/gamecenter/live/NFL_" . date("Ymd", $game->getGametime()) . "_" . $game->getVNFLTeamAbbv() . "@" . $game->getHNFLTeamAbbv(); } echo "<tr class=\""; *************** *** 605,607 **** } ! require($DOC_ROOT . "/lib/footer.php"); ?> \ No newline at end of file --- 635,637 ---- } ! require($DOC_ROOT . "/lib/footer.php"); ?> |
|
From: Brad S. <sc...@us...> - 2007-09-11 02:40:13
|
Update of /cvsroot/offl/offl In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv1129 Modified Files: Tag: 1.43 changelog.txt Log Message: Describes fixes on players.php and games.php. Index: changelog.txt =================================================================== RCS file: /cvsroot/offl/offl/changelog.txt,v retrieving revision 1.42 retrieving revision 1.43 diff -C2 -d -r1.42 -r1.43 *** changelog.txt 6 Sep 2007 14:14:11 -0000 1.42 --- changelog.txt 11 Sep 2007 02:40:12 -0000 1.43 *************** *** 1,2 **** --- 1,6 ---- + CHANGELOG FOR V0.2.7 + -- Fixed links for gamecenter pages at sportsline.com (www/games.php). + -- Removed incorrect function call for getPictureLoc and tried to replace it with getNFLProfile, but this needs more work. (www/players.php). + CHANGELOG FOR V0.2.6 -- Added ability to parse player, game, and statistics from CBS Sportsline, subsequently deprecating previous ability with nfl.com (www/htmlparser.inc). Thanks to vikesfan and stratego. |
|
From: Brad S. <sc...@us...> - 2007-09-11 02:38:17
|
Update of /cvsroot/offl/offl/www In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv341 Modified Files: Tag: 1.21 players.php Log Message: Deprecated getPictureLoc function calls. Need to tidy up code/display and get a better link for player pictures. Index: players.php =================================================================== RCS file: /cvsroot/offl/offl/www/players.php,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** players.php 6 Sep 2007 03:22:43 -0000 1.20 --- players.php 11 Sep 2007 02:38:13 -0000 1.21 *************** *** 36,40 **** $thisPlayer->setLastName($_REQUEST["lname"]); $thisPlayer->setFirstName($_REQUEST["fname"]); ! $thisPlayer->setPictureLoc($_REQUEST["picture_loc"]); $thisPlayer->setNFLTeamID($_REQUEST["nflteam_id"]); $thisPlayer->setPositionID($_REQUEST["position_id"]); --- 36,40 ---- $thisPlayer->setLastName($_REQUEST["lname"]); $thisPlayer->setFirstName($_REQUEST["fname"]); ! $thisPlayer->setPictureLoc($_REQUEST["nfl_profile"]); $thisPlayer->setNFLTeamID($_REQUEST["nflteam_id"]); $thisPlayer->setPositionID($_REQUEST["position_id"]); *************** *** 145,149 **** <tr> <td> ! <?php $pic = "http://images.nfl.com/images/players/60x80/" . $thisPlayer->getPictureLoc() . ".jpg"; //if (is_file("$pic")) { ?> <img src="<?php echo $pic; ?>" alt="<?php echo $thisPlayer->getName("FL");; ?>" align="left"> --- 145,149 ---- <tr> <td> ! <?php $pic = "http://images.nfl.com/images/players/60x80/" . $thisPlayer->getNFLProfile() . ".jpg"; //if (is_file("$pic")) { ?> <img src="<?php echo $pic; ?>" alt="<?php echo $thisPlayer->getName("FL");; ?>" align="left"> *************** *** 706,710 **** <tr> <th align="right">Picture Filename:</th> ! <td colspan="2"><input type="text" name="picture_loc" size="40" maxlength="80"<?php if($_REQUEST["mode"] == "edit") { ?> value="<?php echo $thisPlayer->getPictureLoc() ?>"<?php } ?>></td> </tr> <tr> --- 706,710 ---- <tr> <th align="right">Picture Filename:</th> ! <td colspan="2"><input type="text" name="picture_loc" size="40" maxlength="80"<?php if($_REQUEST["mode"] == "edit") { ?> value="<?php echo $thisPlayer->getNFLProfile() ?>"<?php } ?>></td> </tr> <tr> |
|
From: Brad S. <sc...@us...> - 2007-09-11 02:37:02
|
Update of /cvsroot/offl/offl/www In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv32052 Modified Files: Tag: 1.11 games.php Log Message: Fixed links for CBS Sportsline gamecenter pages. Index: games.php =================================================================== RCS file: /cvsroot/offl/offl/www/games.php,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** games.php 6 Sep 2007 03:34:05 -0000 1.10 --- games.php 11 Sep 2007 02:37:02 -0000 1.11 *************** *** 118,122 **** //http://www.sportsline.com/nfl/gamecenter/live//NFL_20070817_MIN@NYJ ! echo " -- " . "http://www.sportsline.com/nfl/gamecenter/live/NFL_" . $gamedate . "_" . $vabbv->getNFLTeamAbbv() . "@" . $habbv->getNFLTeamAbbv(); $thisGame = new OFFL_NFLGame(); --- 118,122 ---- //http://www.sportsline.com/nfl/gamecenter/live//NFL_20070817_MIN@NYJ ! echo " -- " . "http://www.sportsline.com/nfl/gamecenter/live//NFL_" . $gamedate . "_" . $vabbv->getNFLTeamAbbv() . "@" . $habbv->getNFLTeamAbbv(); $thisGame = new OFFL_NFLGame(); *************** *** 269,273 **** $timeDiff = time() - $game->getGametime(); if ($timeDiff > 0) ! { $url="http://www.nfl.com/gamecenter/live/NFL_" . date("Ymd", $game->getGametime()) . "_" . $game->getVNFLTeamAbbv() . "@" . $game->getHNFLTeamAbbv(); } echo "<tr class=\""; --- 269,273 ---- $timeDiff = time() - $game->getGametime(); if ($timeDiff > 0) ! { $url="http://www.sportsline.com/nfl/gamecenter/live//NFL_" . date("Ymd", $game->getGametime()) . "_" . $game->getVNFLTeamAbbv() . "@" . $game->getHNFLTeamAbbv(); } echo "<tr class=\""; |
|
From: Brad S. <sc...@us...> - 2007-09-11 02:03:07
|
Update of /cvsroot/offl/offl/www/maintenance In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv19126 Modified Files: Tag: 1.20 processstats.php Log Message: Fixed directory path for offlconfig.php on line 41, so it now looks up one directory level from inside the maintenance folder (this works assuming the maintenance folder doesn't get moved). Index: processstats.php =================================================================== RCS file: /cvsroot/offl/offl/www/maintenance/processstats.php,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** processstats.php 6 Sep 2007 03:38:27 -0000 1.19 --- processstats.php 11 Sep 2007 02:03:08 -0000 1.20 *************** *** 79,83 **** $maintenance = TRUE; ! require_once("offlconfig.php"); require_once($DOC_ROOT . "/lib/header.php"); --- 79,83 ---- $maintenance = TRUE; ! require_once("../offlconfig.php"); require_once($DOC_ROOT . "/lib/header.php"); |
|
From: Brad S. <sc...@us...> - 2007-09-06 14:27:53
|
Update of /cvsroot/offl/offl/www/lib In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv24568 Modified Files: Tag: 1.14 VERSION Log Message: Updated to 0.2.6 Index: VERSION =================================================================== RCS file: /cvsroot/offl/offl/www/lib/VERSION,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** VERSION 9 Sep 2006 06:13:46 -0000 1.13 --- VERSION 6 Sep 2007 14:27:55 -0000 1.14 *************** *** 1 **** ! 0.2.5 \ No newline at end of file --- 1 ---- ! 0.2.6 \ No newline at end of file |
|
From: Brad S. <sc...@us...> - 2007-09-06 14:14:17
|
Update of /cvsroot/offl/offl In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv19396 Modified Files: Tag: 1.42 changelog.txt Log Message: Completed list of updated files for 0.2.6 Index: changelog.txt =================================================================== RCS file: /cvsroot/offl/offl/changelog.txt,v retrieving revision 1.41 retrieving revision 1.42 diff -C2 -d -r1.41 -r1.42 *** changelog.txt 9 Sep 2006 06:27:29 -0000 1.41 --- changelog.txt 6 Sep 2007 14:14:11 -0000 1.42 *************** *** 1,2 **** --- 1,9 ---- + CHANGELOG FOR V0.2.6 + -- Added ability to parse player, game, and statistics from CBS Sportsline, subsequently deprecating previous ability with nfl.com (www/htmlparser.inc). Thanks to vikesfan and stratego. + -- Added ability to migrate existing player data from nfl.com based player IDs to CBS Sportsline (www/updateroster-CBS-nfl_profile.php). Thanks to vikesfan. + -- Added ability to update player data with CBS Sportsline (www/updateroster-CBS-htmlparser.php). Thanks to vikesfan. + -- Added ability to scrape stats from CBS Sportsline (www/maintenance/processstats.php). Thanks to stratego. + -- Added ability for league administrators to be able to update player data with CBS Sportsline from in admin console (www/players.php). + CHANGELOG FOR V0.2.5 -- Fixed bug where kickers and team defenses were not compiling stats correctly. (www/maintenance/processstats.php). Thanks to vikesfan. |
|
From: Brad S. <sc...@us...> - 2007-09-06 13:33:27
|
Update of /cvsroot/offl/offl/sql/tables In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv3217 Modified Files: Tag: 1.1.1.2 nflgames.sql Log Message: Updated to handle vikesfan's changes for CBS Sportsline import. Index: nflgames.sql =================================================================== RCS file: /cvsroot/offl/offl/sql/tables/nflgames.sql,v retrieving revision 1.1.1.1 retrieving revision 1.1.1.2 diff -C2 -d -r1.1.1.1 -r1.1.1.2 *** nflgames.sql 16 Aug 2004 00:31:36 -0000 1.1.1.1 --- nflgames.sql 6 Sep 2007 13:33:29 -0000 1.1.1.2 *************** *** 1,11 **** - drop table if exists `nflgames`; CREATE TABLE `nflgames` ( ! `nflgame_id` SMALLINT unsigned NOT NULL AUTO_INCREMENT , ! `year` SMALLINT unsigned, ! `week` TINYINT unsigned, ! `gametime` DATETIME, ! `h_nflteam_id` SMALLINT unsigned, ! `v_nflteam_id` SMALLINT unsigned, ! PRIMARY KEY ( `nflgame_id` ) ); \ No newline at end of file --- 1,10 ---- drop table if exists `nflgames`; CREATE TABLE `nflgames` ( ! `nflgame_id` smallint(5) unsigned NOT NULL AUTO_INCREMENT, ! `year` smallint(5) unsigned DEFAULT NULL, ! `week` tinyint(3) unsigned DEFAULT NULL, ! `gametime` datetime DEFAULT NULL, ! `h_nflteam_id` smallint(5) unsigned DEFAULT NULL, ! `v_nflteam_id` smallint(5) unsigned DEFAULT NULL, ! PRIMARY KEY (`nflgame_id`) ); \ No newline at end of file |
|
From: Brad S. <sc...@us...> - 2007-09-06 13:16:37
|
Update of /cvsroot/offl/offl/sql/load In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv28632 Modified Files: Tag: 1.10 load_control.sql Log Message: Included control value for 2007 season. Index: load_control.sql =================================================================== RCS file: /cvsroot/offl/offl/sql/load/load_control.sql,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** load_control.sql 5 Sep 2006 07:38:44 -0000 1.9 --- load_control.sql 6 Sep 2007 13:16:39 -0000 1.10 *************** *** 19,23 **** insert into `control` (`control_key`,`control_value`,`control_desc`) values ('CONFIG_ROSTERVIOLATION_HOURS','168','Number of hours before a trade expires if its completion would violate roster constraints'); -- when does the season actually start? ! insert into `control` (`control_key`,`control_value`,`control_desc`,`all_leagues`) values ('MISC_SEASON_START_2006','2006-09-06 00:00:00','Should be set to the Tuesday or Wednesday prior to the first game. Governs `control` of current week relative to the NFL.',1); -- Use draft system --- 19,23 ---- insert into `control` (`control_key`,`control_value`,`control_desc`) values ('CONFIG_ROSTERVIOLATION_HOURS','168','Number of hours before a trade expires if its completion would violate roster constraints'); -- when does the season actually start? ! insert into `control` (`control_key`,`control_value`,`control_desc`,`all_leagues`) values ('MISC_SEASON_START_2007','2007-09-04 03:00:00','Should be set to the Tuesday or Wednesday prior to the first game. Governs `control` of current week relative to the NFL.',1); -- Use draft system |
|
From: Brad S. <sc...@us...> - 2007-09-06 12:53:20
|
Update of /cvsroot/offl/offl/www/upgrade In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv19466 Added Files: Tag: 1.0 upgrade-2007season.php Log Message: Upgrade for 2007 season. --- NEW FILE: upgrade-2007season.php --- <?php /** * Upgrade script for OFFL 0.2.3 (run on 0.2.x) * * This patch upgrades an OFFL 0.2.x install to OFFL 0.2.3. Notable changes include additional * game fields for description and playoff status. * * @author Stephen Rochelle <lo...@lo...> * @version OFFL v0.2 * @copyright Copyright (c) 2004 Stephen Rochelle. Some rights reserved. * @package offl-ui */ $pageTitle = ""; require_once("../offlconfig.php"); require_once($DOC_ROOT . "/lib/classes/offl_dbobject.php"); // gets database object for upgrading the DB. $fix = new OFFL_DBObject(); $fix->SQLQuery("INSERT INTO `control` ( `control_key` , `control_value` , `control_desc` , `control_allowed_values` , `league_id` , `all_leagues` ) VALUES ('MISC_SEASON_START_2007', '2007-09-04 03:00:00', 'Should be set to the Tuesday or Wednesday prior to the first game. Governs `control` of current week relative to the NFL.', NULL , '0', '1')"); echo "<p>2007 NFL season start date has been configured successfully.</p>"; exit(); ?> |
|
From: Brad S. <sc...@us...> - 2007-09-06 03:38:26
|
Update of /cvsroot/offl/offl/www/maintenance In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv28797 Modified Files: Tag: 1.19 processstats.php Log Message: Updated stat parsing through CBS Sportsline. Thanks to stratego. |
|
From: Brad S. <sc...@us...> - 2007-09-06 03:34:05
|
Update of /cvsroot/offl/offl/www In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv27069 Modified Files: Tag: 1.10 games.php Log Message: Pulls updated schedule from CBS Sportsline. Index: games.php =================================================================== RCS file: /cvsroot/offl/offl/www/games.php,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** games.php 3 Jul 2006 17:34:03 -0000 1.9 --- games.php 6 Sep 2007 03:34:05 -0000 1.10 *************** *** 63,175 **** $result = mysql_query($sql,$dbconn) or die (mysql_error() . ": $sql"); ! foreach ($schedulearray as $line) ! { ! $schedule .= $line; ! } ! ! list ($beforesched, $aftersched) = explode("<div class=\"SLTables1\">", $schedule, 2); ! list ($schedule, $aftersched) = explode("<a name=\"post\">", $aftersched, 2); ! $weeks = explode ("<a name=\"week", $schedule); ! foreach ($weeks as $j=>$week) ! { ! if ($j == 0) ! continue; ! echo "<h2>Week $j</h2>\n\n"; ! $days = explode ("<font class=bg1font><b>", $week); ! foreach ($days as $n=>$day) ! { ! if ($n == 0) ! continue; ! debugprint($day); ! $game_date_array = explode("</b></font>", $day); ! debugprint($game_date_array[1]); ! $day_date = explode(",", $game_date_array[0]); ! $date = ltrim($day_date[1]); ! $games = $game_date_array[1]; ! $weekstd = explode("</tr>", $games); // break apart all games for the week ! foreach ($weekstd as $i=>$thisgame) ! { ! if ($i > 0) ! { ! @list($rest, $thisgame) = explode("<td align=left>", $thisgame, 2); ! } ! debugprint($thisgame); ! $thisgamedata = explode("<td align=left>", $thisgame); ! @list ($vTeam, $rest) = explode(" at ", $thisgamedata[0], 2); ! @list ($hTeam, $rest) = explode("<", $rest, 2); ! @list ($time, $rest) = explode("<", $thisgamedata[1], 2); ! $time = ltrim(strip_tags($time)); ! ! if ($hTeam != "") ! { ! unset($home_team); ! unset($visiting_team); ! foreach ($nfl_teams as $team) ! { ! if (($team->getNFLTeamCity() == $hTeam) || (strstr($hTeam, $team->getNFLTeamName()))) ! $home_team = $team; ! if (($team->getNFLTeamCity() == $vTeam) || (strstr($vTeam, $team->getNFLTeamName()))) ! $visiting_team = $team; ! } ! if (!isset($home_team) || !isset($visiting_team)) ! { ! echo "couldn't look up teams!"; ! } ! else ! { ! $full_datetime = "$date " . $_GET["year"] . " $time"; ! $datetime_str = strtotime(str_replace(".", "", $full_datetime)); // remove period from month abbr if applicable, convert to timestamp ! echo "<p>" . $visiting_team->getNFLTeamName() . " at " . $home_team->getNFLTeamName() . ", " . date("g:i A, D M j, Y", $datetime_str) . "</p>\n\n"; ! $thisGame = new OFFL_NFLGame(); ! $thisGame->setYear($_GET["year"]); ! $thisGame->setWeek($j); ! $thisGame->setGametime($datetime_str); ! $thisGame->setHNFLTeamID($home_team->getNFLTeamID()); ! $thisGame->setVNFLTeamID($visiting_team->getNFLTeamID()); ! $thisGame->save(); ! } ! } ! else // other data to extract ! { ! @list ($junk, $offteams) = explode("Open date:</b> ", $weekstd[$i], 2); ! if ($offteams != "") ! { ! list ($tm1, $tm2, $tm3, $tm4raw) = explode(", ", $offteams, 4); ! list ($tm4, $junk) = explode("<", $tm4raw, 2); ! foreach ($nfl_teams as $team) ! { ! if (($team->getNFLTeamCity() == $tm1) || (strstr($tm1, $team->getNFLTeamName()))) ! $team_1 = $team; ! if (($team->getNFLTeamCity() == $tm2) || (strstr($tm2, $team->getNFLTeamName()))) ! $team_2 = $team; ! if (($team->getNFLTeamCity() == $tm3) || (strstr($tm3, $team->getNFLTeamName()))) ! $team_3 = $team; ! if (($team->getNFLTeamCity() == $tm4) || (strstr($tm4, $team->getNFLTeamName()))) ! $team_4 = $team; ! } ! // echo "<p>Bye Teams: $tm1, $tm2, $tm3, $tm4</p>\n\n"; ! echo "<p>Bye Teams: " . $team_1->getNFLTeamName(); ! echo ", " . $team_2->getNFLTeamName(); ! echo ", " . $team_3->getNFLTeamName(); ! echo ", " . $team_4->getNFLTeamName(); ! echo "</p>\n\n"; ! ! } ! } ! } } ! } } // end step 2 --- 63,133 ---- $result = mysql_query($sql,$dbconn) or die (mysql_error() . ": $sql"); ! include ("./lib/inc/htmlparser.inc"); ! ! // require_once("offlconfig.php"); ! // require_once($DOC_ROOT . "/lib/header.php"); ! //this retrieves the game page ! $filename = "http://www.sportsline.com/nfl/schedules/regular"; ! $sched = file($filename); ! $schedstring = ""; ! //appends ! foreach ($sched as $schedline) { ! $schedstring .= $schedline . "\n\n"; ! } ! ! list($junk, $schedstring) = explode("<font class=\"lead\"><b>All times are US/Eastern</b></font><p>", $schedstring, 2); ! list($schedstring, $junk) = explode("<div class=\"spacer10\"> </div>", $schedstring, 2); ! //echo $schedstring; ! ! $parser = new HtmlParser ($schedstring); ! while ($parser->parse()) { ! //echo "iNodeName: " . $parser->iNodeName . ", iNodeValue: " . $parser->iNodeValue . ", iNodeType: " . $parser->iNodeType . "<br/>"; ! $attrValues = $parser->iNodeAttributes; ! if (strpos(trim($parser->iNodeValue), "WEEK") !== false) { ! list($junk, $gameweek) = explode("WEEK ", $parser->iNodeValue, 2); ! echo "Week Nbr: " . $gameweek . "<br/>"; ! } ! if (strpos(trim($parser->iNodeValue), "y,") !== false) { ! echo "<br/>--" . $parser->iNodeValue; ! } ! if (strpos(trim($parser->iNodeValue), " at ") !== false) { ! list($vteam, $hteam) = explode(" at ", $parser->iNodeValue, 2); ! echo "<br/>----" . $parser->iNodeValue; ! $x = new OFFL_NFLTeam(); ! $vabbv = $x->getNFLTeamBySchedName($vteam); ! $habbv = $x->getNFLTeamBySchedName($hteam); ! } ! ! if (strpos(trim($parser->iNodeValue), "document.write(formatTime") !== false) { ! list($junk, $gametime) = explode("document.write(formatTime('%I:%M %p', ", $parser->iNodeValue, 2); ! list($gametime, $junk) = explode("))", $gametime, 2); ! echo " -- " . date("g:i A, D M j, Y", $gametime); ! ! $gamedate = date('Ymd', $gametime); ! //http://www.sportsline.com/nfl/gamecenter/live//NFL_20070817_MIN@NYJ ! echo " -- " . "http://www.sportsline.com/nfl/gamecenter/live/NFL_" . $gamedate . "_" . $vabbv->getNFLTeamAbbv() . "@" . $habbv->getNFLTeamAbbv(); ! ! $thisGame = new OFFL_NFLGame(); ! $thisGame->setYear($_GET["year"]); ! $thisGame->setWeek($gameweek); ! $thisGame->setGametime($gametime); ! $thisGame->setHNFLTeamID($habbv->getNFLTeamID()); ! $thisGame->setVNFLTeamID($vabbv->getNFLTeamID()); ! //echo "Save game: " . $thisGame->getYear() . ", " . $thisGame->getWeek() . ", " . $thisGame->getGametime() . ", " . $thisGame->getHNFLTeamID() . ", " . $thisGame->getVNFLTeamID() . "<br/>"; ! $thisGame->save(); } ! } } // end step 2 |
|
From: Brad S. <sc...@us...> - 2007-09-06 03:31:32
|
Update of /cvsroot/offl/offl/www/lib/classes In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv26041 Modified Files: Tag: 1.3 offl_nflteam.php Log Message: Adds "getNFLTeamByAbbv" function. Index: offl_nflteam.php =================================================================== RCS file: /cvsroot/offl/offl/www/lib/classes/offl_nflteam.php,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** offl_nflteam.php 22 Sep 2004 04:05:46 -0000 1.2 --- offl_nflteam.php 6 Sep 2007 03:31:34 -0000 1.3 *************** *** 201,204 **** --- 201,222 ---- /** + * Returns an OFFL_NFLTeam object by NFL.com abbreviation + * + * @param string $abbv i.e. "TEN" or "IND" + * @return OFFL_NFLTeam + */ + function getNFLTeamBySchedName($schedName) + { + $sql = "SELECT nflteam_id FROM nflteams WHERE nflteam_schedulename='" . mysql_escape_string($schedName) . "'"; + $result = mysql_query($sql,$this->_conn) or die (mysql_error() . ": $sql"); + + $team = new OFFL_NFLTeam(mysql_result($result,0,"nflteam_id")); + + mysql_free_result($result); + + return $team; + } + + /** * Returns an array of all registered NFL teams * *************** *** 209,212 **** --- 227,240 ---- $retArr = array(); $sql = "SELECT nflteam_id FROM nflteams ORDER BY nflteam_city, nflteam_name"; + + //$sql = "SELECT nflteam_id FROM nflteams WHERE nflteam_id <= 4 ORDER BY nflteam_city, nflteam_name"; + //$sql = "SELECT nflteam_id FROM nflteams WHERE nflteam_id >= 5 AND nflteam_id <= 8 ORDER BY nflteam_city, nflteam_name"; + //$sql = "SELECT nflteam_id FROM nflteams WHERE nflteam_id >= 9 AND nflteam_id <= 12 ORDER BY nflteam_city, nflteam_name"; + //$sql = "SELECT nflteam_id FROM nflteams WHERE nflteam_id >= 13 AND nflteam_id <= 16 ORDER BY nflteam_city, nflteam_name"; + //$sql = "SELECT nflteam_id FROM nflteams WHERE nflteam_id >= 17 AND nflteam_id <= 20 ORDER BY nflteam_city, nflteam_name"; + //$sql = "SELECT nflteam_id FROM nflteams WHERE nflteam_id >= 21 AND nflteam_id <= 24 ORDER BY nflteam_city, nflteam_name"; + //$sql = "SELECT nflteam_id FROM nflteams WHERE nflteam_id >= 25 AND nflteam_id <= 28 ORDER BY nflteam_city, nflteam_name"; + //$sql = "SELECT nflteam_id FROM nflteams WHERE nflteam_id >= 29 AND nflteam_id <= 32 ORDER BY nflteam_city, nflteam_name"; + $result = mysql_query($sql,$this->_conn) or die (mysql_error() . ": $sql"); |
|
From: Brad S. <sc...@us...> - 2007-09-06 03:29:20
|
Update of /cvsroot/offl/offl/www In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv25211 Added Files: Tag: 1.0 alternflteams.php Log Message: Retrieves nflteam_id by the teams name on the CBS Sportsline schedule site. --- NEW FILE: alternflteams.php --- <?php include ("htmlparser.inc"); require_once("offlconfig.php"); require_once($DOC_ROOT . "/lib/header.php"); $sqllist = Array(); //change all nfl_profiles to point to CBS Sportsline //$sqllist[0] = "ALTER TABLE nflteams DROP nflteam_schedulenamex"; $sqllist[1] = "ALTER TABLE nflteams ADD nflteam_schedulename varchar(100)"; $sqllist[2] = "UPDATE nflteams SET nflteam_schedulename = nflteam_city"; $sqllist[3] = "UPDATE nflteams SET nflteam_schedulename = 'N.Y. Jets' WHERE nflteam_name = 'Jets'"; $sqllist[4] = "UPDATE nflteams SET nflteam_schedulename = 'N.Y. Giants' WHERE nflteam_name = 'Giants'"; $db = new OFFL_DBObject(); $dbconn = $db->getConn(); foreach ($sqllist as $sql) { $result = mysql_query($sql, $dbconn); echo "$result - $sql<br>\n"; } $db->closeDB(); echo "<br/>Any line with a - not preceded by a 1 means it failed! This is OK on ALTER TABLE if already executed!"; echo "<h2>Players NFL Teams table update complete!</h2>"; echo "This only needs to be executed once!"; ?> |
|
From: Brad S. <sc...@us...> - 2007-09-06 03:24:18
|
Update of /cvsroot/offl/offl/www In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv23304 Modified Files: Tag: 1.01 updateroster-CBS-nfl_profile.php Log Message: Cleaned up code. Index: updateroster-CBS-nfl_profile.php =================================================================== RCS file: /cvsroot/offl/offl/www/updateroster-CBS-nfl_profile.php,v retrieving revision 1.0 retrieving revision 1.01 diff -C2 -d -r1.0 -r1.01 *** updateroster-CBS-nfl_profile.php 3 Sep 2007 07:53:59 -0000 1.0 --- updateroster-CBS-nfl_profile.php 6 Sep 2007 03:24:18 -0000 1.01 *************** *** 43,46 **** --- 43,48 ---- echo "<h2>Players NFL Profile update complete!</h2>"; + echo "This only needs to be executed once!"; + |
|
From: Brad S. <sc...@us...> - 2007-09-06 03:22:43
|
Update of /cvsroot/offl/offl/www In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv22553 Modified Files: Tag: 1.20 players.php Log Message: Unified place to update all players from CBS Sportsline. Index: players.php =================================================================== RCS file: /cvsroot/offl/offl/www/players.php,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** players.php 3 Sep 2007 08:11:03 -0000 1.19 --- players.php 6 Sep 2007 03:22:43 -0000 1.20 *************** *** 36,39 **** --- 36,40 ---- $thisPlayer->setLastName($_REQUEST["lname"]); $thisPlayer->setFirstName($_REQUEST["fname"]); + $thisPlayer->setPictureLoc($_REQUEST["picture_loc"]); $thisPlayer->setNFLTeamID($_REQUEST["nflteam_id"]); $thisPlayer->setPositionID($_REQUEST["position_id"]); *************** *** 136,189 **** <?php } ! else // playerid is not empty ! { ! // Show information of given player ! $thisPlayer = new OFFL_Player($_REQUEST["player_id"], $_SESSION["league_id"]); ! ?> ! <table border="0" width="75%"> ! <tr> ! <td> ! <?php ! $pos = strrpos($thisPlayer->getNFLProfile(), "/"); ! if ($pos === false) ! { ! // not found ! // check if it is a team ! $length = strlen($thisPlayer->getNFLProfile()); ! if ($length > 1) ! { ! // is a team ! $pic = "http://images.nfl.com/images/helmets/134x121/"; ! $temp = $thisPlayer->getNFLProfile(); ! $pic = $pic . $temp; ! $pic = $pic . ".gif"; ! } ! else ! { ! $pic = ""; ! } ! } ! else ! { ! // found ! $pic="http://images.nfl.com/images/players/60x80"; ! $temp = substr($thisPlayer->getNFLProfile(),$pos); ! $pic = $pic . $temp; ! $pic = $pic . ".jpg"; ! } ! ! // only display pic if found ! if($pic != "") ! { ! ?> ! <img src="<?php echo $pic; ?>" alt="<?php echo $thisPlayer->getName("FL");; ?>" align="left"> ! <? ! } ! ?> ! <div class="bigger"><?php echo $thisPlayer->getName("FL"); ?></div> ! ! <?php echo $thisPlayer->getPositionName() . ", " . $thisPlayer->getNFLTeamCity() . " " . $thisPlayer->getNFLTeamName(); ?><br> ! <?php /* ******************* *\ stats here --- 137,157 ---- <?php } ! else // playerid is not empty ! { ! // Show information of given player ! $thisPlayer = new OFFL_Player($_REQUEST["player_id"], $_SESSION["league_id"]); ! ?> ! <table border="0" width="75%"> ! <tr> ! <td> ! <?php $pic = "http://images.nfl.com/images/players/60x80/" . $thisPlayer->getPictureLoc() . ".jpg"; ! //if (is_file("$pic")) { ?> ! <img src="<?php echo $pic; ?>" alt="<?php echo $thisPlayer->getName("FL");; ?>" align="left"> ! <?php //} ?> ! <div class="bigger"><?php echo $thisPlayer->getName("FL"); ?></div> ! ! <?php echo $thisPlayer->getPositionName() . ", " . $thisPlayer->getNFLTeamCity() . " " . $thisPlayer->getNFLTeamName(); ?><br> ! <?php /* ******************* *\ stats here *************** *** 641,645 **** </td> <td> ! <form name="getnfltrades" action="<?php echo $WEB_ROOT; ?>/updateroster-CBS-htmlparser.php"> <input type="hidden" name="mode" value="getall" /> <input type="hidden" name="tradetrack" value="on" /> --- 609,613 ---- </td> <td> ! <form name="getnfltrades" action="<?php echo $WEB_ROOT; ?>/players.php"> <input type="hidden" name="mode" value="getall" /> <input type="hidden" name="tradetrack" value="on" /> *************** *** 737,740 **** --- 705,712 ---- </tr> <tr> + <th align="right">Picture Filename:</th> + <td colspan="2"><input type="text" name="picture_loc" size="40" maxlength="80"<?php if($_REQUEST["mode"] == "edit") { ?> value="<?php echo $thisPlayer->getPictureLoc() ?>"<?php } ?>></td> + </tr> + <tr> <th align="right">NFL Team:</th> <td colspan="2"> *************** *** 1002,1149 **** */ ! $x = new OFFL_NFLTeam(); ! $teams = $x->getAllNFLTeams(); ! $x = new OFFL_Position(); ! $positions = $x->getAllPositions(); ! $pos_id = Array(); ! $pos_name = Array(); ! foreach ($positions as $position) ! { ! $pos_id[$position->getPositionAbbv()] = $position->getPositionID(); ! $pos_name[$position->getPositionID()] = $position->getPositionAbbv(); ! } $sqllist = Array(); ! $sqllist[0] = "UPDATE players SET active=0 WHERE position_id<>8"; // not defense (I can ignore that) ! // here's the main team iterative loop ! foreach($teams as $i=>$team) ! { ! // echo $team->getNFLTeamAbbv() . " (" . $team->getNFLTeamID() . ")<br>"; ! ! $nflteam = $team->getNFLTeamAbbv(); ! $nflteam_id = $team->getNFLTeamID(); ! ! $teamroster = file("http://www.nfl.com/teams/rosters/$nflteam"); ! $teamstring = ""; ! ! foreach ($teamroster as $teamline) ! { ! $teamstring .= $teamline; ! } ! ! //echo $teamstring; ! ! // debugprint($teamstring); ! $teamstring = str_replace("</tr>", "</tr>\n", $teamstring); ! ! list($beforetable, $tableandafter) = explode("<div class=SLTables1>", $teamstring, 2); ! ! // debugprint($tableandafter); ! unset($beforetable); ! unset($teamstring); ! list($table, $aftertable) = explode("</table>", $tableandafter, 2); ! unset($aftertable); ! unset($tableandafter); ! list($empty, $table) = explode("College</td></tr>", $table, 2); ! ! // debugprint($table); ! ! // echo $table; ! ! $players_raw = explode("<tr", $table); ! ! // for ($i = 3; $i < sizeof($players_raw); $i++) ! foreach($players_raw as $i=>$player_row) ! { ! if ($i == 0) ! continue; //skip the empty first entry ! ! $player_temp = explode("<td", $player_row, 5); ! ! if (strpos($player_temp[2], "/players")) ! // this finds players who don't have NFL.com profiles ! // the condition might should be changed to check for "href=", though ! { ! @list($temp1, $player[$i][3], $player[$i][0], $temp2) = explode(">", $player_temp[2]); ! } ! else ! { ! @list($temp1, $player[$i][0], $temp2) = explode(">", $player_temp[2]); ! } ! @list($temp1, $player[$i][2], $temp2) = explode(">", $player_temp[3]); ! ! @list($player[$i][0], $player[$i][1]) = explode(",", $player[$i][0], 2); ! @list($player[$i][1], $temp1) = explode("<", $player[$i][1], 2); ! @list($player[$i][2], $temp1) = explode("<", $player[$i][2], 2); ! @list($temp1, $player[$i][3], $temp2) = explode("\"", $player[$i][3], 3); ! $player[$i][3] = trim($player[$i][3]); ! if ($player[$i][3] != "") // should fix finding players w/o profiles. ! $player[$i][3] = "http://www.nfl.com" . $player[$i][3]; ! ! // get rid of the leading space on player first names ! $player[$i][1] = ltrim($player[$i][1]); ! ! $player[$i][0] = mysql_escape_string($player[$i][0]); // last name ! $player[$i][1] = mysql_escape_string($player[$i][1]); // first name ! ! if (strcmp($player[$i][2], "FB") == 0) ! $player[$i][2] = "RB"; ! ! foreach ($pos_name as $pos) ! { ! if (strcmp($player[$i][2], $pos) == 0) ! { ! $player[$i][2] = $pos_id[$pos]; ! break; ! } ! } ! ! debugprint($player[$i]); ! ! } ! $teaminfo = $players_raw[1]; ! list($temp1, $teaminfo, $temp2) = explode("font>", $teaminfo); ! list($teaminfo, $temp1) = explode("<", $teaminfo); ! $teaminfo = explode(" ", $teaminfo); ! $teamname = $teaminfo[sizeof($teaminfo) - 1]; ! ! // echo ($teamname) . "<br>"; ! ! unset($players_raw); ! unset($player_temp); ! ! $player_lookup = new OFFL_Player(); ! ! foreach($player as $plyr) ! { ! // if (($plyr[2] == "QB") || ($plyr[2] == "RB") || ($plyr[2] == "WR") || ($plyr[2] == "TE") || ($plyr[2] == "K")) ! if (($plyr[2] > 0) && ($plyr[2] < 50)) ! { ! $new_player = $player_lookup->getPlayerByNFLProfile($plyr[3]); ! ! if ($new_player === FALSE) ! $sqllist[] = "INSERT INTO `players` (lname,fname,nflteam_id,position_id,nfl_profile) VALUES ('$plyr[0]','$plyr[1]',$nflteam_id,$plyr[2],'$plyr[3]')"; ! else ! $sqllist[] = "UPDATE players SET active=1, nflteam_id=$nflteam_id WHERE player_id=" . $new_player->getPlayerID(); } } ! unset ($player); ! } ! ! $sqllist[] = "UPDATE players SET nflteam_id=0 WHERE active=0"; ! /* ! The SQL statements are prepared. Now open the database and run them. ! */ ! $db = new OFFL_DBObject(); ! $dbconn = $db->getConn(); ! ! foreach ($sqllist as $sql) ! $result = mysql_query($sql, $dbconn); ! ! // echo "$sql<br>\n"; ! ! $db->closeDB(); echo "<h2>Trade update complete!</h2>"; --- 974,1291 ---- */ ! // $x = new OFFL_NFLTeam(); ! // $teams = $x->getAllNFLTeams(); ! // $x = new OFFL_Position(); ! // $positions = $x->getAllPositions(); ! // $pos_id = Array(); ! // $pos_name = Array(); ! // ! // foreach ($positions as $position) ! // { ! // $pos_id[$position->getPositionAbbv()] = $position->getPositionID(); ! // $pos_name[$position->getPositionID()] = $position->getPositionAbbv(); ! // } ! // ! // $sqllist = Array(); ! // $sqllist[0] = "UPDATE players SET active=0 WHERE position_id<>8"; // not defense (I can ignore that) ! // ! // // here's the main team iterative loop ! // foreach($teams as $i=>$team) ! // { ! // // echo $team->getNFLTeamAbbv() . " (" . $team->getNFLTeamID() . ")<br>"; ! // ! // $nflteam = $team->getNFLTeamAbbv(); ! // $nflteam_id = $team->getNFLTeamID(); ! // ! // $teamroster = file("http://www.nfl.com/teams/rosters/$nflteam"); ! // $teamstring = ""; ! // ! // foreach ($teamroster as $teamline) ! // { ! // $teamstring .= $teamline; ! // } ! // ! // //echo $teamstring; ! // ! // // debugprint($teamstring); ! // $teamstring = str_replace("</tr>", "</tr>\n", $teamstring); ! // ! // list($beforetable, $tableandafter) = explode("<div class=SLTables1>", $teamstring, 2); ! // ! // // debugprint($tableandafter); ! // unset($beforetable); ! // unset($teamstring); ! // list($table, $aftertable) = explode("</table>", $tableandafter, 2); ! // unset($aftertable); ! // unset($tableandafter); ! // list($empty, $table) = explode("College</td></tr>", $table, 2); ! // ! // // debugprint($table); ! // ! // // echo $table; ! // ! // $players_raw = explode("<tr", $table); ! // ! // // for ($i = 3; $i < sizeof($players_raw); $i++) ! // foreach($players_raw as $i=>$player_row) ! // { ! // if ($i == 0) ! // continue; //skip the empty first entry ! // ! // $player_temp = explode("<td", $player_row, 5); ! // ! // if (strpos($player_temp[2], "/players")) ! // // this finds players who don't have NFL.com profiles ! // // the condition might should be changed to check for "href=", though ! // { ! // @list($temp1, $player[$i][3], $player[$i][0], $temp2) = explode(">", $player_temp[2]); ! // } ! // else ! // { ! // @list($temp1, $player[$i][0], $temp2) = explode(">", $player_temp[2]); ! // } ! // @list($temp1, $player[$i][2], $temp2) = explode(">", $player_temp[3]); ! // ! // @list($player[$i][0], $player[$i][1]) = explode(",", $player[$i][0], 2); ! // @list($player[$i][1], $temp1) = explode("<", $player[$i][1], 2); ! // @list($player[$i][2], $temp1) = explode("<", $player[$i][2], 2); ! // @list($temp1, $player[$i][3], $temp2) = explode("\"", $player[$i][3], 3); ! // $player[$i][3] = trim($player[$i][3]); ! // if ($player[$i][3] != "") // should fix finding players w/o profiles. ! // $player[$i][3] = "http://www.nfl.com" . $player[$i][3]; ! // ! // // get rid of the leading space on player first names ! // $player[$i][1] = ltrim($player[$i][1]); ! // ! // $player[$i][0] = mysql_escape_string($player[$i][0]); // last name ! // $player[$i][1] = mysql_escape_string($player[$i][1]); // first name ! // ! // if (strcmp($player[$i][2], "FB") == 0) ! // $player[$i][2] = "RB"; ! // ! // foreach ($pos_name as $pos) ! // { ! // if (strcmp($player[$i][2], $pos) == 0) ! // { ! // $player[$i][2] = $pos_id[$pos]; ! // break; ! // } ! // } ! // ! // debugprint($player[$i]); ! // ! // } ! // $teaminfo = $players_raw[1]; ! // list($temp1, $teaminfo, $temp2) = explode("font>", $teaminfo); ! // list($teaminfo, $temp1) = explode("<", $teaminfo); ! // $teaminfo = explode(" ", $teaminfo); ! // $teamname = $teaminfo[sizeof($teaminfo) - 1]; ! // ! // // echo ($teamname) . "<br>"; ! // ! // unset($players_raw); ! // unset($player_temp); ! // ! // $player_lookup = new OFFL_Player(); ! // ! // foreach($player as $plyr) ! // { ! // // if (($plyr[2] == "QB") || ($plyr[2] == "RB") || ($plyr[2] == "WR") || ($plyr[2] == "TE") || ($plyr[2] == "K")) ! // if (($plyr[2] > 0) && ($plyr[2] < 50)) ! // { ! // $new_player = $player_lookup->getPlayerByNFLProfile($plyr[3]); ! // ! // if ($new_player === FALSE) ! // $sqllist[] = "INSERT INTO `players` (lname,fname,nflteam_id,position_id,nfl_profile) VALUES ('$plyr[0]','$plyr[1]',$nflteam_id,$plyr[2],'$plyr[3]')"; ! // else ! // $sqllist[] = "UPDATE players SET active=1, nflteam_id=$nflteam_id WHERE player_id=" . $new_player->getPlayerID(); ! // } ! // } ! // unset ($player); ! // } ! // ! // $sqllist[] = "UPDATE players SET nflteam_id=0 WHERE active=0"; ! // /* ! // The SQL statements are prepared. Now open the database and run them. ! // */ ! // $db = new OFFL_DBObject(); ! // $dbconn = $db->getConn(); ! // ! // foreach ($sqllist as $sql) ! // $result = mysql_query($sql, $dbconn); ! // ! // // echo "$sql<br>\n"; ! // ! // $db->closeDB(); ! // ! include ("./lib/inc/htmlparser.inc"); + $x = new OFFL_NFLTeam(); + $teams = $x->getAllNFLTeams(); + + foreach($teams as $team) { + $nflteamcity = $team->getNFLTeamCity(); + $nflteamname = $team->getNFLTeamName(); + $nflteamabbv = $team->getNFLTeamAbbv(); + $nflteamfullname = str_replace(" ", "", strtolower($nflteamcity . $nflteamname)); + + echo $nflteamfullname . "<br/>"; + } + + $x = new OFFL_Position(); + $positions = $x->getAllPositions(); + $pos_id = Array(); + $pos_name = Array(); + + foreach ($positions as $position) { + $pos_id[$position->getPositionAbbv()] = $position->getPositionID(); + $pos_name[$position->getPositionID()] = $position->getPositionAbbv(); + } + + $warnings = array(); + $playersmoved = array(); $sqllist = Array(); ! ! //do not reset defense ! $sqllist[0] = "UPDATE players SET active=0 WHERE position_id<>8"; ! $num = 0; ! ! // here's the main team iterative loop ! foreach($teams as $team) { ! $player = array(); ! // structure of the old player object: ! // $player[$i][0] last name ! // $player[$i][1] first name ! // $player[$i][2] position abbv ! // $player[$i][3] profile relative url ! // $player[$i][4] trash, but I'll use this to store nflteam_id ! ! $nflteamcity = $team->getNFLTeamCity(); ! $nflteamname = $team->getNFLTeamName(); ! $nflteamabbv = $team->getNFLTeamAbbv(); ! $nflteamfullname = str_replace(" ", "", strtolower($nflteamcity . $nflteamname)); ! ! //$teamurl = "http://www.nfl.com/teams/" . $nflteamfullname . "/roster?team=" . $nflteamabbv; ! $teamurl = "http://www.sportsline.com/nfl/teams/roster/" . $nflteamabbv; ! ! $nflteam_id = $team->getNFLTeamID(); ! ! $teamroster = file("$teamurl"); ! $teamstring = ""; ! ! foreach ($teamroster as $teamline) { ! $teamstring .= $teamline; ! } ! ! list($beforetable, $tableandafter) = explode("COLLEGE</a></td></tr>", $teamstring, 2); ! unset($beforetable); ! unset($teamstring); ! list($table, $aftertable) = explode("<tr id=special align=middle class=bg1>", $tableandafter, 2); ! unset($aftertable); ! unset($tableandafter); ! ! //echo $table; ! ! $parser = new HtmlParser ($table); ! ! $currentPlayerNbr = ''; ! $currentPlayerName = ''; ! $currentPlayerPosition = ''; ! $currentPlayerProfile = ''; ! ! while ($parser->parse()) { ! //echo $players_raw[$i] . "<br/>"; ! ! //echo $parser->iNodeType . " - " . $parser->iNodeName . " - " . $parser->iNodeValue . "<br/>"; ! ! if (($parser->iNodeType == 1) && ($parser->iNodeName == 'tr')) { ! //echo "new player<br/>"; ! $i++; ! $currentPlayerNbr = ''; ! $currentPlayerName = ''; ! $player_lname = ''; ! $player_fname = ''; ! $currentPlayerPosition = ''; ! $currentPlayerProfile = ''; ! } elseif (($parser->iNodeType == 1) && ($parser->iNodeName == 'a') && ($currentPlayerProfile == '')) { ! $attrValues = $parser->iNodeAttributes; ! $currentPlayerProfile = "http://www.sportsline.com" . $attrValues['href']; ! //$currentPlayerProfile = $attrValues['href']; ! } elseif (($parser->iNodeType == 3) && ($parser->iNodeName == 'Text') && ($currentPlayerNbr == '')) { ! $currentPlayerNbr = $parser->iNodeValue; ! } elseif (($parser->iNodeType == 3) && ($parser->iNodeName == 'Text') && ($currentPlayerName == '')) { ! $currentPlayerName = $parser->iNodeValue; ! ! list ($player_lname, $player_fname) = explode(", ", $currentPlayerName, 2); ! } elseif (($parser->iNodeType == 3) && ($parser->iNodeName == 'Text') && (trim($parser->iNodeValue) != '') && ($currentPlayerPosition == '')) { ! $currentPlayerPosition = $parser->iNodeValue; ! ! $player[$i][0] = $player_lname; ! $player[$i][1] = $player_fname; ! $player[$i][2] = $currentPlayerPosition; ! $player[$i][3] = $currentPlayerProfile; ! // $player[$i][4] = ''; // blank this out to use later for nflteam_id ! ! $player[$i][0] = mysql_escape_string($player[$i][0]); // last name ! $player[$i][1] = mysql_escape_string($player[$i][1]); // first name ! ! if (strcmp($player[$i][2], "FB") == 0) ! $player[$i][2] = "RB"; ! ! foreach ($pos_name as $pos) { ! if (strcmp($player[$i][2], $pos) == 0) { ! $player[$i][2] = $pos_id[$pos]; ! break; ! } ! } ! ! //echo $i . ":" . $currentPlayerNbr . " - " . $player_lname . " - " . $player_fname . " - " . $currentPlayerPosition . " - " . $currentPlayerProfile . "<br/>"; } + } + + foreach ($player AS $i=>$plr) { + //only handle players that are in a valid FFL position + if(is_numeric($player[$i][2])) { + //$sql = "SELECT player_id, nflteam_id, fname, lname, position_id, nfl_profile FROM players WHERE lname = '" . $player[$i][0] . "' AND fname = '" . $player[$i][1] . "'"; //nflteam_id = " . $team->getNFLTeamID() . " AND + $sql = "SELECT player_id, nflteam_id, fname, lname, position_id, nfl_profile FROM players WHERE nfl_profile = '" . $player[$i][3] . "'"; //nflteam_id = " . $team->getNFLTeamID() . " AND + $result = mysql_query($sql) or die (mysql_error() . ": $sql");//,$this->_conn + $multi = mysql_num_rows($result); + if($multi > 1) { + $warnings[]= "<tr><td colspan=\"8\">Warning, multiple players by this name: " . $player[$i][1] . " " . $player[$i][0] . "</td></tr>"; + } else { + if(mysql_result($result,0,"player_id") != "") { + $sqllist[] = "UPDATE players SET active=1, lname='" . $player[$i][0] . "', fname='" . $player[$i][1] . "', nflteam_id=" . $team->getNFLTeamID() . ", nfl_profile='" . $player[$i][3] . "' WHERE player_id=" . mysql_result($result,0,"player_id"); } + else { + $sqllist[] = "INSERT INTO players (lname,fname,nflteam_id,position_id,nfl_profile) VALUES ('" . $player[$i][0] . "','" . $player[$i][1] . "'," . $team->getNFLTeamID() . "," . $player[$i][2] . ",'" . $player[$i][3] . "')"; } + } + $num++; + } else { + unset($player[$i]); + } } ! } ! ! if(sizeof($warnings)) { ! echo "<table>"; ! echo "<tr><td>Following players not updated; handle these players manually:</td></tr>"; ! ! foreach($warnings AS $warning) { ! echo $warning; ! } ! ! echo "</table>"; ! } ! ! $db = new OFFL_DBObject(); ! $dbconn = $db->getConn(); ! ! foreach ($sqllist as $sql) { ! $result = mysql_query($sql, $dbconn); ! echo "$result - $sql<br>\n"; ! } ! ! $db->closeDB(); echo "<h2>Trade update complete!</h2>"; |
|
From: Brad S. <sc...@us...> - 2007-09-06 03:20:40
|
Update of /cvsroot/offl/offl/www/lib/inc In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv21775 Added Files: Tag: 1.0 htmlparser.inc Log Message: For parsing stats from CBS Sportsline. --- NEW FILE: htmlparser.inc --- <?php /* * Copyright (c) 2003 Jose Solorzano. All rights reserved. * Redistribution of source must retain this copyright notice. * * Jose Solorzano (http://jexpert.us) is a software consultant. * * Contributions by: * - Leo West (performance improvements) */ define ("NODE_TYPE_START",0); define ("NODE_TYPE_ELEMENT",1); define ("NODE_TYPE_ENDELEMENT",2); define ("NODE_TYPE_TEXT",3); define ("NODE_TYPE_COMMENT",4); define ("NODE_TYPE_DONE",5); /** * Class HtmlParser. * To use, create an instance of the class passing * HTML text. Then invoke parse() until it's false. * When parse() returns true, $iNodeType, $iNodeName * $iNodeValue and $iNodeAttributes are updated. * * To create an HtmlParser instance you may also * use convenience functions HtmlParser_ForFile * and HtmlParser_ForURL. */ class HtmlParser { /** * Field iNodeType. * May be one of the NODE_TYPE_* constants above. */ var $iNodeType; /** * Field iNodeName. * For elements, it's the name of the element. */ var $iNodeName = ""; /** * Field iNodeValue. * For text nodes, it's the text. */ var $iNodeValue = ""; /** * Field iNodeAttributes. * A string-indexed array containing attribute values * of the current node. Indexes are always lowercase. */ var $iNodeAttributes; // The following fields should be // considered private: var $iHtmlText; var $iHtmlTextLength; var $iHtmlTextIndex = 0; var $iHtmlCurrentChar; var $BOE_ARRAY; var $B_ARRAY; var $BOS_ARRAY; /** * Constructor. * Constructs an HtmlParser instance with * the HTML text given. */ function HtmlParser ($aHtmlText) { $this->iHtmlText = $aHtmlText; $this->iHtmlTextLength = strlen($aHtmlText); $this->iNodeAttributes = array(); $this->setTextIndex (0); $this->BOE_ARRAY = array (" ", "\t", "\r", "\n", "=" ); $this->B_ARRAY = array (" ", "\t", "\r", "\n" ); $this->BOS_ARRAY = array (" ", "\t", "\r", "\n", "/" ); } /** * Method parse. * Parses the next node. Returns false only if * the end of the HTML text has been reached. * Updates values of iNode* fields. */ function parse() { $text = $this->skipToElement(); if ($text != "") { $this->iNodeType = NODE_TYPE_TEXT; $this->iNodeName = "Text"; $this->iNodeValue = $text; return true; } return $this->readTag(); } function clearAttributes() { $this->iNodeAttributes = array(); } function readTag() { if ($this->iCurrentChar != "<") { $this->iNodeType = NODE_TYPE_DONE; return false; } $this->clearAttributes(); $this->skipMaxInTag ("<", 1); if ($this->iCurrentChar == '/') { $this->moveNext(); $name = $this->skipToBlanksInTag(); $this->iNodeType = NODE_TYPE_ENDELEMENT; $this->iNodeName = $name; $this->iNodeValue = ""; $this->skipEndOfTag(); return true; } $name = $this->skipToBlanksOrSlashInTag(); if (!$this->isValidTagIdentifier ($name)) { $comment = false; if (strpos($name, "!--") === 0) { $ppos = strpos($name, "--", 3); if (strpos($name, "--", 3) === (strlen($name) - 2)) { $this->iNodeType = NODE_TYPE_COMMENT; $this->iNodeName = "Comment"; $this->iNodeValue = "<" . $name . ">"; $comment = true; } else { $rest = $this->skipToStringInTag ("-->"); if ($rest != "") { $this->iNodeType = NODE_TYPE_COMMENT; $this->iNodeName = "Comment"; $this->iNodeValue = "<" . $name . $rest; $comment = true; // Already skipped end of tag return true; } } } if (!$comment) { $this->iNodeType = NODE_TYPE_TEXT; $this->iNodeName = "Text"; $this->iNodeValue = "<" . $name; return true; } } else { $this->iNodeType = NODE_TYPE_ELEMENT; $this->iNodeValue = ""; $this->iNodeName = $name; while ($this->skipBlanksInTag()) { $attrName = $this->skipToBlanksOrEqualsInTag(); if ($attrName != "" && $attrName != "/") { $this->skipBlanksInTag(); if ($this->iCurrentChar == "=") { $this->skipEqualsInTag(); $this->skipBlanksInTag(); $value = $this->readValueInTag(); $this->iNodeAttributes[strtolower($attrName)] = $value; } else { $this->iNodeAttributes[strtolower($attrName)] = ""; } } } } $this->skipEndOfTag(); return true; } function isValidTagIdentifier ($name) { return ereg ("^[A-Za-z0-9_\\-]+$", $name); } function skipBlanksInTag() { return "" != ($this->skipInTag ($this->B_ARRAY)); } function skipToBlanksOrEqualsInTag() { return $this->skipToInTag ($this->BOE_ARRAY); } function skipToBlanksInTag() { return $this->skipToInTag ($this->B_ARRAY); } function skipToBlanksOrSlashInTag() { return $this->skipToInTag ($this->BOS_ARRAY); } function skipEqualsInTag() { return $this->skipMaxInTag ("=", 1); } function readValueInTag() { $ch = $this->iCurrentChar; $value = ""; if ($ch == "\"") { $this->skipMaxInTag ("\"", 1); $value = $this->skipToInTag ("\""); $this->skipMaxInTag ("\"", 1); } else if ($ch == "'") { $this->skipMaxInTag ("'", 1); $value = $this->skipToInTag ("'"); $this->skipMaxInTag ("'", 1); } else { $value = $this->skipToBlanksInTag(); } return $value; } function setTextIndex ($index) { $this->iHtmlTextIndex = $index; if ($index >= $this->iHtmlTextLength) { $this->iCurrentChar = -1; } else { $this->iCurrentChar = $this->iHtmlText{$index}; } } function moveNext() { if ($this->iHtmlTextIndex < $this->iHtmlTextLength) { $this->setTextIndex ($this->iHtmlTextIndex + 1); return true; } else { return false; } } function skipEndOfTag() { while (($ch = $this->iCurrentChar) !== -1) { if ($ch == ">") { $this->moveNext(); return; } $this->moveNext(); } } function skipInTag ($chars) { $sb = ""; while (($ch = $this->iCurrentChar) !== -1) { if ($ch == ">") { return $sb; } else { $match = false; for ($idx = 0; $idx < count($chars); $idx++) { if ($ch == $chars[$idx]) { $match = true; break; } } if (!$match) { return $sb; } $sb .= $ch; $this->moveNext(); } } return $sb; } function skipMaxInTag ($chars, $maxChars) { $sb = ""; $count = 0; while (($ch = $this->iCurrentChar) !== -1 && $count++ < $maxChars) { if ($ch == ">") { return $sb; } else { $match = false; for ($idx = 0; $idx < count($chars); $idx++) { if ($ch == $chars[$idx]) { $match = true; break; } } if (!$match) { return $sb; } $sb .= $ch; $this->moveNext(); } } return $sb; } function skipToInTag ($chars) { $sb = ""; while (($ch = $this->iCurrentChar) !== -1) { $match = $ch == ">"; if (!$match) { for ($idx = 0; $idx < count($chars); $idx++) { if ($ch == $chars[$idx]) { $match = true; break; } } } if ($match) { return $sb; } $sb .= $ch; $this->moveNext(); } return $sb; } function skipToElement() { $sb = ""; while (($ch = $this->iCurrentChar) !== -1) { if ($ch == "<") { return $sb; } $sb .= $ch; $this->moveNext(); } return $sb; } /** * Returns text between current position and $needle, * inclusive, or "" if not found. The current index is moved to a point * after the location of $needle, or not moved at all * if nothing is found. */ function skipToStringInTag ($needle) { $pos = strpos ($this->iHtmlText, $needle, $this->iHtmlTextIndex); if ($pos === false) { return ""; } $top = $pos + strlen($needle); $retvalue = substr ($this->iHtmlText, $this->iHtmlTextIndex, $top - $this->iHtmlTextIndex); $this->setTextIndex ($top); return $retvalue; } } function HtmlParser_ForFile ($fileName) { return HtmlParser_ForURL($fileName); } function HtmlParser_ForURL ($url) { $fp = fopen ($url, "r"); $content = ""; while (true) { $data = fread ($fp, 8192); if (strlen($data) == 0) { break; } $content .= $data; } fclose ($fp); return new HtmlParser ($content); } php?> |