Jump to content

[P] Pilot Awards


simpilot

Recommended Posts

  • Administrators

Has anyone else had pilot awards start showing up for all pilots (even when they are not assigned an award) again after the last beta (rev 713) ? It started working correctly for me a few builds ago but now with this latest it has started acting up again......  ??? 

Link to comment
Share on other sites

  • Administrators

The awards are showing in the public profile page for all pilots as well as in the pilot center when they are logged in. I have gone in and reset them all and the only one that will show is the first one in the list and it shows on all pilots even if it is not assigned to them. I have had to remove all awards for them not to show everywhere. Tried re-loading the beta and forced the update with no sucess...

On the local development server here I went back and created a new site with beta 712 and the issue is not there, when I updated it to 713 it comes back. It must be something in the PilotData class I think, although I do not see a change in the file that would make it happen...

Link to comment
Share on other sites

  • Administrators

From the profile module it is using:

case 'view':

			$pilotid = $this->get->pilotid;

			if(preg_match('/^([A-Za-z]{3})(d*)/', $pilotid, $matches) > 0)
			{
				$pilotid = $matches[2];
			}

			$userinfo = PilotData::GetPilotData($pilotid);

			Template::Set('userinfo', $userinfo);
			Template::Set('allfields', PilotData::GetFieldData($pilotid, false));
			Template::Set('pireps', PIREPData::GetAllReportsForPilot($pilotid));
			Template::Set('pilotcode', PilotData::GetPilotCode($userinfo->code, $userinfo->pilotid));
			Template::Set('allawards', AwardsData::GetPilotAwards(Auth::$userinfo->pilotid));

			Template::Show('pilot_public_profile.tpl');

			break;

And from the template for display:

<strong>Awards</strong>
		<?php
		if(is_array($allawards))
		{			
		?>
		<ul>
			<?php foreach($allawards as $award)
			{ 
				/* To show the image:*/?>
				<li><?php echo $award->name ?>&nbsp
					<img src="<?php echo $award->image?>" alt="<?php echo $award->descrip?>" /></li>




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

Link to comment
Share on other sites

  • 1 month later...
  • 1 month later...
  • 1 year later...

Look in the code for that template... it's explained in there

ok, I open the pilot_public_profile.tpl in the template folder and i change this

<?php foreach($allawards as $award)
			{ 
				/* To show the image:

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

			?>
				<li><?php echo $award->award ?></li>

			<?php } ?>

with this

<?php foreach($allawards as $award)
			{ 


			?>
					<img src="<?php echo $award->image?>" alt="<?php echo $award->descrip?>" />

			<?php } ?>

now it's ok, thank you ;)

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...