Jon Posted November 27, 2010 Report Share Posted November 27, 2010 Hi All, Ok so the plan is that if want to add a section in the pilot cntre that shows according to a pilots hub so, for example, If Joe Bloggs Was in EGKK, it would show hub information. I am aware that it might be possible using a "if" statement but at the moment my knowledge of php isn't helping. I thought about using something like the code which shows different parts of the nav-bar but that would involve groups. Help Appreciated, Jon Derrick www.leavirtual.com Quote Link to comment Share on other sites More sharing options...
Administrators simpilot Posted November 27, 2010 Administrators Report Share Posted November 27, 2010 On the pilot center page you can use the $userinfo variable to determine the hub the pilot is in; <?php if($userinfo->hub == 'EGKK') { //do stuff here } ?> Quote Link to comment Share on other sites More sharing options...
Jon Posted November 27, 2010 Author Report Share Posted November 27, 2010 Thanks Mate, Jon Quote Link to comment Share on other sites More sharing options...
Jon Posted November 27, 2010 Author Report Share Posted November 27, 2010 Ok I want to display an Image for each pilot showing their Hub. And I also want To show an image for the Staff e-mail login: However I'm getting the following error: Parse error: syntax error, unexpected '<' in /home/leavirtu/public_html/lib/skins/Site/profile_main.tpl on line 180 Line 180 is where <a href="http://www.leavirtual.com:2095"><img src="http://www.leavirtual.com/lib/skins/Site/images/profile/e-mail_staff.gif" width="200" height="100" border="0" /></a> is. <?php if(Auth::LoggedIn()) { if(PilotGroups::group_has_perm(Auth::$usergroups, ACCESS_ADMIN)) { <a href="http://www.leavirtual.com:2095"><img src="http://www.leavirtual.com/lib/skins/Site/images/profile/e-mail_staff.gif" width="200" height="100" border="0" /></a> } ?> <?php if($userinfo->hub == 'EGLC') { <img src="http://www.leavirtual.com/lib/skins/Site/images/profile/eglc.gif" width="200" height="100" /> } ?> Am I doing it wrong? Ahd a look at using the php mehtod image showing but doesn't make sense, Help Apprciated, Jon Quote Link to comment Share on other sites More sharing options...
Administrators simpilot Posted November 27, 2010 Administrators Report Share Posted November 27, 2010 When you are working inside of php tags you need to use the print or echo syntax to get the html to the browser. There are a few ways you can get this done. Two of them would be; <?php if($userinfo->hub == 'EGLC') { echo '<img src="http://www.leavirtual.com/lib/skins/Site/images/profile/eglc.gif" width="200" height="100" /> '; } ?> or if there is a lot of html to parse it is sometimes easier to end your php coding and then restart it after your html syntax <?php if($userinfo->hub == 'EGLC') { ?> <img src="http://www.leavirtual.com/lib/skins/Site/images/profile/eglc.gif" width="200" height="100" /> <?php } ?> 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.