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...
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.
hmmm...usefull but... i want to insert the forum on an html page.... or like put smf on my site's default template /design
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.
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 :)
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.
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
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.