Here's a quick piece of code which will display the user's mailbox on their profile, however with just the date, subject and who from:
1. First, create the file mail_profile.tpl in core/templates/mail and paste the following code:
<table width="100%" cellpadding="2">
<?php if(!$mail){
echo '<tr><td align="center" colspan="3">No NOTAMs available</td></tr>';
}
else {
foreach($mail as $data) {
?>
<?php $user = PilotData::GetPilotData($data->who_from);?>
<tr>
<td width="25%" align="center"><?php echo date(DATE_FORMAT.' H:i', strtotime($data->date)); ?></td>
<td><?php echo $user->firstname.' '.$user->lastname;?></td>
<td>
<?php
if ($data->read_state=='0') { ?>
<b><a href="http://www.freshjetvirtual.com/index.php/Mail/item/<?php echo $data->thread_id;?>"><?php echo $data->subject; ?></a></b>
<?php
}
else
{
?>
<a href="http://www.freshjetvirtual.com/index.php/Mail/item/<?php echo $data->thread_id;?>"><?php echo $data->subject; ?></a>
<?php
}
?>
</td>
</tr>
<?php
}
}
?>
</table>
2. Add the following code to core/modules/Mail/Mail.php :
public function GetProfileMail(){
$pid = Auth::$userinfo->pilotid;
$this->set('mail', MailData::getallmail($pid));
$this->set('pilotcode', PilotData::GetPilotCode(Auth::$userinfo->code, Auth::$userinfo->pilotid));
$this->show('mail/mail_profile.tpl');
}
3. In your profile_main.tpl (or wherever else you want):
<?php MainController::Run('Mail', 'GetProfileMail', 5);?>
The number at the end can be changed to suit how many items you wish to display as per usual.
Enjoy