Jump to content
xisto Community
vujsa

Instructions For Using The SSI Scripts For SMF Inserting SMF Modules In Non-Forum Pages

Recommended Posts

Recently I received a request for help adding the SMF Ultimate Shout Box Modification on a static HTML page. While there are other matbe even better ways to add the shout box from the forum to the rest of your website, this is the quickest and easiest.

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:

<!--#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:

<?php require("/home/username/public_html/forum/SSI.php"); ?>
This line needs only be added one time per file no matter how many SMF functions are used in the file.

 

Second, add the following code in youe file where you want the SMF content to be displayed:

<?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 domain or domain.

 

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

Share this post


Link to post
Share on other sites

Ok here is how I got it to work:

first on line one I inserted this:

<?php require("/home/username/public_html/guild_forum/SSI.php"); ?>


I inserted this where I wanted the shoutbox to be shown on my index page

<?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!

Share this post


Link to post
Share on other sites

Logan, 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. :Pvujsa

Share this post


Link to post
Share on other sites

Vujsa, Trekkie...as always thx for the help...changed up the way I SSI'd the shout to my index page.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.

Share this post


Link to post
Share on other sites

how to change design of ssi.php function?

Instructions For Using The SSI Scripts For SMF

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 needhelp

Share this post


Link to post
Share on other sites

how to change design of ssi.php function?

Instructions For Using The SSI Scripts For SMF

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 nedd

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.