Snowl Posted March 7, 2010 Share Posted March 7, 2010 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. Link to comment https://www.neowin.net/forum/topic/881316-editing-php-script-to-have-accordian-effect/ Share on other sites More sharing options...
0 kavisiegel Posted March 7, 2010 Share Posted March 7, 2010 I'm pretty sure you would want to use Javascript for this, unless I don't get the question... check in the client side forum Link to comment https://www.neowin.net/forum/topic/881316-editing-php-script-to-have-accordian-effect/#findComment-592319600 Share on other sites More sharing options...
0 Hot Posted March 7, 2010 Share Posted March 7, 2010 The comment above is right, this isn't a server-side question. Have a look here: http://docs.jquery.com/UI/Accordion Link to comment https://www.neowin.net/forum/topic/881316-editing-php-script-to-have-accordian-effect/#findComment-592319616 Share on other sites More sharing options...
0 Andrew Lyle Global Moderator Posted March 8, 2010 Global Moderator Share Posted March 8, 2010 You don't want PHP for that :/ You need to use jQuery... Sophism 1 Share Link to comment https://www.neowin.net/forum/topic/881316-editing-php-script-to-have-accordian-effect/#findComment-592324190 Share on other sites More sharing options...
Question
Snowl
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:
Is it possible to make the categories expand and contract?
Thanks.
Link to comment
https://www.neowin.net/forum/topic/881316-editing-php-script-to-have-accordian-effect/Share on other sites
3 answers to this question
Recommended Posts