Jump to content

Customize the layout help need


LH154

Recommended Posts

  • Moderators
11 hours ago, LH154 said:

Hello together I would like the side content in the middle is http://stuttgart-airlines-va.com/index.php/Pilots how can I do that?

Hi,

try adding this:

 <div class="sky-postcontent sky-postcontent-0 clearfix">
   		<div class="sky-content-layout">
    		<div class="sky-content-layout-row">
              
             	<!--	Your content here
						============================================= -->
              
          </div>
   </div>
</div>

 

Link to comment
Share on other sites

Has unfortunately not worked. Here times the original code I hope this is not a problem
 

<section class="page-contents">
<div class="container">
<?php if(!defined('IN_PHPVMS') && IN_PHPVMS !== true) { die(); } ?>
<h3><i class="fa fa-users" fa-lg"></i> <?php echo $title?></h3>

<?php
if(!$pilot_list) {
	echo 'There are no pilots!';
	return;
}
?>

<table class="sky_table" width="100%" cellspacing="0">
<thead>
<tr>
	<th>Pilot ID</th>
	<th>Name</th>
	<th>Rank</th>
	<th>Flights</th>
	<th>Hours</th>
</tr>
</thead>
<tbody>
<?php
foreach($pilot_list as $pilot)
{
	/* 
		To include a custom field, use the following example:

		<td>
			<?php echo PilotData::GetFieldValue($pilot->pilotid, 'VATSIM ID'); ?>
		</td>

		For instance, if you added a field called "IVAO Callsign":

			echo PilotData::GetFieldValue($pilot->pilotid, 'IVAO Callsign');		
	 */
	 
	 // To skip a retired pilot, uncomment the next line:
	 //if($pilot->retired == 1) { continue; }
?>
<tr>
	<td width="1%" nowrap><a href="<?php echo url('/profile/view/'.$pilot->pilotid);?>">
			<?php echo PilotData::GetPilotCode($pilot->code, $pilot->pilotid)?></a>
	</td>
	<td>
		<img src="<?php echo Countries::getCountryImage($pilot->location);?>" 
			alt="<?php echo Countries::getCountryName($pilot->location);?>" />
			
		<?php echo $pilot->firstname.' '.$pilot->lastname?>
	</td>
	<td><img src="<?php echo $pilot->rankimage?>" alt="<?php echo $pilot->rank;?>" /></td>
	<td><?php echo $pilot->totalflights?></td>
	<td><?php echo Util::AddTime($pilot->totalhours, $pilot->transferhours); ?></td>
<?php
}
?>
</tbody>
</table>
</div>
</section>

 

Link to comment
Share on other sites

  • Moderators
On 2017-6-12 at 4:20 AM, LH154 said:

Has unfortunately not worked. Here times the original code I hope this is not a problem
 


<section class="page-contents">
<div class="container">
<?php if(!defined('IN_PHPVMS') && IN_PHPVMS !== true) { die(); } ?>
<h3><i class="fa fa-users" fa-lg"></i> <?php echo $title?></h3>

<?php
if(!$pilot_list) {
	echo 'There are no pilots!';
	return;
}
?>

<table class="sky_table" width="100%" cellspacing="0">
<thead>
<tr>
	<th>Pilot ID</th>
	<th>Name</th>
	<th>Rank</th>
	<th>Flights</th>
	<th>Hours</th>
</tr>
</thead>
<tbody>
<?php
foreach($pilot_list as $pilot)
{
	/* 
		To include a custom field, use the following example:

		<td>
			<?php echo PilotData::GetFieldValue($pilot->pilotid, 'VATSIM ID'); ?>
		</td>

		For instance, if you added a field called "IVAO Callsign":

			echo PilotData::GetFieldValue($pilot->pilotid, 'IVAO Callsign');		
	 */
	 
	 // To skip a retired pilot, uncomment the next line:
	 //if($pilot->retired == 1) { continue; }
?>
<tr>
	<td width="1%" nowrap><a href="<?php echo url('/profile/view/'.$pilot->pilotid);?>">
			<?php echo PilotData::GetPilotCode($pilot->code, $pilot->pilotid)?></a>
	</td>
	<td>
		<img src="<?php echo Countries::getCountryImage($pilot->location);?>" 
			alt="<?php echo Countries::getCountryName($pilot->location);?>" />
			
		<?php echo $pilot->firstname.' '.$pilot->lastname?>
	</td>
	<td><img src="<?php echo $pilot->rankimage?>" alt="<?php echo $pilot->rank;?>" /></td>
	<td><?php echo $pilot->totalflights?></td>
	<td><?php echo Util::AddTime($pilot->totalhours, $pilot->transferhours); ?></td>
<?php
}
?>
</tbody>
</table>
</div>
</section>

 

