Jump to content

Want a different home page to pilot center


ahughes3

Recommended Posts

Ok so my next challenge in skinning!

I have got a custom skin which has a rotating image slider at the top, which looks lovely. On pretty much most pages everything seems ok, the rotating image slider is at the top and the page content is where it should be. However, if I do a search on the schedules and press the button for results, when the page loads I can see another mini version of my rotating image slider above my search results. So I end up with the normal page image slider, then a small one which looks like it has been nested into the main page body content.

My questions is two-fold;

  1. Can I create a different page to load so that my rotating slide only appears when someone is on the homepage of the site and inside the site, i.e. pilot centre, there is a different page without the slider?
  2. Does anyone know, or can they guess what might be going on with my search results page i.e. why it is incorporating another copy of the image slider in its content?

Happy to give someone access if they want to look at the pilot center to see what I mean.

Thanks

Link to comment
Share on other sites

Ok so my next challenge in skinning!

I have got a custom skin which has a rotating image slider at the top, which looks lovely. On pretty much most pages everything seems ok, the rotating image slider is at the top and the page content is where it should be. However, if I do a search on the schedules and press the button for results, when the page loads I can see another mini version of my rotating image slider above my search results. So I end up with the normal page image slider, then a small one which looks like it has been nested into the main page body content.

My questions is two-fold;

  1. Can I create a different page to load so that my rotating slide only appears when someone is on the homepage of the site and inside the site, i.e. pilot centre, there is a different page without the slider?
  2. Does anyone know, or can they guess what might be going on with my search results page i.e. why it is incorporating another copy of the image slider in its content?

Happy to give someone access if they want to look at the pilot center to see what I mean.

Thanks

1. Yes, the frontpage_main.php file is what controls the look of your frontpage, it won't modify the entire page but i will modify the "content" portion so to speak. Take a look here (http://wwwapps.hphvirtual.com/hph-portal/index.php/) the frontpage_main.php file is controlling the area in the center where I have the image and then the text which includes the "press releases" section which I haven't yet coded.

2. Have you made any modification to the schedules module? If you haven't, what is displayed below the search functions is controlled in the Schedules.php file in core/modules/schedules. On line 208 you'll see

$this->render('schedule_searchform.tpl');

This is telling phpVMS to output the file found in core/templates/schedule_searchform.tpl or .php. I'm not sure which files auto correct themselves to the .php extenstion.

In the schedule_searchform.tpl file, make sure there isn't any code on the top which would be telling the browser to display your images.

Other possible files would be schedule_list.tpl and schedule_results.tpl.

The weird part is that looking at the page source on your website, I don't see any mention of the images. Maybe its javascript? I'm not familiar with JS at all.

Link to comment
Share on other sites

Thanks for the reply Tom, I just want to see if I understand you straight.

Firstly, I haven't edited the schedules module or any of the other files you mention.

Secondly, if the frontpage_main.php controls the "content" portion then that is not the bit I want to change (ignoring my double slider issue). What I want to have is a homepage which will display the rotating slider at the top and then in the content portion I will have live flight boards etc. Then when someone logs into the pilot centre, I want there to be a different page which has the pilot content stuff from phpvms, but at the top, I don't want the slider. Instead I would like to have just a title bar for all other content pages.

Does that make sense? I have added the link to the template I am using below. If you look at the homepage and then the services page you will see what I mean.

http://graygrids.com/demos/themes/margo/index.html

http://graygrids.com/demos/themes/margo/services.html

So, in summary, the phpvms content in the middle of the page I am cool with. It's the header section with the slider I want to change on all other pages. Would you above suggestion still work do you think?

As for images on the page, I just looked at the source and yep I definitely see them there.

Cheers

Link to comment
Share on other sites

Harry,

Now I understand what you are trying to do. The only way I can think of doing it would be using an php if statement, showing different code for different statements specified.

I took a look again, if you use Mozilla Firefox you can hit "F12" to inspect the current webpage. In the Div id "container" the section id is "home". If you can somehow comment that div out you should be able to fix your issue. This may need some help from the design guru's, I am really good with HTML/CSS/PHP and not so good with other web technologies.

Link to comment
Share on other sites

  • Moderators

Harry if i follow you you can use the logged in feature ie display different content for users logged in or not.

The function is,

<?php
if(Auth::LoggedIn() == false)
{ ?>
<p align="center">Your content for visitors</p>

<?php
}
else
{
$pilotid = PilotData::GetPilotCode(Auth::$userinfo->code, Auth::$userinfo->pilotid);
?>
//stuff goes here to display for logged in users
<?php
} /* End the else */
?>

Thats if im following you right.

Link to comment
Share on other sites

Ok ima go try that Mark. I can't believe its an unusual request :P

So what you're saying is if I put the header content that I want to show, if they are logged in, inside the php tags and then the other stuff I want to show goes outside of them?

Thanks again for the support chaps.

Link to comment
Share on other sites

Ok ima go try that Mark. I can't believe its an unusual request :P

