edmundk Posted November 25, 2011 Report Share 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 Link to comment Share on other sites More sharing options...
mattia Posted November 26, 2011 Report Share 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 Link to comment Share on other sites More sharing options...
edmundk Posted November 26, 2011 Author Report Share 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 Link to comment Share on other sites More sharing options...
mattia Posted November 26, 2011 Report Share 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 Link to comment Share on other sites More sharing options...
edmundk Posted November 26, 2011 Author Report Share 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 Link to comment Share on other sites More sharing options...
mattia Posted November 26, 2011 Report Share Posted November 26, 2011 Look also for pilot_public_profile? Quote Link to comment Share on other sites More sharing options...
Virtualei Posted February 14, 2012 Report Share 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 Link to comment Share on other sites More sharing options...
Virtualei Posted February 14, 2012 Report Share Posted February 14, 2012 deleted Quote Link to comment Share on other sites More sharing options...
Virtualei Posted February 14, 2012 Report Share 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 Link to comment Share on other sites More sharing options...
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.