Advertisement:

Author Topic: Need SSI Help Please.  (Read 33318 times)

Offline rsderrick

  • Semi-Newbie
  • *
  • Posts: 13
Need SSI Help Please.
« on: August 14, 2009, 12:21:00 AM »
Hi Everyone,

First off I"m NOT a coder and am not good at pretending to be. I appreciate any help someone could give me.

I am trying to add recent threads from smf to my webpage. I've followed the directions (as best I  could) from various boards and had no luck. Probably because I'm not doing it correctly.

Here is my website. Notice the red block about halfway down the page. That is the error I'm getting. http://www.3d-mafia.com/master_template.shtml [nofollow]

I've inserted the code for shtml type sites:

This is what I have above the head:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "hxxp:www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd [nonactive]">
<?php require("/path/to/forum/SSI.php"); ?>
<html xmlns="hxxp:www.w3.org/1999/xhtml [nonactive]">
<head>

This is what I have in the box called "Recent Forum Posts":

<!--#include virtual="./SSI.php?ssi_function=recentPosts" -->

Can someone tell me what I'm missing?


Offline Arantor

  • Resident Overthinker
  • SMF Friend
  • SMF Legend
  • *
  • Posts: 68,041
    • Arantor on GitHub
Re: Need SSI Help Please.
« Reply #1 on: August 14, 2009, 03:23:36 AM »
If you have SSI.php included in regular PHP at the top of the page, you don't need to use the SHTML declaration.

You should be able to just replace that <!--#include --> with:

Code: [Select]
<?php ssi_recentPosts(); ?>
To assume is to hope that those who came before had the presence of mind and capacity to implement the dreams of those who would come after.

You either die a hero or live long enough to see yourself become the villain. It seems you have chosen which, and now I must do the same.

Offline rsderrick

  • Semi-Newbie
  • *
  • Posts: 13
Re: Need SSI Help Please.
« Reply #2 on: August 18, 2009, 06:04:36 PM »
OK...this is really strange. I did as you said and saved the file. When I FTP'ed it up to the server I got nothing. I looked at the source behind the page I had just uploaded and it didn't have any of the code in the page. I double checked the page to make sure it was saved in Dreamweaver and it was. I then deleted and uploaded again and still nothing. I'm going to upload the file here. Can someone take a look at it at tell me what I'm doing wrong please.

Thanks in advance.

Offline Kays

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 8,973
  • Gender: Male
    • Kayssplace
Re: Need SSI Help Please.
« Reply #3 on: August 18, 2009, 09:21:55 PM »
That's a shtml page and unless you've got it set to parse php, what you have won't work.

Remove that php include statement at the top. Then where you want the recent posts to appear, remove the php line there and add the following:

<!--#include virtual="forum/SSI.php?ssi_function=recentPosts" -->

If this page isn't at the root of your site , then you'll need to change the path to SSI.php

If at first you don't succeed, use a bigger hammer. If that fails, read the manual.
My Mods

Offline rsderrick

  • Semi-Newbie
  • *
  • Posts: 13
Re: Need SSI Help Please.
« Reply #4 on: August 20, 2009, 10:01:52 PM »
Kays

Thanks so very much for the solution. It is working great. I'm not a programmer and truly don't pretend to be very well. It's great people like you that are helping broaden my knowledge. I appreciate your help.

Offline Kays

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 8,973
  • Gender: Male
    • Kayssplace
Re: Need SSI Help Please.
« Reply #5 on: August 21, 2009, 12:41:37 PM »
Glad I could help. :)

My suggestion would be not to use shtml and try to use php pages instead. There's a lot more which you can do with php than with shtml.

If at first you don't succeed, use a bigger hammer. If that fails, read the manual.
My Mods