Im building a leauge system in PHP. It started out as a 1vs1 system and got that working as i wanted. Now im expanding it to handle team setups (2v2 and 3v3), so i need some pointers as how to handle what i want to do.
When a match has been registred with the results, map played, civ used for each player etc i want to display this info in my round/brackets list. For 1vs1 my current setup is good enough, but when the system is setup for teams it will be alot more info to display so i figured it would look better if this info gets displayed in another "window"/box when the user mouse cursor goes over the match line. Ive figured that i prolly need to use (and learn) javascript for this, with onmouseover and onmouseout functions. What i want to do is something simular to this site: http://bf2s.com/player/43766267/ when your mouse cursor goes over the awards pictures on the bottom of the page.
You can find my league system on http://crowsnest.kicks-ass.net/test (its on my home connection, so its not that fast). Click the Brackets/Rounds to see the area i want to improve.
So do anyone have some good reading material and tips (what functions etc) on how to achieve this ?
This is the php script part i want to expand.
$type=mysql_fetch_row(mysql_query("SELECT type FROM NHAP_setup WHERE id=1",$link));
if ($type[0]!="1 vs 1")
// team setup
$query=sprintf("SELECT round,team1 player1,team2 player2,civp1,civp2,map,winner,recgame,regby FROM NHAP_rounds
WHERE round=%d ORDER BY round,pair,team1",mysql_real_escape_string($_GET['round']));
else
// single player setup
$query=sprintf("SELECT round,player1,player2,civp1,civp2,map,winner,recgame,regby FROM NHAP_rounds
WHERE round=%d ORDER BY round,pair,player1",mysql_real_escape_string($_GET['round']));
$result=mysql_query($query,$link);
$i=1;
while ($row=mysql_fetch_assoc($result))
{
// unplayed matches
if ($row['winner']==NULL)
{
if (!($i&1)) // check for even or odd numbers
echo "<tr class=\"altbg2\">\n";
else
echo "<tr class=\"altbg1\">\n";
echo "<td colspan=\"".$r."\">".$row['player1']." <b>vs</b> ".$row['player2']."</td>\n</tr>\n";
}
// played matches, results exists
else
{
if (!($i&1))
// check for even or odd numbers, for different bg-colors
echo "<tr class=\"altbg2\">\n";
else
echo "<tr class=\"altbg1\">\n";
echo "<td colspan=\"".$r."\"><b>".$row['player1'];
// build up the text for a finished match
if ($row['winner']==$row['player1'])
{
echo " (W)";
}
echo " (".$row['civp1'].") vs ".$row['player2'];
if ($row['winner']==$row['player2'])
{
echo " (W)";
}
echo " (".$row['civp2'].") (Map: ".$row['map'].") ";
if ($row['regby']=='admin')
{
echo " <i>*Admin loss*</i>";
}
else
{ if (stripos($row['recgame'],".age3rec")!=NULL)
echo "<a href=\"upload/".$row['recgame']."\">(rec game)</a>";
}
// finished match text finished
echo "</b></td>\n</tr>\n";
}
$i++;
}