So what you're saying is if I put the header content that I want to show, if they are logged in, inside the php tags and then the other stuff I want to show goes outside of them?

Thanks again for the support chaps.

Correct. Below is a working example from my frontpage_main.php file, same process as what you are trying to do as my homepage is different for logged in vs. logged out users.

<?php
// SMF Require
// require("../forum/SSI.php");

if(!Auth::LoggedIn())
{
 // Frontpage for users who have not logged into the website.
?> 
<div id="mainbox">
 <div id="frontPageEditContent">
 <?php
  MainController::Run('Pages', '__call', 'home', '');
 ?>
 <hr />
 <p style="text-align:center; font-family:Impact, Haettenschweiler, Arial Narrow Bold, sans-serif; color:#094FAF; font-size:large; font-weight:100; line-height:0px;">Press Releases</p>
 <?php // ssi_boardNews($isOverride=true); ?>
 </div>
</div>
<br>
<br>
<?php
}
 //End non logged in content.
else
 //Logged in content below.
{
?>
<div id="frontPageEditContentP">
 <?php
  //<img alt="Hemisphere Virtual Airlines" src="http://wwwapps.hphvirtual.com/hph-portal/lib/skins/HPHportalv1/images/front_page/hph_fp_js2.jpg" width="800ox"/>
  //<br>
  //<br>
 ?>
 <div id="frontPageEditContentPLside" style="width: 50%; min-height:315px; float:left;">
  <table border="0" style="border: 0px solid; text-align: left; width: 100%";>
   <tr>
 <th style="text-align:center;"><font size="4">Featured <?php echo date("F");?> Destination</font></th>
   </tr>
   <tr>
 <td><img alt="Hemisphere Virtual Airlines" src="http://wwwapps.hphvirtual.com/hph-portal/lib/skins/HPHportalv1/required_files/month_destination_image.jpg" /></td>
   </tr>
   <tr>
 <td><?php include('required_files/month_destination_text.html'); ?></td>
   </tr>
  </table>
  <hr>
 </div>
 <div id="frontPageEditContentPRside" style="width: 50%; float:Right;">
  <table border="0" style="border: 0px solid; text-align: left; width: 100%";>
   <tr>
 <th style="text-align:center;"><font size="4">Recent Flight Bids</font></th>
   </tr>
  </table>
  <table border="1" style="border: 2px solid; text-align: center; width: 100%";>
   <tr>
 <th style="width:90px">Flight #</th>
 <th style="width:150px">Dep./Arr.</th>
 <th style="width:150px">Pilot</th>
   </tr>
   <tr>
 <td colspan="3"><?php MainController::Run('FrontBids', 'RecentFrontPage', 5); ?></td>
   </tr>
  </table>
  <table border="0" style="border: 0px solid; text-align: left; width: 100%";>
   <tr>
 <th style="text-align:center;"><font size="4">Recent Flight Reports</font></th>
   </tr>
  </table>
  <table border="1" style="border: 2px solid; text-align: center; width: 100%";>
   <tr>
 <th style="width:90px">Flight #</th>
 <th style="width:150px">Dep./Arr.</th>
 <th style="width:150px">Pilot</th>
   </tr>
   <tr>
 <td colspan="3"><?php MainController::Run('PIREPS', 'RecentFrontPage', 5); ?></td>
   </tr>
  </table>
 </div>
 <div id="dashboardFooter" style="width:780px; min-height:50px; clear:both;">
  <?php MainController::Run('Pages', '__call', 'home-protected', ''); ?>
 </div>
</div>
<?php
//End Logged in content.
}
?>

Link to comment
Share on other sites

  • 2 weeks later...

So I used the above coding as suggested and on the homepage when people aren't logged in they will see an image slide, a recent flights table and a booked flights table. When they log in, the image slider has now disappeared but the tables still show. I think I can sort this by moving the tabled code into the "if logged in" php code. However, I still have another issue.

When I click on view schedules and search via destination, at the top of the search results I get the banner from the top of the page showing up. (see image below)

page-header-problem.jpg

I don't know why the banner is repeating as it doesn't on other pages I've tested so far (pilot centre). Does anywhere know what templates create this search results page so I can examine the code. Alternatively, can I create a module and template which replaces the page with different content?

Thanks

Link to comment
Share on other sites

I looked in the schedule_searchform.php and schedule_results.php and I can't see anything that looks like it is calling the main page content again. This is really puzzling as it is only repeating certain elements and not the whole page. Why can't these things ever be straight forward! :P

I am back to square one, still trying to work out why this content is repeating and I'm still not much the wiser. Any support, truly appreciated. I can set up a dummy account on the site if anyone wants to go in a take a look at what is happening for themselves.

Link to comment
Share on other sites

Harry,

This has to be stringing back to the $page_content variable. I'm not sure where it would be in the code besides the layout.php, I had a similar problem when building a portion of a crew center module. The code in the controller wasn't right and would cause the duplicating like you have. Problem is that in the screenshot you posted you haven't searched for flights yet which is where my error came in.

I'm not quite sure what else could be going on.

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