Welcome Guest ( Log In | Register )



 
Reply to this topicStart new topic
> Instructions For Using The SSI Scripts For SMF, Inserting SMF Modules In Non-Forum Pages
vujsa
post Jul 22 2005, 02:02 PM
Post #1


Absolute Newbie
Group Icon

Group: Admin
Posts: 887
Joined: 20-February 05
From: Indianapolis, Indiana, USA (Midwest)
Member No.: 2,714



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
Go to the top of the page
 
+Quote Post
Trekkie101
post Jul 22 2005, 02:22 PM
Post #2


Teh Teckeh Trekkeh
Group Icon

Group: Members
Posts: 682
Joined: 8-September 04
From: Scotland, UK
Member No.: 389



You can change where it redirects,

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

smile.gif
Go to the top of the page
 
+Quote Post
Logan Deathbring...
post Jul 25 2005, 05:47 AM
Post #3


Geek in-training
Group Icon

Group: Members
Posts: 301
Joined: 2-July 05
From: Washington State, USA, 3rd Rock from the Star Sol
Member No.: 6,772



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

home = home -or- home = panda?
Go to the top of the page
 
+Quote Post
Trekkie101
post Jul 25 2005, 10:30 AM
Post #4


Teh Teckeh Trekkeh
Group Icon

Group: Members
Posts: 682
Joined: 8-September 04
From: Scotland, UK
Member No.: 389



home = home smile.gif
Go to the top of the page
 
+Quote Post
Logan Deathbring...
post Jul 25 2005, 07:10 PM
Post #5


Geek in-training
Group Icon

Group: Members
Posts: 301
Joined: 2-July 05
From: Washington State, USA, 3rd Rock from the Star Sol
Member No.: 6,772



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!
Go to the top of the page
 
+Quote Post
vujsa
post Jul 28 2005, 01:42 AM
Post #6


Absolute Newbie
Group Icon

Group: Admin
Posts: 887
Joined: 20-February 05
From: Indianapolis, Indiana, USA (Midwest)
Member No.: 2,714



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
Go to the top of the page
 
+Quote Post
Logan Deathbring...
post Jul 28 2005, 06:39 PM
Post #7


Geek in-training
Group Icon

Group: Members
Posts: 301
Joined: 2-July 05
From: Washington State, USA, 3rd Rock from the Star Sol
Member No.: 6,772



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.
Go to the top of the page
 
+Quote Post

Reply to this topicStart new topic

Collapse

> Similar Topics

Topics Topics
  1. How To Install SMF(5)


 



- Lo-Fi Version Time is now: 5th September 2008 - 12:40 PM