Jump to content

Awards Table


Kieran

Recommended Posts

Hey,

If you would like an awards table if your site, use this code. The table is totally plain, but fully customisable using your standard table css/html.

profile_mail.tpl

		<p>
		<strong>My Awards</strong><br />
		<?php
		if(!$allawards)
		{
			echo 'No awards yet';
		}
		else
		{	

			/* To show the image:
				<img src="<?php echo $award->image?>" alt="<?php echo $award->descrip?>" />
			*/

		?>
		<ul>
		<table width="790" border="0" cellspacing="5" cellpadding="5">
			<?php foreach($allawards as $award){ ?>
		  <tr>
		     <td width="25%"><center><img src="<?php echo $award->image?>" alt="<?php echo $award->descrip?>" /></center></td>
			    <td width="25%"><center><?php echo $award->name ?></center></td>
			    <td width="50%"><center><?php echo $award->descrip ?></center></td>
			  </tr>
			<?php } ?>
		</table>


		</ul>	
		<?php
		}
		?>
	</p>

pilots_public_profile.tpl

		<p>
		<strong><?php echo $userinfo->firstname; ?>'s Awards</strong><br />
		<?php
		if(!$allawards)
		{
			echo $userinfo->firstname . 'has no awards yet.';
		}
		else
		{	

			/* To show the image:
				<img src="<?php echo $award->image?>" alt="<?php echo $award->descrip?>" />
			*/

		?>
		<ul>
		<table width="790" border="0" cellspacing="5" cellpadding="5">
			<?php foreach($allawards as $award){ ?>
		  <tr>
		     <td width="25%"><center><img src="<?php echo $award->image?>" alt="<?php echo $award->descrip?>" /></center></td>
			    <td width="25%"><center><?php echo $award->name ?></center></td>
			    <td width="50%"><center><?php echo $award->descrip ?></center></td>
			  </tr>
			<?php } ?>
		</table>


		</ul>	
		<?php
		}
		?>
	</p>

266_edf2daf4b9b26f1de7c14a62c291d5928e3b70c9

  • Like 2
Link to comment
Share on other sites

  • 2 weeks later...
  • 2 months later...
  • 2 months later...
  • 3 weeks later...
  • 6 months later...

I've done something terribly wrong here. I am trying to set this in a table, but can't get it to lineup correctly. Can someone please help with this table?

<table width="100%" border="1" bgcolor="#042233" id="tabledlist" class="tablesorter">
<thead>
<tr>
<th width="25%" border="0">Award</th>
<th width="25%" border="0">Award Name</th>
<th width="50%" border="0">Description</th>

</tr>
</thead>

                       <?php
                       if(!$allawards)
                       {
                               echo $userinfo->firstname . 'has no awards yet.';
                       }
                       else
                       {       

                               /* To show the image:
                                       <img src="<?php echo $award->image?>" alt="<?php echo $award->descrip?>" />
                               */

                       ?>
                       <ul>
                       <table width="790" bgcolor="#042233" border="1" cellspacing="5" cellpadding="5">
                               <?php foreach($allawards as $award){ ?>
                         <tr>
                           <td width="25%"><center><img src="<?php echo $award->image?>" alt="<?php echo $award->descrip?>" /></center></td>
                           <td width="25%"><center><?php echo $award->name ?></center></td>
                           <td width="50%"><center><?php echo $award->descrip ?></center></td>
                         </tr>
                               <?php } ?>
                       </table>


                       </ul>   
                       <?php
                       }
                       ?>

I know how to do tables for everything else, but this one is being stubborn.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...