News:

SMF 2.1.4 has been released! Take it for a spin! Read more.

Main Menu

easy way to integrate theme?

Started by Metal_13, March 20, 2008, 10:36:11 PM

Previous topic - Next topic

Metal_13

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

Oldiesmann

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.
Michael Eshom
Christian Metal Fans

Metal_13

hmmm...usefull but... i want to insert the forum on an html page.... or like put smf on my site's default template /design

rsw686

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.
The Reptile File
Everything reptile for anyone reptile friendly

Aquaria Talk
Community for freshwater and saltwater aquariums enthusiasts

Owdy

#4
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 :)
Former Lead Support Specialist

Tarvitsetko apua SMF foorumisi kanssa? Otan työtehtäviä vastaan, lue:http://www.simplemachines.org/community/index.php?topic=375918.0

metallica48423

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.
Justin O'Leary
Ex-Project Manager
Ex-Lead Support Specialist

QuoteMicrosoft wants us to "Imagine life without walls"...
I say, "If there are no walls, who needs Windows?"


Useful Links:
Online Manual!
How to Help us Help you
Search
Settings Repair Tool

Nigel

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

metallica48423

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.
Justin O'Leary
Ex-Project Manager
Ex-Lead Support Specialist

QuoteMicrosoft wants us to "Imagine life without walls"...
I say, "If there are no walls, who needs Windows?"


Useful Links:
Online Manual!
How to Help us Help you
Search
Settings Repair Tool

Advertisement: