PDA

View Full Version : Clan Roster


SmEdD
07-14-2003, 11:23 PM
Ok I am building a roser page for my clan. All the data is imputed just like user are but it can only be done in the admin panel.

Now I am working on the public side where it shows the roster to the public.

I can only get one name to come up. How do I get them all to list. And my template is set up with a bits part so it isn't that.

This is the php code that is where the data gets called. Is it anything here or with the template?

if ($_REQUEST['do'] == 'getall')
{
$clanrosters = $DB_site->query("
SELECT *
FROM " . TABLE_PREFIX . "clanroster
ORDER BY displayorder");
while ($clanroster = $DB_site->fetch_array($clanrosters))
{
eval('$rosterbits = "' . fetch_template('rosterbits') . '";');
}
}

Lesane
07-15-2003, 05:44 AM
You do know that it's vb3 code right? I don't know if we are allowed to give support on it, anyways:

Change:


eval('$rosterbits = "' . fetch_template('rosterbits') . '";');


Into:


eval('$rosterbits .= "' . fetch_template('rosterbits') . '";');

SmEdD
07-15-2003, 03:32 PM
What does the period do that you added?

Lesane
07-15-2003, 04:04 PM
It adds the output to $rosterbits and don't overwrite the current value of $rosterbits. If you leave the period out of it then $rosterbits will only contains one output. It does the while loop and adds a value to $rosterbits till it's done but it overwrites it without the period.

Same like:


$hello ="hello,";
$hello .="how are you?";
echo "$hello"; // will print hello, how are you?


But, without the period


$hello ="hello,";
$hello ="how are you?";
echo "$hello"; // will print how are you?