View Full Version : NintendoNew's Rare Values Panel HELP! *coders*
VPSwow
15-08-2007, 03:41 PM
Hello can anyone make me the template base to view the rares into a table intead of a strait line?
Thanks Karl
Jackboy
16-08-2007, 07:32 AM
$n = 1;
echo ("<table><tr>
while (FETCHRARESQUERY){
if ($n == '4' | $n == '8' | $n == '12'){
echo ("<tr></tr>
}
echo ("<td>RARE</td>");
But that will display up to 12 rares :P u wanna change it.. u get the idea.. Soz if theres any errors. Aint checked it out
VPSwow
16-08-2007, 10:05 AM
Thanks il test it :)
Splinter
16-08-2007, 02:58 PM
Jacks code is wrong. Try this:
$n = 1;
echo "<table><tr>";
while (FETCHRARESQUERY){
$n = $n++;
if ($n == '4'){
echo "<tr></tr>";
$n = 1;
}
echo "<td>RARE</td>";
)
VPSwow
16-08-2007, 05:01 PM
Do i put that in the functions.ici.php?
Jackboy
17-08-2007, 09:36 AM
no u put it on the page its displaying the values.. Im soz, mine was very wrong, i rushed it lol.. +rep for correcting me ;P
VPSwow
17-08-2007, 10:46 AM
+rep to both i will try it soon.
Eccentric
17-08-2007, 06:31 PM
Jacks code is wrong. Try this:
$n = 1;
echo "<table><tr>";
while (FETCHRARESQUERY){
$n = $n++;
if ($n == '4'){
echo "<tr></tr>";
$n = 1;
}
echo "<td>RARE</td>";
)
But why would you need <tr><tr> both following each other tbh.
Jackboy
17-08-2007, 08:01 PM
Your right. It should be </tr></tr> as to make a new line
VPSwow
17-08-2007, 08:48 PM
hmm not working heres demos.
www.habmate.com/uk/test.php
www.habmate.com/uk/test1.php
www.habamte.com/uk/test2.php
www.habmate.com/uk/test3.php
Jackboy
19-08-2007, 09:37 AM
Try this:
$n = 1;
echo "<table><tr>";
while (FETCHRARESQUERY){
if ($n == '4'){
echo "</tr><tr>";
}
echo "<td>RARE</td>";
$n++;
)
Johno
19-08-2007, 09:48 AM
What program? Yes you can sort them, view the showrares.php source and edit the type.
Hey, I looked in one of the older threads about it and Luckyrare said that.
Have a look in there and see if anything is in there.
.:; Johno
VPSwow
19-08-2007, 10:11 AM
<?php
displayRares("rare", "150");
?>
That is display code. If anyone can fix please help.
Verrou
19-08-2007, 10:41 AM
http://habbocouncil.co.uk/rares/
They managed to do it :S Send them an email.
Also how do you get the value to appear under the image?
VPSwow
19-08-2007, 10:46 AM
http://habbocouncil.co.uk/rares/
They managed to do it :S Send them an email.
Also how do you get the value to appear under the image?
Do they use same system?
Johno
19-08-2007, 01:09 PM
As far as I am aware, they do.
It was posted some time ago on how to do it but I cant find it.
.:; Johno
VPSwow
19-08-2007, 01:19 PM
Well iv emailed them but not sure i will get reply.
If you find out how please post here :)
Luckyrare
19-08-2007, 01:29 PM
I have done it before using DIVS / CSS
just put the rare image into a div with a id tag
for that you have
width: 20%;
float: left;
that would put 5 in a row.
If you post the file that has the function and the display file then I will code it.
Johno
19-08-2007, 01:34 PM
Yeah, I was just about to post this : http://www.habboxforum.com/showthread.php?t=382218&highlight=Project+Rare+Values (http://www.habboxforum.com/showthread.php?t=382218&highlight=Project+Rare+Values)
It was about it but Lucyrare didnt post the code so at least his previous post has explained it and that he is gonna help :)
.:; Johno
Luckyrare
19-08-2007, 01:44 PM
Can someone post the code to functions.inc.php so I can help you x]
VPSwow
19-08-2007, 03:31 PM
function displayRares($type, $limit) {
$raresQuery = mysql_query("SELECT * FROM `rares` WHERE type='$type' LIMIT $limit");
echo "<table border='0'>";
while ($rows = mysql_fetch_array($raresQuery)) {
echo "<tr>";
echo "<td>";
if (!empty($rows['url'])) { echo("<img src=\"" . $rows['url'] . "\" alt=\"" . $rows['name'] . "\" />"); }
echo "</td><td>";
if (!empty($rows['name'])) { echo($rows['name']); }
echo "</td>";
if (!empty($rows['t'])) { echo("<td>" . $rows['t'] . "T</td>"); }
if (!empty($rows['hc'])) { echo("<td>" . $rows['hc'] . "HC</td>"); }
if (!empty($rows['rd'])) { echo("<td>" . $rows['rd'] . "RD</td>"); }
echo "</tr>";
}
echo '</table>';
}
?>
Luckyrare
19-08-2007, 03:53 PM
Try something like this
function displayRares($type, $limit) {
$raresQuery = mysql_query("SELECT * FROM `rares` WHERE type='$type' LIMIT $limit");
while ($rows = mysql_fetch_array($raresQuery)) {
print("<div class=\"rare\">");
if (!empty($rows['url'])) {
echo("<img src=\"" . $rows['url'] . "\" alt=\"" . $rows['name'] . "\" /><br />");
}
if (!empty($rows['name'])) {
echo($rows['name']);
}
if (!empty($rows['t'])) {
echo($rows['t'] . "T "); }
if (!empty($rows['hc'])) {
echo($rows['hc'] . "HC ");
}
if (!empty($rows['rd'])) {
echo($rows['rd'] . "RD ");
}
print("</div>");
}
}
?>
<?php
require("functions.inc.php");
?>
<!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>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Rare Values</title>
<style type="text/css">
.rare {
width: 20%;
float: left;
text-align: center;
}
</style>
</head>
<body>
<?php
displayRares("rare", "150");
?>
</body>
</html>
If you want to change how many per row then you need to change the CSS.
eg. 10% would be 10 per row, 20% would be 5 per row
Enjoy - I havent tested yet so I may of done a silly error.
VPSwow
19-08-2007, 04:06 PM
http://habmate.com/uk/test4.php
Woo :) It has worked.
Thanks a lot +REP
Luckyrare
19-08-2007, 04:20 PM
No problem, thanks for the rep
Verrou
21-08-2007, 07:06 AM
Thanks Lucky! +rep. How do i get the prices on a line down from the name?
eg. come out like: Holiday Romance2HC 120credits
i want it like:
Holiday Romance
2 HC
120 credits
(centered and with spaces)
VPSwow
21-08-2007, 08:18 AM
Thanks Lucky! +rep. How do i get the prices on a line down from the name?
eg. come out like: Holiday Romance2HC 120credits
i want it like:
Holiday Romance
2 HC
120 credits
(centered and with spaces)
This would be helpfull for me aswell.
Luckyrare
21-08-2007, 06:42 PM
You would need to add a <br />
function displayRares($type, $limit) {
$raresQuery = mysql_query("SELECT * FROM `rares` WHERE type='$type' LIMIT $limit");
while ($rows = mysql_fetch_array($raresQuery)) {
print("<div class=\"rare\">");
if (!empty($rows['url'])) {
echo("<img src=\"" . $rows['url'] . "\" alt=\"" . $rows['name'] . "\" /><br />");
}
if (!empty($rows['name'])) {
echo($rows['name']."<br />");
}
if (!empty($rows['t'])) {
echo($rows['t'] . "T "); }
if (!empty($rows['hc'])) {
echo($rows['hc'] . "HC ");
}
if (!empty($rows['rd'])) {
echo($rows['rd'] . "RD ");
}
print("</div>");
}
}
?>
Verrou
22-08-2007, 05:01 AM
Yay, thanks! +REP
http://andrehamon.evenhosting.com/rare_values/test2.php
Want to hide these adverts? Register an account for free!
Powered by vBulletin® Version 4.2.5 Copyright © 2025 vBulletin Solutions Inc. All rights reserved.