Nov 25, 2009

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

free web hosting
Open Discussion & Free Web Hosting > Computers & Tech > Software > Bulletin Board Systems > Simple Machines Forum

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

vujsa
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:
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"); ?>
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:
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. cool.gif

vujsa

 

 

 


Comment/Reply (w/o sign-up)

Trekkie101
You can change where it redirects,

eg. ssi_login() can become ssi_login('http://address.com')

smile.gif

Comment/Reply (w/o sign-up)

Logan Deathbringer
now when it the code says: "/home/username/public_html/forum"

home = home -or- home = panda?

Comment/Reply (w/o sign-up)

Trekkie101
home = home smile.gif

Comment/Reply (w/o sign-up)

Logan Deathbringer
Ok here is how I got it to work:

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!

Comment/Reply (w/o sign-up)

vujsa
Logan,

I'm glad it worked out for you. It's funny that the biggest problem you had was resetting your IP address. LOL laugh.gif

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

vujsa

 

 

 


Comment/Reply (w/o sign-up)

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

Comment/Reply (w/o sign-up)

(G)needhelp
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

Comment/Reply (w/o sign-up)

(G)nedd
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.

-question by nedd

Comment/Reply (w/o sign-up)


Got an Opinion! Express your Views! (no registration):-
Add your Reply/ Opinion/ Views/ Comments/ Suggestion/ Questions/ Queries etc.
Posts with decent grammar & English will be accepted and please refrain from profanities.
For asking a Question, We recommend you to sign-up (for free) so that you can track the topic easily.

Nature of your Post*: Opinion/ Reply/ Comments
Question/Query
Feedback to us.
       
Name   Email
Title/Question*

This textarea will convert to Rich-Text automatically (IE, Firefox, Chrome)


See Also,

*SIMILAR VIDEOS*
Searching Video's for instructions, ssi, scripts, smf, inserting, smf, modules, forum, pages
advertisement



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

Affordable Web Hosting, Low cost Web Hosting - ComputingHost.com