Jump to content

3-column layout - been bugging me for days


m4x3vo

Recommended Posts

<?php 
/* Lookup (lalala.php) */
include('common.php');
$user = htmlentities($_GET['user']);
echo "<html><STYLE type='text/css'>/* CSS Document */

body {
background:#A6937C;
text-align:center;
margin:20px;
padding:0;
font:normal 0.8em/1.2em verdana,aria,sans-serif;
color:#666;
}
a {
color:#FFF;
text-decoration:none;
border-bottom:1px dotted;
}
a:hover {
border-bottom:1px solid;
color:#FCFBDC;
}
#wrapper {
text-align: left;
margin: 0px auto;
padding: 0px;
border:0;
width: 2000px;
background:#FFF repeat-y top right;
}


#side-a {
float: left;
width: 150px;
}

#side-b {
float: right;
width: 150px;
}

#content1 { 
float: left;
width: 56%;
}



</style> </html>";

echo "<div id='wrapper'>";
echo "<font size='5'>Lookup: ".$user."<br></font><font size='2'><i>~Produced by <a href='http://lalalallaal.me'>lalalalalalla.Me</i></a></font><hr>";




echo "<div id='content1'><table border='1' bgcolor='white' BORDERCOLOR='BLACK' width='100' cellspacing='1' cellpadding='1'><TH COLSPAN='7'><font size'4'><center>Achievements Owned</center></font></th><tr><td><html><font size='2'><b><u>Image</b></u></font></html></td><td><html><font size='2'><b><u>Method</b></u></font></html></td><td><html><font size='2'><b><u>Points</b></u></font></html></td><td><html><font size='2'><b><u>Category</b></u></font></html></td><td><html><font size='2'><b><u>Status</b></u></font></html></td><td><html><font size='2'><b><u>Rank</b></u></font></html></td><td><html><font size='2'><b><u>More Info.</b></u></font></html></td></tr>";









$cookie = $_COOKIE["uid"];
$query2 = "SELECT * FROM users WHERE username = '".$user."'";
$queryu = mysql_query($query2) or die(mysql_error());
$res2 = mysql_fetch_assoc($queryu);
$res3 = $res2['user_id'];
$query = "SELECT * FROM user_ach a LEFT OUTER JOIN ach b ON a.ach_id = b.id LEFT OUTER JOIN cat_order c ON b.cat = c.cat_name LEFT OUTER JOIN ach_order d ON d.aid = b.id WHERE user_id = $res3 ORDER BY cat_num, aorder";
$result1 = mysql_query($query) or die(mysql_error());
while ($res = mysql_fetch_assoc($result1))
{


$result = mysql_query("SELECT * FROM user_ach WHERE ach_id = $res[id]");
$num_rows = mysql_num_rows($result);
$rank = $res['rank'];
echo "<tr><td><img src='$res[image]'></img><br>$res[name]</td><td>$res[method]</td><td>$res[points]</td><td>$res[cat]</td><td>$res[status]</td><td>$rank</td><td><html><b><u><center><font size='3' color='red'>$num_rows</font></u></b><br>people own this achievement.</center></html></td></tr>";

$var += $res[points];
}
echo "</div>";



echo "<table border='1' bgcolor='white' BORDERCOLOR='BLACK' width='450' cellspacing='1' cellpadding='1'><TH COLSPAN='5'><font size'4'><center>Achievements Needed</center></font></th><tr><td><html><font size='2'><b><u>Image</b></u></font></html></td><td><html><font size='2'><b><u>Method</b></u></font></html></td><td><html><font size='2'><b><u>Points</b></u></font></html></td><td><html><font size='2'><b><u>Category</b></u></font></html></td><td><html><font size='2'><b><u>Status</b></u></font></html></td</tr>";
$query2e = "SELECT * FROM users WHERE username = '".$user."'";
$queryue = mysql_query($query2e) or die(mysql_error());
$res2e = mysql_fetch_assoc($queryue);
$res3e = $res2e['user_id'];

$mysql = "SELECT * FROM ach a LEFT OUTER JOIN user_ach b ON a.id = b.ach_id AND b.user_id = $res3e LEFT OUTER JOIN cat_order c ON a.cat = c.cat_name WHERE b.ach_id IS NULL ORDER BY cat_num";
$mysql2 = mysql_query($mysql) or die(mysql_error());
while ($rese = mysql_fetch_array($mysql2))
{
echo "<div id='side-b'><tr><td><img src='$rese[image]'></img><br>$rese[name]</td><td>$rese[method]</td><td>$rese[points]</td><td>$rese[cat]</td><td>$rese[status]</td></tr>";

$ya += $rese[points];
}
echo "</div>";








$stats = "SELECT * FROM users WHERE username = '".$user."'";
$stats2 = mysql_query($stats) or die(mysql_error());
$stats3 = mysql_fetch_assoc($stats2);
echo "<div id='side-a'><b>Total Points:</b> $var<br><b>Level:</b> $stats3[level]<br><b>Unique Quests:</b> $stats3[abcdef]<br><b>Repeatable Quests:</b> $stats3[repeatable]<br><b>Daily Quests:</b> $stats3[daily]<br><b>Switch Games Won:</b> $stats3[switch]<br><b>Duck Usage:</b> $stats3[duck]<br><b>Newbies Buffed:</b> $stats3[newbies]</div>";


echo "</div></div>";


?>

 

Please try and work through my messy code.  Yes I know there are tons of <html> tags but it was the only way the html was working. 

 

Anyways my three column layout is not working, instead each column goes vertical kind of underneath the other.  The content column loads to the left, the side-a column loads underneath the content column positioned to the left, and then the side-b loads to the right of side-a but under the content column.  Please help me.

Link to comment
Share on other sites

Hey,

 

Just glancing at the code, it looks as if you gave 2 layout elements a set pixel width, and 1 a percent width. Why? This is much harder to maintain, and harder to troubleshoot. Try giving content1 a pixel width instead.

#side-a {
   float: left;
   width: 150px;
}

#side-b {
   float: right;
   width: 150px;
}

#content1 { 
   float: left;
   width: 56%;
}

 

Best,

-T

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.