Google

NukeCoder


View next topic
View previous topic
Post new topic   Reply to topic
Author Message
digatle




Joined: Feb 07, 2006
Posts: 13

PostPosted: Tue Mar 28, 2006 10:34 am
Reply with quote

I'm in need of assistance with a join? or left join? problem I'm having. I put the ? marks there cause I don't exactly know if that's what I'm needing.

What I have is something like this.

When I click on the "standings" of this League software that I have it puts me in the "Main Hall". That I want to have all the time.

But within each of the leagues there are "seasons" which players play in.

Here's how the code's layed out.

/* mainhall display */

Code:
function mainhall_display_division_table($did, $name, $sid, $lid, $disp=1) {
   global $bgcolor1, $bgcolor2;

   $prefs = getLeaguePrefs($lid);

   if ($rowcolor != "")
      $color="bgcolor=\"$prefs[rowcolor]\"";
   else
      $color="";

   $standings = new Standings($lid);
   $max = $standings->size();
   $str = "<table width=\"100%\" cellpadding=\"1\" cellspacing=\"0\" border=\"0\" bgcolor=\"$bgcolor1\">";
   $str .= "<tr bgcolor=\"$bgcolor2\"><td colspan=\"" . ($max + 3) . "\"><font class=\"option\"><center>$name - Works<br></font>";
   if (isAdminLeague($lid, ADD_TEAM) and $disp) {
      $str .= " [ <a href=\"modules.php?name=League&amp;file=admin&amp;op=add_team&amp;did=$did&amp;lid=$lid&amp;sid=$sid\">" . _ADDTEAM . "</a> | <a href=\"modules.php?name=League&amp;file=admin&amp;op=recreate_standings_ok&amp;sid=$sid&amp;lid=$lid\">" . _RECREATESTANDING . "</a> | <a href=\"modules.php?name=League&amp;file=admin&amp;op=recalc_standings&amp;sid=$sid&amp;lid=$lid\">" . _RECALCSTANDING . "</a>] ";

      $plugin = new Plugins($lid);
      echo $plugin->getLinks(PLUGIN_STANDINGS_DIVISION);
   }
   $str .= "</center></td></tr>";

   $str .= "<tr><td bgcolor=\"1c0032\"</td><td bgcolor=\"1c0032\" align=\"left\" width=\"36%\"><b>" . _TEAMNAME . "</b></td>";

   $standings = new Standings($lid);
   $maxcol = $standings->size();
   while (($lheader = $standings->headings())) {
      $str .= "<td bgcolor=\"1c0032\" align=\"center\"><b>$lheader</b></td>";
   }
   if ($disp)
      $str .= "<td bgcolor=\"1c0032\"> </td>";
   $str .= "</tr>";

   $p=1;
   $standings->select($did, $sid);
   while ($standings->fetchRow()) {
      $tid = $standings->tid();
      if ($bgcolor=="")
         $bgcolor="$color";
      else
         $bgcolor="";

      $str .= "<tr $bgcolor>"
         . "<td align=\"right\" width=\"3%\">$p.</td>"
         . "<td align=\"left\" nowrap width=\"36%\">";
      $str .= getTeamNamewithURL($tid, "modules.php?name=League&amp;file=index&amp;op=team&amp;tid=$tid&amp;sid=$sid&amp;lid=$lid&amp;did=$did") . "</td>";
      for ($i=0; $i < $standings->size(); $i++) {
         $pos = $standings->position($i);
         $value = $standings->fetchRowValue();
         if ($pos != "")
            $value=$pos;
         $str .= "<td nowrap align=\"center\" nowrap>$value</td>";
      }
      if (isAdminLeague($lid, REMOVE_TEAM) and $disp) {
         $str .= "<td><center><a href=\"modules.php?name=League&amp;file=admin&amp;op=del_team&amp;tid=$tid&amp;lid=$lid&amp;did=$did&amp;sid=$sid\" title=\"" . _REMOVE . "\"><img src=\"modules/League/images/remove.gif\" border=\"0\" width=\"11\" height=\"11\"></a></center></td>";
      }
      $str .= "</tr>";
      $p++;
   }


   $str .= "<br></table><br>";

   return $str;
}


/* broken down into divisions */

