edmundk Posted November 25, 2011 Report Posted November 25, 2011 I have the Aword Images Showing in the pilot Center but how do i make so only a certain amount of awords are shown per line? I tis starting to look really bad when a pilot has too many awords. I am using this code.. <ul style="margin-top: 0px; margin-left: 2px;"> <?php foreach($allawards as $award){ ?> <img src="<?php echo ($award->image);?>" alt="<?php echo ($award->descrip);?>" /> <?php } ?> </ul> <?php } ?> Thanks! Quote
mattia Posted November 26, 2011 Report Posted November 26, 2011 you have to do a loop, use this code $break = 5; $i=0; // This loop should already be there foreach (.....) { $i++; if($i%$break == 0) echo "<br />"; } Quote
edmundk Posted November 26, 2011 Author Report Posted November 26, 2011 you have to do a loop, use this code $break = 5; $i=0; // This loop should already be there foreach (.....) { $i++; if($i%$break == 0) echo "<br />"; } Thanks! Where do i pout it? Quote
mattia Posted November 26, 2011 Report Posted November 26, 2011 ok sorry for the wait check in your profile_main.tpl search this <strong>My Awards</strong><br /> <?php if(!$allawards) { echo 'No awards yet'; } else { ?> and after delete all and add this: <?php $break = 5; $i=0; foreach($allawards as $award){ ?> <img src="<?php echo $award->image?>" title="<?php echo $award->descrip?>" /> <?php { $i++; if($i%$break == 0) echo "<br />"; } ?> my full code is: <p> <strong>My Awards</strong><br /> <?php if(!$allawards) { echo 'No awards yet'; } else { ?> <?php $break = 5; $i=0; foreach($allawards as $award){ ?> <img src="<?php echo $award->image?>" title="<?php echo $award->descrip?>" /> <?php { $i++; if($i%$break == 0) echo "<br />"; } ?> <?php } ?> <?php } ?> </p> </td> </tr> </table> </div> </div> 1 Quote
edmundk Posted November 26, 2011 Author Report Posted November 26, 2011 ok sorry for the wait check in your profile_main.tpl search this <strong>My Awards</strong><br /> <?php if(!$allawards) { echo 'No awards yet'; } else { ?> and after delete all and add this: <?php $break = 5; $i=0; foreach($allawards as $award){ ?> <img src="<?php echo $award->image?>" title="<?php echo $award->descrip?>" /> <?php { $i++; if($i%$break == 0) echo "<br />"; } ?> my full code is: <p> <strong>My Awards</strong><br /> <?php if(!$allawards) { echo 'No awards yet'; } else { ?> <?php $break = 5; $i=0; foreach($allawards as $award){ ?> <img src="<?php echo $award->image?>" title="<?php echo $award->descrip?>" /> <?php { $i++; if($i%$break == 0) echo "<br />"; } ?> <?php } ?> <?php } ?> </p> </td> </tr> </table> </div> </div> Nvm! Works now! Thanks for the code +1 Quote
mattia Posted November 26, 2011 Report Posted November 26, 2011 Look also for pilot_public_profile? Quote
Virtualei Posted February 14, 2012 Report Posted February 14, 2012 Hi This is great and just what i have been looking for. Just one question I have used the code above but one of my awards is a set of wings. can anyone tell me how I can put it at the top. I can be viewed here http://www.caalair.com/index.php/profile/view/1 You will see what i mean when you look at the link. I would like wings at the top centre followed by the ribbons in rows of 5 below. Thanking you in advance. Alan Quote
Virtualei Posted February 14, 2012 Report Posted February 14, 2012 This maybe a better explanation of what I am trying to achieve. This is the way it is appearing; But this is what i am after; Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.