• 0

Editing php script to have accordian effect


Question

Well I have something called TwistedRares for a habbo fansite for my little cousin and he wants it to have an accordian effect when looking at the rares (categories)

This is the view code right now:

<?php 
include("config.php");
include("opendb.php");
$get_cats = mysql_query("SELECT * FROM `categories` ORDER BY `displayorder`") or die(mysql_error());
$get_info = mysql_query("SELECT * FROM `systeminfo`") or die(mysql_error());
$info = mysql_fetch_array($get_info);
while($cats = mysql_fetch_array($get_cats)) {
$get_rares = mysql_query("SELECT * FROM `rares` WHERE `catid`='".$cats['id']."'") or die(mysql_error());
echo("<link href=\"../content/style.css\" type=\"text/css\" rel=\"stylesheet\">".$cats['name']."<br>
<table width=\"100%\" border=\"0\">
<tr>
<td width=\"20%\" style=\"text-align:center\"></td>
<td width=\"40%\" style=\"text-align:left\"></td>
<td width=\"10%\" style=\"text-align:center\"></td>
<td width=\"30%\" style=\"text-align:center\"></td>
</tr>
");
$color1 = $info[stripe1]; 
$color2 = $info[stripe2];
$row_count = 0;
while($rare = mysql_fetch_array($get_rares)) {
$row_color = ($row_count % 2) ? $color1 : $color2;
?>
<tr>
<td width="20%" style="text-align:center;background-color:#<?php echo $row_color; ?>"><img alt="" src="<?php echo("".$info[imagepath]."".$rare['image'].""); ?>"></td>
<td width="40%" style="text-align:left;background-color:#<?php echo $row_color; ?>"><?php echo $rare['name']; ?></td>
<td width="10%" style="text-align:center;background-color:#<?php echo $row_color; ?>"><?php echo $rare['value']; ?> HC</td>
<td width="30%" style="text-align:center;background-color:#<?php echo $row_color; ?>"><?php echo $rare['lastedited']; ?></td>
</tr>
<?php 
$row_count++;
}
echo("</table><br>

");
}
?>

Is it possible to make the categories expand and contract?

Thanks.

3 answers to this question

Recommended Posts

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.