|
|
Instructions For Using The SSI Scripts For SMF - Inserting SMF Modules In Non-Forum Pages | ||
Discussion by vujsa with 8 Replies.
Last Update: December 27, 2008, 4:50 pm | |||
Overview Of The SMF SSI Script:
The included SSI script for SMF allows several of the forum modules to be displayed on non-forum related pages such as static pages and non-SMF generated dynamic pages. This way you could display whatever your forum news is on any or all pages on your website with just a few lines of code. This is a great way to make your forum really fit in your website. There are 2 ways to use the SSI.php script, the SSI method and the PHP method.
Using The Sever Side Includes (SSI) Method:
If you are adding the included function (module) to an HTML file then you need only do a couple of things to make it work.
First, add the following line of code into your html file where you want to display the SMF content:
CODE
<!--#include virtual="./SSI.php?ssi_function=news" -->Be sure that your path is correct.
Second, rename your file's extention to .shtml - this will tell the server that you want to use the SSI feature with this file.
Using The PHP Method:
This requires a little more coding but works the same way. Easiest to use on php files because the file extention will not need to be changed.
First, add the following code to the top of the file, before the <html> tag:
CODE
<?php require("/home/username/public_html/forum/SSI.php"); ?>Second, add the following code in youe file where you want the SMF content to be displayed:
CODE
<?php ssi_news(); ?>Third, change the file extention of your file to .php if it isn't already a PHP file.
For more information about which SMF functions can be displayed using the SSI.php script, point your browser to either www.domain_name.com/forum/ssi_examples.php or www.domain_name.com/forum/ssi_examples.shtml.
These files will display all of the included functions as well as the code required to display the content.
The only downside to these functions is that most links that they generate will lead back to the forum so trying to shout from your directory page will redirect you to the forum index where your shout will then be displayed.
Keep in mind that different versions of SMF usually have different versions of SSI.php.
Hope this help everyone out.
Happy Including.
vujsa
Fri Jul 22, 2005 Reply New Discussion
eg. ssi_login() can become ssi_login('http://address.com')
Fri Jul 22, 2005 Reply New Discussion
home = home -or- home = panda?
Mon Jul 25, 2005 Reply New Discussion
Mon Jul 25, 2005 Reply New Discussion
first on line one I inserted this:
CODE
<?php require("/home/username/public_html/guild_forum/SSI.php"); ?>[/CODE
next I inserted this where I wanted the shoutbox to be shown on my index page:
[CODE]<?php ssi_shout(); ?>
Then I changed the file extention to .php and it works.
Its exactly how you told me to do it but I changed the _news to _shout and it works...yes!
I'm as giddy as a kid at cristmas with a new toy...whoohoo this is cool and all the help ya'll are giving me is sweet...thx again!
Mon Jul 25, 2005 Reply New Discussion
I'm glad it worked out for you. It's funny that the biggest problem you had was resetting your IP address. LOL
One of the reasons I chose the NEWS example was because many people like to add news to their front page. But all of the SSI's are pretty much the same. For example, you can have your board statistics show or the title of your newest topic.
Another nice feature for small community forums is to have who's online listed on the front page. That way you know as soon as you come to the site which of your friends is already their.
In addition to all of the SMF SSI functions that are availible, PHP allows for all type of file inclusions. So not only could you add features from your forum to the rest of your site but you can add feature from the rest of the site to your forum.
Just write a file with whatever code you want to use and save it to your server. Then just use the same include function as above but change the path to your new file. The file could be anything; HTML, PHP, JavaScript, etc.
I like this kind of file inclusion for menus because menus change frequently and should look the same on every page. This allows for quick editing of the menu because only one file needs to be edited.
Happy Including.
vujsa
Thu Jul 28, 2005 Reply New Discussion
I used an IFRAME to call a HTML file that calls for the Shout SSI, a bit more complicated but I can further Customize the way the SSI_Shout is now shown on the index by doing it this way and also I can now increase or decrease the size of the shout box on my index to accomadate more or less content on the index.
Just thought I'd drop an update.
Thu Jul 28, 2005 Reply New Discussion
hello, I wanna integrate smf to my site, but I need to know how can I change for example maximum width for various functions displayed on my site.
-reply by needhelpSat Dec 27, 2008 Reply New Discussion
hello, I wanna integrate smf to my site, but I need to know how can IChange for example maximum width for various functions displayed on mySite.
-question by neddSat Dec 27, 2008 Reply New Discussion
SMF 1.1 Beta Released! Just released (24)
|
(2) SMF 1.1 Questions
|
Index




