News:

SMF 2.1.4 has been released! Take it for a spin! Read more.

Main Menu

[Walkthrough] SSI-Not-Working Solution

Started by TheGamer, July 06, 2006, 03:15:56 AM

Previous topic - Next topic

TheGamer

A few of you (including me) cannot get SSI php to work no matter what you do. Having to do with the fact that the location you wish to display SSI on is in a parent directory to SMF's base directory, and for some reason it cannot connect to smfdir/SSI.php.

Well here is a solution that I thought up and have been using. Its not real fancy but it works. View www.gamerunlimited.com for example. You cannot tell the difference between my method and the original, correct SSI method, it's just a lot more work to get it to display that way.

Ok. What you'll want to do is make a .php file for every SSI entry you want. So if you would like a recent posts SSI entry, you'd want to make a new .php document and give it the following structure: (Edit in Notepad or text editor)

<html>
<head>
<title>SSI</title>
</head>
<body>
</body>
</html>


Now go to your SMF directory /ssi_examples.php

Before <html> paste the code it gives you. It should be something like

<?php require("/home/httpd/vhosts/gamerunlimited.com/httpdocs/smf/SSI.php"); ?>

Now scroll down through the rest of /ssi_examples.php, if you wanted to display the most recent posts for instance, you would paste

<?php ssi_recentPosts(); ?>

after <body>, but before </body>

Now, for the important part... Save this file as "recentposts.php" or something to that extent, and upload it to your SMF directory.

Now, back to where you wanted to display the SSI in the first place. Paste the following code where you wanted your SSI recent posts to be. Remember to change yourdomain.com to your domain, and more importantly, SMFDIR to the name of your SMF directory.

<?php include ("http://www.yourdomain.com/SMFDIR/recentposts.php"); ?>

Now it should display the SSI just how it's intended to be!

This is a long, boring, and, sorry, but sucky process to have to take to display an SSI entry, but its well worth it for me. As for the reason some people cannot get SSI working, I'm not entirely sure, but it probably has to do with your webhost.

I hope this little walkthrough is helpful to everyone who needs it.

Repeat this process again for other SSI entries like recentpoll. Remember to save the file as recentpoll.php and upload it to your SMF directory. Don't accidently overwrite recentposts.php ;)

Trekkie101

try
<?php require("smf/SSI.php"); ?> 

The solution you use make break a few things

TheGamer

The solution I use will break the ability for the users online to log your presence, however, when using smf/recentposts.php, it does not work.

Advertisement: