# Displaying Something Depending On A Pilots Hub - {SOLVED}

**URL:** <https://forum.phpvms.net/t/displaying-something-depending-on-a-pilots-hub-solved/3715>\
**Category:** phpVMS Legacy Support (v2/v5)\
**Created:** [November 27, 2010, 4:44pm UTC](https://forum.phpvms.net/t/displaying-something-depending-on-a-pilots-hub-solved/3715 "2010-11-27T16:44:05Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jon](https://forum.phpvms.net/letter_avatar_proxy/v4/letter/j/3bc359/32.png) [@Jon](https://forum.phpvms.net/u/Jon)\
**Post date:** [November 27, 2010, 4:44pm UTC](https://forum.phpvms.net/t/displaying-something-depending-on-a-pilots-hub-solved/3715/1 "2010-11-27T16:44:05Z")

</div>

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](http://www.leavirtual.com)

---

<div class="post-metadata">

**Author:** ![simpilot](https://forum.phpvms.net/user_avatar/forum.phpvms.net/simpilot/32/26_2.png) [@simpilot](https://forum.phpvms.net/u/simpilot)\
**Post date:** [November 27, 2010, 9:01pm UTC](https://forum.phpvms.net/t/displaying-something-depending-on-a-pilots-hub-solved/3715/2 "2010-11-27T21:01:49Z")

</div>

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
       }
?>

```

---

<div class="post-metadata">

**Author:** ![Jon](https://forum.phpvms.net/letter_avatar_proxy/v4/letter/j/3bc359/32.png) [@Jon](https://forum.phpvms.net/u/Jon)\
**Post date:** [November 27, 2010, 10:13pm UTC](https://forum.phpvms.net/t/displaying-something-depending-on-a-pilots-hub-solved/3715/3 "2010-11-27T22:13:02Z")

</div>

Thanks Mate,

Jon

---

<div class="post-metadata">

**Author:** ![Jon](https://forum.phpvms.net/letter_avatar_proxy/v4/letter/j/3bc359/32.png) [@Jon](https://forum.phpvms.net/u/Jon)\
**Post date:** [November 27, 2010, 11:11pm UTC](https://forum.phpvms.net/t/displaying-something-depending-on-a-pilots-hub-solved/3715/4 "2010-11-27T23:11:53Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![simpilot](https://forum.phpvms.net/user_avatar/forum.phpvms.net/simpilot/32/26_2.png) [@simpilot](https://forum.phpvms.net/u/simpilot)\
**Post date:** [November 27, 2010, 11:52pm UTC](https://forum.phpvms.net/t/displaying-something-depending-on-a-pilots-hub-solved/3715/5 "2010-11-27T23:52:02Z")

</div>

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 
       }  
?>

```
