[ffl-cvs] old/ffl/patch ffl-0.7.3-update.diff,NONE,1.3
Status: Inactive
Brought to you by:
rizzo
From: Brad S. <sc...@us...> - 2004-08-06 00:14:14
|
Update of /cvsroot/ffl/old/ffl/patch In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19653 Modified Files: Tag: 1.3 ffl-0.7.3-update.diff Log Message: Added timestamping ability. Index: ffl-0.7.3-update.diff =================================================================== RCS file: /cvsroot/ffl/old/ffl/patch/ffl-0.7.3-update.diff,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** ffl-0.7.3-update.diff 30 Jul 2004 19:06:32 -0000 1.2 --- ffl-0.7.3-update.diff 6 Aug 2004 00:14:05 -0000 1.3 *************** *** 290,294 **** diff -ur ffl-0.7.2/php/lib/classes/fflteam.php ffl-0.7.3/php/lib/classes/fflteam.php --- ffl-0.7.2/php/lib/classes/fflteam.php Thu Sep 5 01:45:14 2002 ! +++ ffl-0.7.3/php/lib/classes/fflteam.php Fri Jul 30 14:02:55 2004 @@ -1,9 +1,9 @@ <? --- 290,294 ---- diff -ur ffl-0.7.2/php/lib/classes/fflteam.php ffl-0.7.3/php/lib/classes/fflteam.php --- ffl-0.7.2/php/lib/classes/fflteam.php Thu Sep 5 01:45:14 2002 ! +++ ffl-0.7.3/php/lib/classes/fflteam.php Thu Aug 5 19:08:34 2004 @@ -1,9 +1,9 @@ <? *************** *** 304,310 **** ! @@ -26,6 +26,7 @@ var $_division_desc; var $_username; var $_admin; + var $_active; --- 304,312 ---- ! @@ -25,7 +25,9 @@ ! var $_division_id; var $_division_desc; var $_username; + + var $_timestamper; var $_admin; + var $_active; *************** *** 312,316 **** var $_computed_year = 0; var $_overall_wins; ! @@ -73,6 +74,7 @@ $this->_coach_def = mysql_result($result,0,"coach_def"); $this->_coach_spec = mysql_result($result,0,"coach_spec"); --- 314,318 ---- var $_computed_year = 0; var $_overall_wins; ! @@ -73,7 +75,9 @@ $this->_coach_def = mysql_result($result,0,"coach_def"); $this->_coach_spec = mysql_result($result,0,"coach_spec"); *************** *** 318,346 **** + $this->_active = mysql_result($result,0,"active"); $this->_username = mysql_result($result,0,"username"); $this->_division_id = mysql_result($result,0,"division_id"); $this->_division_desc = mysql_result($result,0,"division_desc"); ! @@ -87,10 +89,10 @@ if(empty($this->_fflteam_id)) { // insert - $sql = "insert into fflteams (fflteam_city, fflteam_name, fflteam_logo, division_id, owner_lname, owner_fname, owner_email, stadium_name, coach_head, coach_off, coach_def, coach_spec, admin, username"; ! + $sql = "insert into fflteams (fflteam_city, fflteam_name, fflteam_logo, division_id, owner_lname, owner_fname, owner_email, stadium_name, coach_head, coach_off, coach_def, coach_spec, admin, active, username"; if (!empty($this->_password)) $sql .= ", password"; - $sql .= ") values ('$this->_fflteam_city', '$this->_fflteam_name', '$this->_fflteam_logo', $this->_division_id, '$this->_owner_lname', '$this->_owner_fname', '$this->_owner_email', '$this->_stadium_name', '$this->_coach_head', '$this->_coach_off', '$this->_coach_def', '$this->_coach_spec', $this->_admin, '$this->_username'"; ! + $sql .= ") values ('$this->_fflteam_city', '$this->_fflteam_name', '$this->_fflteam_logo', $this->_division_id, '$this->_owner_lname', '$this->_owner_fname', '$this->_owner_email', '$this->_stadium_name', '$this->_coach_head', '$this->_coach_off', '$this->_coach_def', '$this->_coach_spec', $this->_admin, $this->_active, '$this->_username'"; if (!empty($this->_password)) $sql .= ", password('$this->_password')"; $sql .= ")"; ! @@ -98,7 +100,7 @@ else { // update - $sql = "update fflteams set fflteam_city='$this->_fflteam_city', fflteam_name='$this->_fflteam_name', fflteam_logo='$this->_fflteam_logo', division_id=$this->_division_id, owner_lname='$this->_owner_lname', owner_fname='$this->_owner_fname', owner_email='$this->_owner_email', stadium_name='$this->_stadium_name', coach_head='$this->_coach_head', coach_off='$this->_coach_off', coach_def='$this->_coach_def', coach_spec='$this->_coach_spec', admin=$this->_admin, username='$this->_username'"; ! + $sql = "update fflteams set fflteam_city='$this->_fflteam_city', fflteam_name='$this->_fflteam_name', fflteam_logo='$this->_fflteam_logo', division_id=$this->_division_id, owner_lname='$this->_owner_lname', owner_fname='$this->_owner_fname', owner_email='$this->_owner_email', stadium_name='$this->_stadium_name', coach_head='$this->_coach_head', coach_off='$this->_coach_off', coach_def='$this->_coach_def', coach_spec='$this->_coach_spec', admin=$this->_admin, active=$this->_active, username='$this->_username'"; if (!empty($this->_password)) $sql .= ", password=password('$this->_password')"; $sql .= " where fflteam_id=$this->_fflteam_id"; ! @@ -224,6 +226,17 @@ return $this->_admin; } --- 320,350 ---- + $this->_active = mysql_result($result,0,"active"); $this->_username = mysql_result($result,0,"username"); + + $this->_timestamper = mysql_result($result,0,"timestamper"); $this->_division_id = mysql_result($result,0,"division_id"); $this->_division_desc = mysql_result($result,0,"division_desc"); ! } ! @@ -87,10 +91,10 @@ if(empty($this->_fflteam_id)) { // insert - $sql = "insert into fflteams (fflteam_city, fflteam_name, fflteam_logo, division_id, owner_lname, owner_fname, owner_email, stadium_name, coach_head, coach_off, coach_def, coach_spec, admin, username"; ! + $sql = "insert into fflteams (fflteam_city, fflteam_name, fflteam_logo, division_id, owner_lname, owner_fname, owner_email, stadium_name, coach_head, coach_off, coach_def, coach_spec, admin, active, username, timestamper"; if (!empty($this->_password)) $sql .= ", password"; - $sql .= ") values ('$this->_fflteam_city', '$this->_fflteam_name', '$this->_fflteam_logo', $this->_division_id, '$this->_owner_lname', '$this->_owner_fname', '$this->_owner_email', '$this->_stadium_name', '$this->_coach_head', '$this->_coach_off', '$this->_coach_def', '$this->_coach_spec', $this->_admin, '$this->_username'"; ! + $sql .= ") values ('$this->_fflteam_city', '$this->_fflteam_name', '$this->_fflteam_logo', $this->_division_id, '$this->_owner_lname', '$this->_owner_fname', '$this->_owner_email', '$this->_stadium_name', '$this->_coach_head', '$this->_coach_off', '$this->_coach_def', '$this->_coach_spec', $this->_admin, $this->_active, '$this->_username', $this->_timestamper"; if (!empty($this->_password)) $sql .= ", password('$this->_password')"; $sql .= ")"; ! @@ -98,7 +102,7 @@ else { // update - $sql = "update fflteams set fflteam_city='$this->_fflteam_city', fflteam_name='$this->_fflteam_name', fflteam_logo='$this->_fflteam_logo', division_id=$this->_division_id, owner_lname='$this->_owner_lname', owner_fname='$this->_owner_fname', owner_email='$this->_owner_email', stadium_name='$this->_stadium_name', coach_head='$this->_coach_head', coach_off='$this->_coach_off', coach_def='$this->_coach_def', coach_spec='$this->_coach_spec', admin=$this->_admin, username='$this->_username'"; ! + $sql = "update fflteams set fflteam_city='$this->_fflteam_city', fflteam_name='$this->_fflteam_name', fflteam_logo='$this->_fflteam_logo', division_id=$this->_division_id, owner_lname='$this->_owner_lname', owner_fname='$this->_owner_fname', owner_email='$this->_owner_email', stadium_name='$this->_stadium_name', coach_head='$this->_coach_head', coach_off='$this->_coach_off', coach_def='$this->_coach_def', coach_spec='$this->_coach_spec', admin=$this->_admin, active=$this->_active, timestamper=$this->_timestamper, username='$this->_username'"; if (!empty($this->_password)) $sql .= ", password=password('$this->_password')"; $sql .= " where fflteam_id=$this->_fflteam_id"; ! @@ -224,6 +228,29 @@ return $this->_admin; } *************** *** 357,364 **** + } + function setUsername($username) { $this->_username = $username; } ! @@ -264,6 +277,22 @@ return $retArr; } --- 361,380 ---- + } + + + function getTimestamper() { + + $timestamper = array(); + + $sql = "select DATE_FORMAT(timestamper, '%W %M %D @ %r') from fflteams where fflteam_id=$this->_fflteam_id"; + + $result = mysql_query($sql,$this->_conn) or die (mysql_error()); + + + + $timestamper = mysql_fetch_row($result); + + + + mysql_free_result($result); + + + + return $timestamper[0]; + + } + + function setUsername($username) { $this->_username = $username; } ! @@ -264,6 +291,22 @@ return $retArr; } *************** *** 383,387 **** { $retArr = array(); ! @@ -280,6 +309,27 @@ return $retArr; --- 399,403 ---- { $retArr = array(); ! @@ -280,6 +323,27 @@ return $retArr; *************** *** 597,601 **** diff -ur ffl-0.7.2/php/teams.php ffl-0.7.3/php/teams.php --- ffl-0.7.2/php/teams.php Sat Sep 14 00:28:13 2002 ! +++ ffl-0.7.3/php/teams.php Sat Jul 24 13:20:11 2004 @@ -4,9 +4,9 @@ <? --- 613,617 ---- diff -ur ffl-0.7.2/php/teams.php ffl-0.7.3/php/teams.php --- ffl-0.7.2/php/teams.php Sat Sep 14 00:28:13 2002 ! +++ ffl-0.7.3/php/teams.php Thu Aug 5 19:07:02 2004 @@ -4,9 +4,9 @@ <? *************** *** 682,686 **** <th align="left">Pos</th> <th align="left" width="90%">Name</th> ! @@ -229,7 +232,171 @@ <? } --- 698,702 ---- <th align="left">Pos</th> <th align="left" width="90%">Name</th> ! @@ -229,7 +232,180 @@ <? } *************** *** 816,819 **** --- 832,837 ---- + // successful, it brings the owner back to the lineup + // display/edit page. + + if(empty($fflteam_id) || (!session_is_registered("admin"))) + + $fflteam_id=$myteam->getFFLTeamID(); + + $thisTeam = new FFLTeam($fflteam_id); *************** *** 831,837 **** + + $this->_fflteam_id = $fflteam_id; ! + + $result = mysql_query($sql) or die (mysql_error()); + } + ?> + <div class="success">Starting lineup successfully saved.</div><p> --- 849,862 ---- + + $this->_fflteam_id = $fflteam_id; ! + + $result = mysql_query($sql) or die (mysql_error()); + + + + + } + + + + $sql2 = "UPDATE fflteams SET timestamper=NULL WHERE fflteam_id=$fflteam_id"; + + + + $result2 = mysql_query($sql2) or die (mysql_error()); + + + ?> + <div class="success">Starting lineup successfully saved.</div><p> *************** *** 855,859 **** // Present page of add/edit option // Edit has drop-down of options ! @@ -257,7 +424,9 @@ for($i=0; $i<sizeof($teams); $i++) { --- 880,884 ---- // Present page of add/edit option // Edit has drop-down of options ! @@ -257,7 +433,9 @@ for($i=0; $i<sizeof($teams); $i++) { *************** *** 866,870 **** } ?> ! @@ -291,7 +460,9 @@ } --- 891,895 ---- } ?> ! @@ -291,7 +469,9 @@ } *************** *** 876,880 **** <input type="hidden" name="fflteam_id" value="<? echo $thisTeam->getFFLTeamID() ?>"> <input type="hidden" name="mode" value="<? echo $mode ?>"> ! @@ -388,19 +559,20 @@ <tr valign="top"> <th align="right">Admin:</th> --- 901,905 ---- <input type="hidden" name="fflteam_id" value="<? echo $thisTeam->getFFLTeamID() ?>"> <input type="hidden" name="mode" value="<? echo $mode ?>"> ! @@ -388,19 +568,20 @@ <tr valign="top"> <th align="right">Admin:</th> *************** *** 2528,2532 **** diff -ur ffl-0.7.2/sql/tables/fflteams.sql ffl-0.7.3/sql/tables/fflteams.sql --- ffl-0.7.2/sql/tables/fflteams.sql Wed Jul 24 11:09:56 2002 ! +++ ffl-0.7.3/sql/tables/fflteams.sql Fri Jul 30 14:02:21 2004 @@ -1,7 +1,7 @@ -- $RCSfile$ --- 2553,2557 ---- diff -ur ffl-0.7.2/sql/tables/fflteams.sql ffl-0.7.3/sql/tables/fflteams.sql --- ffl-0.7.2/sql/tables/fflteams.sql Wed Jul 24 11:09:56 2002 ! +++ ffl-0.7.3/sql/tables/fflteams.sql Thu Aug 5 19:05:53 2004 @@ -1,7 +1,7 @@ -- $RCSfile$ *************** *** 2545,2549 **** admin bit, + active bit, ! + timestamp timestamp, primary key (fflteam_id) ); --- 2570,2574 ---- admin bit, + active bit, ! + timestamper timestamp (14), primary key (fflteam_id) ); |