CarlosEduardo2409 Posted September 27, 2017 Report Share Posted September 27, 2017 (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 September 27, 2017 by CarlosEduardo2409 Quote Link to comment Share on other sites More sharing options...
Moderators servetas Posted September 27, 2017 Moderators Report Share Posted September 27, 2017 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"> Quote Link to comment Share on other sites More sharing options...
CarlosEduardo2409 Posted September 27, 2017 Author Report Share Posted September 27, 2017 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) Quote Link to comment Share on other sites More sharing options...
Moderators servetas Posted September 28, 2017 Moderators Report Share Posted September 28, 2017 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. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.