Jump to content

Recommended Posts

Posted (edited)

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
  • Moderators
Posted

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

 

Posted
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)

  • Moderators
Posted

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.

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