Jolten
08-29-2004, 05:28 AM
Hi,
Ive got a php file with embedded html and I'm trying to convert this to work with the vb templates and files.
I'm trying to edit the member.php file and the memberinfo template to include this information.
I've added queries to the member.php file as follows:
$Con01=$DB_site->query("SELECT COUNT(*) as count FROM buster,usrbuster where buster.atoCon=usrcbuster.intCon and usrbuster.chrqualify ='Y' and buster.intCat in(1,2,3) and usrbuster.intplace=1 and usrbuster.strUsrId='$userinfo[username]'");
$num=$Con01['count'];
$Con02=$DB_site->query("SELECT COUNT(*) as count FROM buster,usrbuster where buster.atoCon=usrcbuster.intCon and usrbuster.chrqualify ='Y' and buster.intCat in(1,2,3) and usrbuster.intplace=2 and usrbuster.strUsrId='$userinfo[username]'");
$num2=$Con02['count'];
$Con03=$DB_site->query("select COUNT(*) as count from usrbuster where strusrid = '$userinfo[username]' and intPlace=3 order by intPlace ");
$num3=$Con02['count'];
$Con04=$DB_site->query("SELECT COUNT(*) as count FROM buster,usrbuster where buster.atoCon=usrcbuster.intCon and usrbuster.chrqualify ='Y' and buster.intCat in(1,2,3) and usrbuster.intplace=1 and usrbuster.strUsrId='$userinfo[username]'");
$num4=$Con04['count'];
All these queries work as best as I can tell, yes I know the strUsrId=$userinfo[username] apears like a contradiction, but it isn't.
Here's the code I'd like to get working with the php file and template:
If it's possible to jsut wrap all this code in a container variable that I can call in the template, that would work.
<?for($i =1 ; $i <= $num; $i++){ ?>
<img border="0" src="../bb/images/1st_badge.gif" width="14" height="14" alt="First" />
<?} for($i =1 ; $i <= $num2; $i++){ ?>
<img border="0" src="../bb/images/2nd_badge.gif" width="14" height="14" alt="Second" />
<?} for($i =1 ; $i <= $num3; $i++){ ?>
<img border="0" src="../bb/images/3rd_badge.gif" width="14" height="14" alt="Third" />
<?} for($i =1 ; $i <= $num4; $i++){ ?>
<img border="0" src="../bb/images/cm_badgeA.gif" width="14" height="14" alt="fourth" />
<?}?>
This code works when embedded into a php file but, I can't see to get the for statements to work with some sort of variable I can place in the template. I've tried placint a variable in the for statements and then setting each variable, then calling the variable in the template but that doesn't work.
Any help would be really appreciated.
Ive got a php file with embedded html and I'm trying to convert this to work with the vb templates and files.
I'm trying to edit the member.php file and the memberinfo template to include this information.
I've added queries to the member.php file as follows:
$Con01=$DB_site->query("SELECT COUNT(*) as count FROM buster,usrbuster where buster.atoCon=usrcbuster.intCon and usrbuster.chrqualify ='Y' and buster.intCat in(1,2,3) and usrbuster.intplace=1 and usrbuster.strUsrId='$userinfo[username]'");
$num=$Con01['count'];
$Con02=$DB_site->query("SELECT COUNT(*) as count FROM buster,usrbuster where buster.atoCon=usrcbuster.intCon and usrbuster.chrqualify ='Y' and buster.intCat in(1,2,3) and usrbuster.intplace=2 and usrbuster.strUsrId='$userinfo[username]'");
$num2=$Con02['count'];
$Con03=$DB_site->query("select COUNT(*) as count from usrbuster where strusrid = '$userinfo[username]' and intPlace=3 order by intPlace ");
$num3=$Con02['count'];
$Con04=$DB_site->query("SELECT COUNT(*) as count FROM buster,usrbuster where buster.atoCon=usrcbuster.intCon and usrbuster.chrqualify ='Y' and buster.intCat in(1,2,3) and usrbuster.intplace=1 and usrbuster.strUsrId='$userinfo[username]'");
$num4=$Con04['count'];
All these queries work as best as I can tell, yes I know the strUsrId=$userinfo[username] apears like a contradiction, but it isn't.
Here's the code I'd like to get working with the php file and template:
If it's possible to jsut wrap all this code in a container variable that I can call in the template, that would work.
<?for($i =1 ; $i <= $num; $i++){ ?>
<img border="0" src="../bb/images/1st_badge.gif" width="14" height="14" alt="First" />
<?} for($i =1 ; $i <= $num2; $i++){ ?>
<img border="0" src="../bb/images/2nd_badge.gif" width="14" height="14" alt="Second" />
<?} for($i =1 ; $i <= $num3; $i++){ ?>
<img border="0" src="../bb/images/3rd_badge.gif" width="14" height="14" alt="Third" />
<?} for($i =1 ; $i <= $num4; $i++){ ?>
<img border="0" src="../bb/images/cm_badgeA.gif" width="14" height="14" alt="fourth" />
<?}?>
This code works when embedded into a php file but, I can't see to get the for statements to work with some sort of variable I can place in the template. I've tried placint a variable in the for statements and then setting each variable, then calling the variable in the template but that doesn't work.
Any help would be really appreciated.