Simple Machines Blogs > Developers' Blog
Simple Machines Website-Forum Integration
cyberox:
Does anyone have a working sample zip file for this?
I've followed each step; but still cannot integrate custom pages into smf.
Daniel15:
--- Quote from: cyberox on May 29, 2007, 05:35:32 PM ---Does anyone have a working sample zip file for this?
I've followed each step; but still cannot integrate custom pages into smf.
--- End quote ---
To add a page "into" SMF, try this code in a seperate PHP file:
--- Code: ---<?php
error_reporting(E_ALL);
// Theme we're going to use
$ssi_theme = 4;
// Layers we're going to use
$ssi_layers = array('main');
// Enable GZip compression (saves bandwidth)
$ssi_gzip = true;
require('SSI.php');
echo 'See? SMF is cool :)';
ssi_shutdown();
?>
--- End code ---
You'll need to change the $ssi_theme = 4 line to the correct theme ID.
lwjuan:
I do not know about php scripting.. So is it i have to create a new php file and copy the above content and edit some and upload to the server then it'll work?
Thantos:
To be honest, if you don't understand programming/scripting then my files will most likely be more then you need.
Daniel15:
--- Quote from: lwjuan on June 07, 2007, 10:02:11 PM ---I do not know about php scripting.. So is it i have to create a new php file and copy the above content and edit some and upload to the server then it'll work?
--- End quote ---
As Thantos said, his post is mainly aimed towards PHP developers...
I'd suggest to use my code above (or rather, a slightly modified version of it):
--- Code: ---<?php
error_reporting(E_ALL);
// Theme we're going to use
$ssi_theme = 4;
// Layers we're going to use
$ssi_layers = array('main');
// Enable GZip compression (saves bandwidth)
$ssi_gzip = true;
require('SSI.php');
?>
Put your HTML content here!
<?php
ssi_shutdown();
?>
--- End code ---
I guess the easiest way is to create two new files: header.php, and footer.php.
header.php:
--- Code: ---<?php
error_reporting(E_ALL);
// Theme we're going to use
$ssi_theme = 4;
// Layers we're going to use
$ssi_layers = array('main');
// Enable GZip compression (saves bandwidth)
$ssi_gzip = true;
require('SSI.php');
?>
--- End code ---
footer.php:
--- Code: ---<?php
ssi_shutdown();
?>
--- End code ---
Then, in a new PHP file (name it whatever you want):
--- Code: ---<?php require('header.php'); ?>
Your HTML stuff would go here!<br />
etc etc etc.
<?php require('footer.php'); ?>
--- End code ---
This is not really the best way, but it's the easiest way for non-programmers to achieve a good result :)
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version