Page 1 of 1

Problems with my RANK PAGE

Posted: Wed Aug 24, 2011 12:49 pm
by Gunner
Hey guys, great to be the first who posted on the RTS Sub-Forum :)

I want to ask something, which is about rank page....
I already found the code, and I make it not copy it from another tutorial,... I only learn from halls tutorials, thanks halls! :)

1. How to format the colour of anchor link inside the table?
This is my statistic.php

Code: Select all

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<link rel="icon" type="image/vnd.microsoft.icon" href="images/favicon.ico">	
<link rel="stylesheet" href="gpack/inside.css" type="text/css" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Xevant - Browser Game</title>
<script language="javascript">
function toggle2() {
var ele = document.getElementById("toggleText");
var text = document.getElementById("displayText");
if(ele.style.display == "block") {
ele.style.display = "none";
text.innerHTML = "<b><u>SHOW</u></b>";
}
else {
ele.style.display = "block";
text.innerHTML = "<b><u>HIDE</u></b>";
}
}
</script>
</head>

<body>
<?php
include_once "connect.php";
session_start();
?>
<?php
if (isset($_SESSION['player']))
{
  $player=$_SESSION['player'];
}
else
{
  header('Location: login.php');
  exit;
}
?>
<table width="1026" border="0">
  <tr>
    <td width="180"> </td>
    <td width="528"><div align="center">
      <?php include_once "TopBar.php"; ?>
    </div></td>
    <td width="304"> </td>
  </tr>
  <tr>
    <td> </td>
    <td><div align="center"><?php include_once "resource.php"; ?></div> </td>
    <td> </td>
  </tr>
</table>

<table width="1028" height="592" border="0">
  <tr>
    <td width="216" height="588"><table width="216" height="486" border="0">
      <tr>
        <td width="210" height="126"><table width="210" border="0">
            <tr>
              <td width="204" height="118"><?php include_once "sidebar_inside.php"; ?></td>
            </tr>
        </table></td>
      </tr>
      <tr>
        <td height="212">          <div><strong>
            <?php include_once "plus_sidebar.php" ?>
          </strong></div></td>
      </tr>
      <tr>
        <td height="117"><?php include "village.php" ?></td>
      </tr>
      <tr>
        <td height="21"> </td>
      </tr>
    </table></td>
    <td style="border-left: 2px dotted white; padding: 5px;" width="580" bgcolor="#996600">
<table class="gridtable">
<tr>
	<th width="98">UID</th>
	<th width="141">Name</th>
    <th width="141">Alliance</th>
    <th width="141">Population</th>
    <th width="141">Tribes</th>
    <th width="141">Profession</th>
  </tr>
  <?php
  
  include_once "player_status.php";
$rankinfo="SELECT * from players";
$rankinfo2=mysql_query($rankinfo) or die("could not select anything from the store.");
while($rankinfo3=mysql_fetch_array($rankinfo2))
      {
	  $id = $rankinfo3['id'];
      print "<tr class='tableLink'>
	<td width='231'><div align='center'>$rankinfo3[id]</div></td>
    <td width='157'><div align='center'><a href='profile.php?id=$id'>$rankinfo3[name]<a></div></td>
    <td width='157'><div align='center'>$rankinfo3[ally]</div></td>
    <td width='157'><div align='center'>$rankinfo3[population]</div></td>
    <td width='157'><div align='center'>$rankinfo3[tribes]</div></td>
	<td width='157'><div align='center'>$rankinfo3[class]</div></td>
	</tr>";

      }
?>

  
</table>
</td>
    <td style="border-left: 2px dotted white; padding: 5px;" width="218"><table width="202" border="0">
      <tr>
        <td width="196" height="30"><?php include_once "rightbar_inside.php"; ?></td>
        </tr>
        <tr>
          <td height="137"> </td>
      </tr>
    </table></td>
  </tr>
</table>
<hr noshade="noshade" color="#FFFFFF" />
<p><?php include_once "footer.php" ?></p>
</body>
</html>
What's wrong?
This is my inside.css

Code: Select all

@charset "utf-8";
/* CSS Document */
table.gridtable {
	font-family: "Times New Roman";
	font-size:16px;
	color:#333333;
	border-width: 1px;
	border-color: #666666;
	border-collapse: collapse;
}
table.gridtable th {
	border-width: 1px;
	padding: 8px;
	border-style: solid;
	border-color: #666666;
	background-color: #dedede;
}
table.gridtable td {
	border-width: 1px;
	border-style: solid;
	border-color: #666666;
	background-color: #ffffff;
	border-collapse: collapse;
}
table.normal {
	font-family: verdana,arial,sans-serif;
	font-size:11px;
	color:#333333;
	border-width: 0px;
	border-color: #666666;
	border-collapse: collapse;
}
table.normal td {
	border-width: 0px;
	border-style: solid;
	border-color: #666666;
	background-color: #ffffff;
	border-collapse: collapse;
}
#table
{
border: 2px dotted white; padding: 5px;
}
input.btn { 
color:#050; 
font: bold 84% 'trebuchet ms',helvetica,sans-serif; 
background-color:#fed; 
border: 1px solid; 
border-color: #696 #363 #363 #696; 
filter:progid:DXImageTransform.Microsoft.Gradient 
(GradientType=0,StartColorStr='#ffffffff',EndColorStr='#ffeeddaa'); 
} 
input.btnhov { 
border-color: #c63 #930 #930 #c63; 
body {background-color:#996633;}
}
p {font-family: "Times New Roman", Times, serif; color:#FFFFFF}
.Sidebar {
	font-family: Verdana, Arial, Helvetica, sans-serif;
	font-weight: bold;
	color:#FFFFFF;
}
a:link {
	text-decoration: none;
	color:#FFFFFF; font-size:19px;
}
a:visited {
	text-decoration: none;
	color:#FFFFFF; font-size:19px;
}
a:hover {
	text-decoration:underline;
	color:#FFFF66; font-size:19px;
}
a:active {
	text-decoration: none;
	color:#FFFFFF; font-size:19px;
}
/*BEGIN THE ANCHOR STYLES*/
a:link.tableLink {
	text-decoration: none;
	color:#FFFFFF; font-size:19px;
}
a:visited.tableLink {
	text-decoration: none;
	color:#FFFFFF; font-size:19px;
}
a:hover.tableLink {
	text-decoration:underline;
	color:#FFFF66; font-size:19px;
}
a:active.tableLink {
	text-decoration: none;
	color:#FFFFFF; font-size:19px;
}
/*END OF THE ANCHOR STYLES*/
#VillageStats {
     color: white; font-size:20px;
}
#Process {
     color:#FFFFFF;
}
#village {
font-size: 22px; font-weight: bold; color:#FFFFFF
}

