News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

Displaying the Header / Footer in a costum PHP File

Started by Jason_Gregory, February 01, 2011, 05:43:48 PM

Previous topic - Next topic

Jason_Gregory

Hello Guys,

i got a question im trying to include my Boardheader and the Boardfooter
into a selfmade PHP Script, it has worked until ive updated my board
to the 2.0 RC4 Version. Now its returning a strange error.

Unable to load the 'main_above' template.

All my PHP Scripts except those who are using (including) the SSI header/footer functions
are working after the update.

footer.php
<?php
//Let's murder SSI for now
ssi_shutdown();
//[n3rve] thinks this should do.
?>



header.php
<?php
error_reporting(E_ALL);

// Which Theme are we using?
$ssi_theme 0;
// Layers to be utilized
$ssi_layers = array('main');
// Change "true" to "false" to disable Gzip if not supported on your server
$ssi_gzip true;
//This is the SSI.php file in the Board dir.
require('../../SSI.php');

?>


My questions:
1. Somebody know what is going wrong (as i said it worked with 1.1.2) ?
2. Is there a better / faster way to display the Forumsbanner & Header ?


- Thanks Jason


SlammedDime

2.0 doesn't have a main layer.  It has an html and body layer.  My preferred way of doing it is similar to the following...

<?php
require_once('SSI.php');
template_header();
// Insert some output here
template_footer();
SlammedDime
Former Lead Customizer
BitBucket Projects
GeekStorage.com Hosting
                      My Mods
SimpleSEF
Ajax Quick Reply
Sitemap
more...
                     

Jason_Gregory

Thanks god,

it worked. Thanks SlammedDime, may i ask you something else
before marking the topic as solved  ?
Is it possible to include the Tabcontrol Component of the Help Page
or something Themereleated from the using Template ? (like a Bar ?)

I couldnt find the ssi function in the ssi_example.html are there more
SSI Functions ?

Thanks Jason


SlammedDime

Once SSI is loaded, you can include any other template (loadTemplate()) and call any function from within those templates.
SlammedDime
Former Lead Customizer
BitBucket Projects
GeekStorage.com Hosting
                      My Mods
SimpleSEF
Ajax Quick Reply
Sitemap
more...
                     


Jason_Gregory

Hi,

now that im working with the Serverside Include Function template_header(); and template_footer();
i noticed that the body got a margin of 20px, heres the Page Url: hxxp:irace-team.net/Forum/MySQL/UserInformation.php?name=-=SOAD=- [nonactive]

Where can i modify the margin of these functions ?


Thanks Jason

SlammedDime

Those functions merely call the native SMF template functions, so if you want to modify the margin for those pages, your main forum will also be affected.  If you want to alter the margins, you'll likely need to look in style.css of your theme.
SlammedDime
Former Lead Customizer
BitBucket Projects
GeekStorage.com Hosting
                      My Mods
SimpleSEF
Ajax Quick Reply
Sitemap
more...
                     

Jason_Gregory

#7
Mhm...the main Forum-Margin is okay, currently set to 5%,
only those who are using the template_header() & fooder() functions
have a margin of 20px.

So i need to search for the functionnames in the SSI.php cause i
could not find a margin in the style.css with the value of 20px.


Thanks Jason

SlammedDime

SlammedDime
Former Lead Customizer
BitBucket Projects
GeekStorage.com Hosting
                      My Mods
SimpleSEF
Ajax Quick Reply
Sitemap
more...
                     

Jason_Gregory


Adish - (F.L.A.M.E.R)


Advertisement: