Advertisement:

Author Topic: easy way to integrate theme?  (Read 4730 times)

Offline Metal_13

  • Jr. Member
  • **
  • Posts: 126
    • Pinoytambay.com
easy way to integrate theme?
« 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...

Offline Oldiesmann

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 24,920
  • Gender: Male
  • Ask me about the function DB :)
    • oldiesmann on Facebook
    • Oldiesmann on GitHub
    • https://www.linkedin.com/in/michaeleshom on LinkedIn
    • @oldiesmann on Twitter
    • Archie Comics Fan Forum
Re: easy way to integrate theme?
« Reply #1 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.
Michael Eshom
Cincy Space - now open!

Offline Metal_13

  • Jr. Member
  • **
  • Posts: 126
    • Pinoytambay.com
Re: easy way to integrate theme?
« Reply #2 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

Offline rsw686

  • Sophist Member
  • *****
  • Posts: 1,008
    • The Reptile File
Re: easy way to integrate theme?
« Reply #3 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.
The Reptile File
Everything reptile for anyone reptile friendly

Aquaria Talk
Community for freshwater and saltwater aquariums enthusiasts

Offline Owdy

  • SMF Fossil
  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 15,641
  • Gender: Male
  • W00t!
    • janoloferiksson on LinkedIn
    • @jaoler on Twitter
Re: easy way to integrate theme?
« Reply #4 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:

Code: [Select]
<?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
Code: [Select]
$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 :)
« Last Edit: March 21, 2008, 10:31:18 AM by Owdy »
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

Offline metallica48423

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 19,842
  • Gender: Male
  • Professional Multislacker!
    • Zentendo
Re: easy way to integrate theme?
« Reply #5 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.
Justin O'Leary
Ex-Project Manager
Ex-Lead Support Specialist

Quote
Microsoft 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
     

Offline Nigel

  • Jr. Member
  • **
  • Posts: 184
Re: easy way to integrate theme?
« Reply #6 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

Offline metallica48423

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 19,842
  • Gender: Male
  • Professional Multislacker!
    • Zentendo
Re: easy way to integrate theme?
« Reply #7 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.
Justin O'Leary
Ex-Project Manager
Ex-Lead Support Specialist

Quote
Microsoft 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