Jump to content

Pilot images do not appear on some pages [SOLVED]


CarlosEduardo2409

Recommended Posts

First of all, I'm using Simpilot phpVMS 5.5 and Web541 CrewCenter and my language is Portuguese.

 

Error in: Dropdown

 

On some pages, or almost all, the photo of the pilot is not showing up. Appearing only on the panel.

 

When I go to the panel, the image appears correctly, but when I go to another page, the default phpVMS appears. Here is the image: In the dashboard: http://prntscr.com/gqgmvh || In the downloads: http://prntscr.com/gqgmp4

 

App_top code:

<ul class="dropdown-menu">
                                <!-- User image -->
                                <li class="user-header">
                                    <img src="<?php echo PilotData::getPilotAvatar($pilotcode); ?>" class="img-circle" alt="User Image">

 

Edited by CarlosEduardo2409
Link to comment
Share on other sites

  • Moderators

change this:

<img src="<?php echo PilotData::getPilotAvatar($pilotcode); ?>" class="img-circle" alt="User Image">

to this:

<?php $pilotcode = PilotData::getPilotCode(Auth::$userinfo->code, Auth::$userinfo->pilotid); ?>
<img src="<?php echo PilotData::getPilotAvatar($pilotcode); ?>" class="img-circle" alt="User Image">

 

Link to comment
Share on other sites

11 minutes ago, servetas said:

change this:


<img src="<?php echo PilotData::getPilotAvatar($pilotcode); ?>" class="img-circle" alt="User Image">

to this:


<?php $pilotcode = PilotData::getPilotCode(Auth::$userinfo->code, Auth::$userinfo->pilotid); ?>
<img src="<?php echo PilotData::getPilotAvatar($pilotcode); ?>" class="img-circle" alt="User Image">

 

OMG, Thank you!! Now you're working right. (SOLVED)

Link to comment
Share on other sites

  • Moderators

Just to explain why it did not work. The "$pilotcode" variable is only populated in Profile. When you were visiting other pages, the "$pilotcode" variable had not been populated and considering that it was empty, no avatar was returned by the PilotData::getPilotAvatar($pilotcode) function. The line I added populates the "$pilotcode" variable based on the currently logged in pilot and that's why it now works in every part of your website.

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