Jump to content

My tpl file keeps saying header & footer not present


Recommended Posts

Posted

Hi all,

I am just starting out in skinning. I downloaded a template and followed the tutorial but when I go to preview it I get this message:

Notice: The template file "/home5/spiritc1/public_html/virginatlanticvirtualco//lib/skins/exmachina/header.php" doesn't exist in /home5/spiritc1/public_html/virginatlanticvirtualco/core/classes/TemplateSet.class.php on line 231

and another one at the bottom of the page talking about the footer.

I have tried various filepaths to see if I'm doing something wrong but nothing changes, no matter what I do. I did notice that the crystal file is called layout.php and so I tried renaming the file to that and the error disappeared but there is no styling happening, just text.

I have tried this with two different templates and both times the same. Can anyone help shed any light as I've run out of ideas? The link to the site is www.virginatlanticvirtual.co.uk

Thanks

Andy - VIR001

CEO

Virgin Atlantic Virtual - VIR

www.virginatlanticvirtual.co.uk

Posted

You're using a skin with phpVMS' 5.5 by Simpilotgroup. The template files are probably ending in .tpl as file extension, but the phpVMS version you're using requires they end in .php. Go to your skin folder, and change all .tpl extensions to .php.

  • Members
Posted

I would like to remind you that there are 2 ways to create a skin

1 is with header /footer

2 with layout.tpl or in your case .php

In the 1option all the code above the tag <body> goes in the header.tpl or php and the footer is what ever you want to display below the main module display and the module customization is happening in each respective tpl or php file

In 2 everything goes in 1 file that is called layout.tpl or php

Posted

Ok so I just copied over all the header code from the Crystal layout and altered the filepaths and it now shows my CSS. Anyone know how to set the filepaths for js? I have tried just copying the

<?php echo SITE_URL?>/lib/skins/exmachina/css/style-desktop.css"

and then editing the filepath but it doesn't seem to work. All the font css disappears.

Posted

I really want to set up bootstrap for my skin so that it's responsive. I can see how to get the css working but for some reason, the javascript doesn't load. Is the file path format different?

Posted

I really want to set up bootstrap for my skin so that it's responsive. I can see how to get the css working but for some reason, the javascript doesn't load. Is the file path format different?

Are you trying to develop on skin for multiple devices or are you trying to speed the loading of your site? If it's the latter, there is something going on in your hosting environment. Even if you have some bloated code you shouldn't be seeing a slowdown.

Posted

Ok making good progress with the skinning. I now have a site which resembles my template and it's loading the page content from PHPVMS and my site nav looks good.

However, (there's always a however!) I have just tried to book a flight and add the bid and it says;

"bid not passed"

So I switch back to crystal layout and I get this message;

Strict Standards: Non-static method SchedulesData::setBidOnSchedule() should not be called statically in /home5/spiritc1/public_html/virginatlanticvirtualco/core/common/SchedulesData.class.php on line 785

Bid added

does this mean my doctype is wrong or something or is it something else? The pilot center page loads perfectly as does the rest of the static page content.

Thanks

Posted

Ok so I went to the file you mentioned and on the line 785 there was no reference to "static" however, the code was part of a "public static function" so I removed the static from there and re-uploaded. This is the output when I try to add a bid using the crystal skin. The bid gets added even though I get the error below (on my screen, the schedules error sits next to the departure line and the schedulesdata error sits next to the arrival line). If I use my custom skin I just get a message saying "no route was passed".

If I look at the SchedulesData file, I can see that there is a section of code which checks for the route ID and I think, if it is blank, it returns the message "no route was passed". Don't hold me to that though as I'm not clued up on this coding stuff, just trying to apply logic.

In the reference to the Schedules.php file, I have also checked this and there is nothing anywhere around it at all that says "static", even the function call just says "public function".

As this is happening on the crystal layout too, it makes me think it is not a skinning issue and something more fundamental to phpvms files themselves or the connection to the database?

Thanks in advance for your help on this.

VIR1080 (EGKK - EGCC)

Departure: Arrival:

Equipment:A340-600 (G-VFOX)Distance:153.153nm

Days Flown: M T W Th F S View Details

Pilot Brief

Strict Standards: Non-static method SchedulesData::addBid() should not be called statically, assuming $this from incompatible context in /home5/spiritc1/public_html/virginatlanticvirtualco/core/modules/Schedules/Schedules.php on line 167

Strict Standards: Non-static method SchedulesData::setBidOnSchedule() should not be called statically, assuming $this from incompatible context in /home5/spiritc1/public_html/virginatlanticvirtualco/core/common/SchedulesData.class.php on line 785

Bid added

Posted

UPDATE:

So, I have a partial fix thanks to this doc on the forum:

http://forum.phpvms.net/topic/20629-most-common-fixes-phpvms-installation/

This works perfectly with the crystal layout now with no errors.

On my custom skin though, now, for some reason it still returns a "no bid passed" message. I am sure this means it can't find the route ID, or thinks it is blank or something. I have no idea what to do about it though as I don't even know where to begin looking. I'll take a quick peek at the crystal version of the page and see if that helps.

Any suggestions very much welcome :)

Posted

The following code is from the Schedules.php that I think relates to the adding of a bid.

/**
 * Schedules::addbid()
 *
 * @return
 */
   public function addbid() {
    if (!Auth::LoggedIn())
	    return;
    $routeid = $this->get->id;
    if ($routeid == '') {
	    echo 'No route passed';
	    return;
    }
    // See if this is a valid route
    $route = SchedulesData::findSchedules(array('s.id' => $routeid));
    if (!is_array($route) && !isset($route[0])) {
	    echo 'Invalid Route';
	    return;
    }

The bit that says "no route passed", looks like it shows this when the script can't find an ID in the database. So if it works in crystal but not in my custom skin it makes me think a couple of things:

  1. Can phpvms not retrieve the info from the database because some code is missing on my skin page? (looking at both the crystal layout page and mine but I can't see anything obvious)
  2. Is there a problem in the route info in the database? (don't think its this else the crystal skin would have the same problem)

Completely baffled, but then that's not saying much :)

  • Moderators
Posted

Ah ok, so the tutorial in skinning needs updating to reflect the differences. So I will continue with things as php files and see how I get on.

Thanks for the advice. :)

Skinning in the php extension is dev only, the release version still used .tpl

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