.othe {
text-decoration: none;
	color:#FFFFFF; font-family:Verdana; font-size: 19px;
}

.Standard {font-family: "Times New Roman", Times, serif; color:#FFFFFF;}
.StandardHitam {font-family: "Times New Roman", Times, serif; color:#000000; font-size: 16px;}
#Standard {font-family: "Times New Roman", Times, serif; color:#FFFFFF;}
.HeadingKecil {font-size: 16px; font-weight: bold; color: #990000; font-family: Georgia, "Times New Roman", Times, serif; color:#FFFFFF}
.HeadingKecilHitam {font-size: 16px; font-weight: bold; color: #990000; font-family: Georgia, "Times New Roman", Times, serif; color:#000000}
#HeadingKecil {font-size: 16px; font-weight: bold; color: #990000; font-family: Georgia, "Times New Roman", Times, serif; color:#FFFFFF}

.SideBarKanan {font-family: "Times New Roman", Times, serif; color: #FFFFFF; color:#FFFFFF }
.style1 {color: #FFFFFF}
The Output of codes above is like this
Image

Myy second question is why the table are dropped until down?
How do I fix it? This problem is always happened to my sidebar, or rightbar.... So I need to strech the table manually using dreamweaver... It's pretty complicated, you know @_@

Last, how to sort the table from the population? Example, the highest population will go to the top on the table, and the second highest go into second rows, and so on and so on...

Please, I need your answers immediately.... And if you're willing to answer, please answer using complete answer, not only with 2 or 3 sentences, etc.

Re: Problems with my RANK PAGE

Posted: Wed Aug 24, 2011 1:10 pm
by Xaleph
I would awnser, but I can`t. I dont even know what you want to know.. What DO you want to know? I mean:

"Myy second question is why the table are dropped until down?"

Please, explain. Maybe we can help.

Re: Problems with my RANK PAGE

Posted: Wed Aug 24, 2011 1:20 pm
by Gunner
you can look at the screen shot, thought
OMG, I'm waiting immediately the next question, this is urgent for me --a

Re: Problems with my RANK PAGE

Posted: Wed Aug 24, 2011 1:37 pm
by Xaleph
Like I said, what do you want?

Re: Problems with my RANK PAGE

Posted: Wed Aug 24, 2011 2:07 pm
by Gunner
how to turn the table to the top AUTOMATICALLY?? O.o

Re: Problems with my RANK PAGE

Posted: Wed Aug 24, 2011 3:53 pm
by RogueTomboy
From what I gather he is wanting to know:

1. Why is the table shoved to the bottom of his page instead of being at the top - so how does he get it to the top.

2. Why do the names in his table not show when he's given each name a color? <---I have two theories on this...it's either what I typed or it's:
1. Why are his names invisible?
2. Why are his anchor links not showing their colors? <--- I'm not sure what an anchor link is tbh.

3. How does he make the table automatically order itself from highest population to lowest population?

There...hopefully that helps?

Re: Problems with my RANK PAGE

Posted: Wed Aug 24, 2011 6:06 pm
by Tim
In your CSS your link colors are #FFFFFF (white), the same as your background. I don't think the link is invisible ... but the fact you can't see white on white ...

Also, to sort by population ...

Code: Select all

$rankinfo="SELECT * FROM players ORDER BY population";

Re: Problems with my RANK PAGE

Posted: Wed Aug 24, 2011 10:27 pm
by Gunner
Thank you for aswering, so how does I fix the problem? Because I already had many white links... Do I need to change each of it manually? O.o

And thank you for your script, finally it works. But it was sorted from the lowest to the highest population. How do I reverse it into the highest first? Thanks

Re: Problems with my RANK PAGE

Posted: Wed Aug 24, 2011 10:46 pm
by Lord Strife
High to Low

Code: Select all

<?php
$sql = "Select * From {table} Order By population DESC";
?>


Low to High

Code: Select all

<?php
$sql = "Select * From {table} Order By population ASC";
?>

Re: Problems with my RANK PAGE

Posted: Wed Aug 24, 2011 10:54 pm
by Lord Strife
also for the table that is dropping down if you have'nt found the fix for that you might try finding the <td> it is sitting in and adding valign="top" which wikll set the vertical align for the current row.

so if you have

Code: Select all

<table height="IAMTALL">
  <tr>
    <td valign="top">I WILL BE PLACED AT THE TOP</td>
    <td valign="middle">I WILL BE PLACED IN THE MIDDLE</td>
    <td valign="bottom">I WILL BE PLACED AT THE BOTTOM</td>
  </tr>
</table>