The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
Moving php embedded html to template and php file
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: Code:
$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']; 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. Code:
<?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" /> <?}?> Any help would be really appreciated. |
#2
|
|||
|
|||
Oka how about a while statement?
I've got this Code:
$i=1; while ($i <= $num): print "<img border=\"0\" src=\"images/1st_badge.gif\" width=\"14\" height=\"14\" alt=\"First\" />"; $i++; endwhile; How can I define a variable for the while statement? Or have some what of telling the statement where to place it's image. |
#3
|
||||
|
||||
for($i =1 ; $i <= $num; $i++)
{ $var .='<img border="0" src="../bb/images/1st_badge.gif" width="14" height="14" alt="First" />'; } for($i =1 ; $i <= $num2; $i++) { $var .='<img border="0" src="../bb/images/2nd_badge.gif" width="14" height="14" alt="Second" />'; } for($i =1 ; $i <= $num3; $i++) { $var .='<img border="0" src="../bb/images/3rd_badge.gif" width="14" height="14" alt="Third" />'; } for($i =1 ; $i <= $num4; $i++) { $var .='<img border="0" src="../bb/images/cm_badgeA.gif" width="14" height="14" alt="fourth" />'; } for the second one, you just replace print with $var = " ... "; |
#4
|
|||
|
|||
Thank you! thank you! thank you! I was pulling hair out over this.
it was that pesky .= I really can't thank you enough for the help Alex. You've made an entire community happy. I owe you one. |
#5
|
||||
|
||||
Glad i was able to help.
|
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|