Code:
function display_division_table($did, $name, $sid, $lid, $disp=1) {
   global $bgcolor1, $bgcolor2;

   $prefs = getLeaguePrefs($lid);

   if ($rowcolor != "")
      $color="bgcolor=\"$prefs[rowcolor]\"";
   else
      $color="";

   $standings = new Standings($lid);
   $max = $standings->size();
   $str = "<table width=\"100%\" cellpadding=\"1\" cellspacing=\"0\" border=\"0\" bgcolor=\"$bgcolor1\">";
   $str .= "<tr bgcolor=\"$bgcolor2\"><td colspan=\"" . ($max + 3) . "\"><font class=\"option\"><center>$name<br></font>";
   if (isAdminLeague($lid, ADD_TEAM) and $disp) {
      $str .= " [ <a href=\"modules.php?name=League&amp;file=admin&amp;op=add_team&amp;did=$did&amp;lid=$lid&amp;sid=$sid\">" . _ADDTEAM . "</a> | <a href=\"modules.php?name=League&amp;file=admin&amp;op=recreate_standings_ok&amp;sid=$sid&amp;lid=$lid\">" . _RECREATESTANDING . "</a> | <a href=\"modules.php?name=League&amp;file=admin&amp;op=recalc_standings&amp;sid=$sid&amp;lid=$lid\">" . _RECALCSTANDING . "</a>] ";
                                                         
      $plugin = new Plugins($lid);
      echo $plugin->getLinks(PLUGIN_STANDINGS_DIVISION);
   }
   $str .= "</center></td></tr>";

   $str .= "<tr><td bgcolor=\"1c0032\"</td><td bgcolor=\"1c0032\" align=\"left\" width=\"36%\"><b>" . _TEAMNAME . "</b></td>";

   $standings = new Standings($lid);
   $maxcol = $standings->size();
   while (($lheader = $standings->headings())) {
      $str .= "<td bgcolor=\"1c0032\" align=\"center\"><b>$lheader</b></td>";
   }
   if ($disp)
      $str .= "<td bgcolor=\"1c0032\"> </td>";
   $str .= "</tr>";

   $p=1;
   $standings->select($did, $sid);
   while ($standings->fetchRow()) {
      $tid = $standings->tid();
      if ($bgcolor=="")
         $bgcolor="$color";
      else
         $bgcolor="";

      $str .= "<tr $bgcolor>"
         . "<td align=\"right\" width=\"3%\">$p.</td>"
         . "<td align=\"left\" nowrap width=\"36%\">";
      $str .= getTeamNamewithURL($tid, "modules.php?name=League&amp;file=index&amp;op=team&amp;tid=$tid&amp;sid=$sid&amp;lid=$lid&amp;did=$did") . "</td>";
      for ($i=0; $i < $standings->size(); $i++) {
         $pos = $standings->position($i);
         $value = $standings->fetchRowValue();
         if ($pos != "")
            $value=$pos;
         $str .= "<td nowrap align=\"center\" nowrap>$value</td>";
      }
      if (isAdminLeague($lid, REMOVE_TEAM) and $disp) {
         $str .= "<td><center><a href=\"modules.php?name=League&amp;file=admin&amp;op=del_team&amp;tid=$tid&amp;lid=$lid&amp;did=$did&amp;sid=$sid\" title=\"" . _REMOVE . "\"><img src=\"modules/League/images/remove.gif\" border=\"0\" width=\"11\" height=\"11\"></a></center></td>";
      }
      $str .= "</tr>";
      $p++;
   }


   $str .= "<br></table><br>";

   return $str;
}


What I want to have happen is this and I want to start "small". So I'd rather start with a simple PHP page to start off with.

Everyone has a team.

[league_teams]
id name shortname img address1 address2 address3 address4 phone1 phone2 web email created owner defplid uid linkme

The UID matches that of phpNuke_users.

[league_players]
id name name2 uid img address1 address2 address3 address4 phone1 phone2 email dob misc1 misc2 misc3 bio disp

Again the UID matches that of the phpNuke_users.

[league_schedule]
id sid did tid1 tid2 score1 score2 whenisit plid matchreport1 matchreport2

The biggest thing with this table here is two things. One is the tid1 and the other is tid2 followed by the score. Obviously someone "won" the game.

So I guess my first hurdle would be how do I figure out "which team (tid#) won the match? Then, based on tid# and their ID, which team was it? If I had that info, how would I put it in the main hall as that team winning or losing their match? I'm not interested in "how" they won cause that's handled under each season which if they click on their team they can do.

Am I over complicating this process? Reading what I need it sounds so dumb simple.
 
View user's profile Send private message
digatle




Joined: Feb 07, 2006
Posts: 13

PostPosted: Mon Apr 10, 2006 1:28 pm
Reply with quote

I made a dummy account so you could see what it was that I'm talking about.

You can see it here:

http://www.shadowsofsanctuary.com/html

UserID: dummy
Password: dummy

After you log in over on the left hand side click on the [M] and then go to SPT Standings. A great example is #40 ReVenGeSka. If you click on him you'd see he's been involved in 3 seasons. I'm wanting "Main Hall" to actually read Wins = 1 and Lost = 2 and Win% = 33.34%. These same numbers would reflect on the previous screen as well.

I am considering taking bids to do this one join statement if I cannot get any help.
 
View user's profile Send private message
Display posts from previous:       
Post new topic   Reply to topic

View next topic
View previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum


Powered by phpBB © 2001-2007 phpBB Group
All times are GMT - 5 Hours
Forums ©