Simple Machines Community Forum

SMF Support => SMF 2.0.x Support => Topic started by: Metal_13 on March 20, 2008, 10:36:11 PM

Title: easy way to integrate theme?
Post by: Metal_13 on March 20, 2008, 10:36:11 PM
how do i integrate my SMF2 with an html page? is there an easy way to do this? i tried to do iframe but it sux...
anyone? pls...
Title: Re: easy way to integrate theme?
Post by: Oldiesmann on March 20, 2008, 11:09:50 PM
http://www.simplemachines.org/community/ssi_examples.shtml

Just save the page as .shtml and use the code from the ssi_examples page to include various SMF functions wherever you want them.
Title: Re: easy way to integrate theme?
Post by: Metal_13 on March 21, 2008, 12:29:36 AM
hmmm...usefull but... i want to insert the forum on an html page.... or like put smf on my site's default template /design
Title: Re: easy way to integrate theme?
Post by: rsw686 on March 21, 2008, 10:16:41 AM
Then you need to make a theme for SMF. Add your websites header and footer into the theme code and you can integrate it nicely.
Title: Re: easy way to integrate theme?
Post by: Owdy on March 21, 2008, 10:24:43 AM
Make test.php and put it in your main site. In test.php, try something like this:


<?php
$ssi_gzip 
true;
$ssi_ban true;
$ssi_layers = array('html''body');
$context['page_title'] = 'Cool test page!!';
ob_start();
$ssi = include('/path/to/your/smf/SSI.php');

if (!
$ssi)
   {
   echo 
'Server seems busy or down. Please try again later.';
   die;
}
?>



Own stuff here. It works!


<?php
ssi_shutdown
();
?>



If you wanna use certain theme, ad this in second line
$ssi_theme = '1';
Change that '1' to your themes id number.

What that code above does? It prints out your forums header and footer in page and you can add your own stuff between those. It also add forum bans and gzip to that page. Try it :)
Title: Re: easy way to integrate theme?
Post by: metallica48423 on April 04, 2008, 03:49:23 AM
I'd reccommend editing index.template.php to add your site's 'wrapper' to it.  I normally stick the relevant code in a file such as header.php and footer.php and include those where appropriate.
Title: Re: easy way to integrate theme?
Post by: Nigel on April 04, 2008, 07:26:17 AM
Hi Metal13,

I don't like iframes either  >:(

I'm trying to do much the same myself and I'm sort of doing it like Metallica said. In 'index.template.php', after the global declarations at the start of 'function template_body_above()', I echoed the HTML that I use at the top of my web pages (divs, etc). Then at the end I echoed my footer HTML plus closing division tags. I also added my CSS file.

It's a start but there's loads of scope for tidying things up.

Nigel
Title: Re: easy way to integrate theme?
Post by: metallica48423 on April 05, 2008, 02:22:30 AM
indeed. 

Its generally probably the easiest way to do it AND not break things.  Advantage is there that its loaded globally throughout the forum, allowing for the actual page content to change without worry of breaking the page layout.