it should work:

<?php if(!defined('IN_PHPVMS') && IN_PHPVMS !== true) { die(); } ?>
<section class="page-contents">
  <div class="container">
    <h3><i class="fa fa-users" fa-lg"></i> <?php echo $title?></h3>

    <?php
    if(!$pilot_list) {
        echo 'There are no pilots!';
        return;
    }
    ?>

    <table width="100%" border="0" cellspacing="0" cellpadding="0" class="sky_table">
      <thead>
        <tr>
            <th>Pilot ID</th>
            <th>Name</th>
            <th>Rank</th>
            <th>Flights</th>
            <th>Hours</th>
        </tr>
      </thead>
      <tbody>
        <?php
        foreach($pilot_list as $pilot)
        {
            /* 
                To include a custom field, use the following example:

                <td>
                    <?php echo PilotData::GetFieldValue($pilot->pilotid, 'VATSIM ID'); ?>
                </td>

                For instance, if you added a field called "IVAO Callsign":

                    echo PilotData::GetFieldValue($pilot->pilotid, 'IVAO Callsign');		
             */

             // To skip a retired pilot, uncomment the next line:
             //if($pilot->retired == 1) { continue; }
        ?>
        <tr>
            <td width="1%" nowrap><a href="<?php echo url('/profile/view/'.$pilot->pilotid);?>">
                    <?php echo PilotData::GetPilotCode($pilot->code, $pilot->pilotid)?></a>
            </td>
            <td>
                <img src="<?php echo Countries::getCountryImage($pilot->location);?>" 
                    alt="<?php echo Countries::getCountryName($pilot->location);?>" />

                <?php echo $pilot->firstname.' '.$pilot->lastname?>
            </td>
            <td><img src="<?php echo $pilot->rankimage?>" alt="<?php echo $pilot->rank;?>" /></td>
            <td><?php echo $pilot->totalflights?></td>
            <td><?php echo Util::AddTime($pilot->totalhours, $pilot->transferhours); ?></td>
            </tr>
        <?php
        }
        ?>
      </tbody>
    </table>
  </div>
</section>

If it no, send me a pm pls.

Link to comment
Share on other sites

  • Moderators

The pilot_list.tpl is called once per hub. This means that if you add a header into the pilot_list.tpl, the header will be shown same number as hubs. Open your core/modules/Pilots.php file and you will see something like this:

public function index()
	{
		// Get all of our hubs, and list pilots by hub
		$allhubs = OperationsData::GetAllHubs();
		
		if(!$allhubs) $allhubs = array();
		
		foreach($allhubs as $hub)
		{
			$this->set('title', $hub->name);
			$this->set('icao', $hub->icao);
			
            $pilot_list = PilotData::findPilots(array('p.hub'=>$hub->icao));
			$this->set('allpilots', $pilot_list); # deprecated
            $this->set('pilot_list', $pilot_list);
								
			$this->render('pilots_list.tpl');
		}
		
		$nohub = PilotData::findPilots(array('p.hub'=>''));
		if(!$nohub) {
			return;
		}
		
		$this->set('title', 'No Hub');
		$this->set('icao', '');
		$this->set('allpilots', $nohub); # deprecated
        $this->set('pilot_list', $nohub);
		$this->render('pilots_list.tpl');
	}

As you can see on line 8, there is a foreach and within the foreach the pilot_list.tpl is called. What you can do to avoid it:

1) Replace the above part of code with this:

public function index()
	{
		// Get all of our hubs, and list pilots by hub
		$allhubs = OperationsData::GetAllHubs();
		
		if(!$allhubs) $allhubs = array();
		
		//foreach($allhubs as $hub)
		//{
			//$this->set('title', $hub->name);
			//$this->set('icao', $hub->icao);
			
            //$pilot_list = PilotData::findPilots(array('p.hub'=>$hub->icao));
			//$this->set('allpilots', $pilot_list); # deprecated
            //$this->set('pilot_list', $pilot_list);
			$this->set('allhubs', $allhubs);		
			$this->render('pilots_list.tpl');
		//}
		
		//$nohub = PilotData::findPilots(array('p.hub'=>''));
		//if(!$nohub) {
			//return;
		//}
		
		//$this->set('title', 'No Hub');
		//$this->set('icao', '');
		//$this->set('allpilots', $nohub); # deprecated
        //$this->set('pilot_list', $nohub);
		//$this->render('pilots_list.tpl');
	}

2) In this step, the pilot_list.tpl is called once by the module. Open your pilot_list.tpl and replace it to something like this:

<?php if(!defined('IN_PHPVMS') && IN_PHPVMS !== true) { die(); } ?>
<section class="page-contents">
  <div class="container">
    <?php if(!$allhubs) { echo 'There are not any hubs!';} else {
		
		foreach($allhubs as $hub)
		{
    <h3><i class="fa fa-users" fa-lg"></i> <?php echo $hub->name; ?></h3>

    <?php
	$pilot_list = PilotData::findPilots(array('p.hub'=>$hub->icao));
    if(!$pilot_list) {
        echo 'There are no pilots in this HUB!';
        continue;
    }
    ?>

    <table width="100%" border="0" cellspacing="0" cellpadding="0" class="sky_table">
      <thead>
        <tr>
            <th>Pilot ID</th>
            <th>Name</th>
            <th>Rank</th>
            <th>Flights</th>
            <th>Hours</th>
        </tr>
      </thead>
      <tbody>
        <?php
        foreach($pilot_list as $pilot)
        {
            /* 
                To include a custom field, use the following example:

                <td>
                    <?php echo PilotData::GetFieldValue($pilot->pilotid, 'VATSIM ID'); ?>
                </td>

                For instance, if you added a field called "IVAO Callsign":

                    echo PilotData::GetFieldValue($pilot->pilotid, 'IVAO Callsign');		
             */

             // To skip a retired pilot, uncomment the next line:
             //if($pilot->retired == 1) { continue; }
        ?>
        <tr>
            <td width="1%" nowrap><a href="<?php echo url('/profile/view/'.$pilot->pilotid);?>">
                    <?php echo PilotData::GetPilotCode($pilot->code, $pilot->pilotid)?></a>
            </td>
            <td>
                <img src="<?php echo Countries::getCountryImage($pilot->location);?>" 
                    alt="<?php echo Countries::getCountryName($pilot->location);?>" />

                <?php echo $pilot->firstname.' '.$pilot->lastname?>
            </td>
            <td><img src="<?php echo $pilot->rankimage?>" alt="<?php echo $pilot->rank;?>" /></td>
            <td><?php echo $pilot->totalflights?></td>
            <td><?php echo Util::AddTime($pilot->totalhours, $pilot->transferhours); ?></td>
            </tr>
        <?php
        }
        ?>
      </tbody>
    </table>
	<?php } } ?>
  </div>
</section>

Let us know how it works. I did not test it but it should be ok.

Link to comment
Share on other sites

  • Moderators
15 hours ago, servetas said:

The pilot_list.tpl is called once per hub. This means that if you add a header into the pilot_list.tpl, the header will be shown same number as hubs. Open your core/modules/Pilots.php file and you will see something like this:


public function index()
	{
		// Get all of our hubs, and list pilots by hub
		$allhubs = OperationsData::GetAllHubs();
		
		if(!$allhubs) $allhubs = array();
		
		foreach($allhubs as $hub)
		{
			$this->set('title', $hub->name);
			$this->set('icao', $hub->icao);
			
            $pilot_list = PilotData::findPilots(array('p.hub'=>$hub->icao));
			$this->set('allpilots', $pilot_list); # deprecated
            $this->set('pilot_list', $pilot_list);
								
			$this->render('pilots_list.tpl');
		}
		
		$nohub = PilotData::findPilots(array('p.hub'=>''));
		if(!$nohub) {
			return;
		}
		
		$this->set('title', 'No Hub');
		$this->set('icao', '');
		$this->set('allpilots', $nohub); # deprecated
        $this->set('pilot_list', $nohub);
		$this->render('pilots_list.tpl');
	}

As you can see on line 8, there is a foreach and within the foreach the pilot_list.tpl is called. What you can do to avoid it:

1) Replace the above part of code with this:


public function index()
	{
		// Get all of our hubs, and list pilots by hub
		$allhubs = OperationsData::GetAllHubs();
		
		if(!$allhubs) $allhubs = array();
		
		//foreach($allhubs as $hub)
		//{
			//$this->set('title', $hub->name);
			//$this->set('icao', $hub->icao);
			
            //$pilot_list = PilotData::findPilots(array('p.hub'=>$hub->icao));
			//$this->set('allpilots', $pilot_list); # deprecated
            //$this->set('pilot_list', $pilot_list);
			$this->set('allhubs', $allhubs);		
			$this->render('pilots_list.tpl');
		//}
		
		//$nohub = PilotData::findPilots(array('p.hub'=>''));
		//if(!$nohub) {
			//return;
		//}
		
		//$this->set('title', 'No Hub');
		//$this->set('icao', '');
		//$this->set('allpilots', $nohub); # deprecated
        //$this->set('pilot_list', $nohub);
		//$this->render('pilots_list.tpl');
	}

2) In this step, the pilot_list.tpl is called once by the module. Open your pilot_list.tpl and replace it to something like this:


<?php if(!defined('IN_PHPVMS') && IN_PHPVMS !== true) { die(); } ?>
<section class="page-contents">
  <div class="container">
    <?php if(!$allhubs) { echo 'There are not any hubs!';} else {
		
		foreach($allhubs as $hub)
		{
    <h3><i class="fa fa-users" fa-lg"></i> <?php echo $hub->name; ?></h3>

    <?php
	$pilot_list = PilotData::findPilots(array('p.hub'=>$hub->icao));
    if(!$pilot_list) {
        echo 'There are no pilots in this HUB!';
        continue;
    }
    ?>

    <table width="100%" border="0" cellspacing="0" cellpadding="0" class="sky_table">
      <thead>
        <tr>
            <th>Pilot ID</th>
            <th>Name</th>
            <th>Rank</th>
            <th>Flights</th>
            <th>Hours</th>
        </tr>
      </thead>
      <tbody>
        <?php
        foreach($pilot_list as $pilot)
        {
            /* 
                To include a custom field, use the following example:

                <td>
                    <?php echo PilotData::GetFieldValue($pilot->pilotid, 'VATSIM ID'); ?>
                </td>

                For instance, if you added a field called "IVAO Callsign":

                    echo PilotData::GetFieldValue($pilot->pilotid, 'IVAO Callsign');		
             */

             // To skip a retired pilot, uncomment the next line:
             //if($pilot->retired == 1) { continue; }
        ?>
        <tr>
            <td width="1%" nowrap><a href="<?php echo url('/profile/view/'.$pilot->pilotid);?>">
                    <?php echo PilotData::GetPilotCode($pilot->code, $pilot->pilotid)?></a>
            </td>
            <td>
                <img src="<?php echo Countries::getCountryImage($pilot->location);?>" 
                    alt="<?php echo Countries::getCountryName($pilot->location);?>" />

                <?php echo $pilot->firstname.' '.$pilot->lastname?>
            </td>
            <td><img src="<?php echo $pilot->rankimage?>" alt="<?php echo $pilot->rank;?>" /></td>
            <td><?php echo $pilot->totalflights?></td>
            <td><?php echo Util::AddTime($pilot->totalhours, $pilot->transferhours); ?></td>
            </tr>
        <?php
        }
        ?>
      </tbody>
    </table>
	<?php } } ?>
  </div>
</section>

Let us know how it works. I did not test it but it should be ok.

Servetas,

he didn't ask for that, he only want center the content with a class (CSS) lol.

Edited by ProSkyDesign
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...