Advertisement:

Author Topic: SSI Within a Template?  (Read 23240 times)

Offline Overseer

  • Sr. Member
  • ****
  • Posts: 746
  • Gender: Male
    • dubcc.com - West Coast Connection Forum
SSI Within a Template?
« on: August 06, 2003, 05:48:50 AM »
I hope to use SSI to include some custom scripts in my template... for 3 purposes

1) a randomised section for adverting my affils. they each get a short text description/a small banner/ and a link..

2) a news feed from my sister news site (it will have an rss feed when they're done writing the scripts..) (i know i cant SSI from outside my domain)

3) an advertising banner script (so i only have to change this to update adverts, and not every page on the site)


So far i've done a little investigation with SSI.. seems like the pages have to be called .shtml to get it to work. and other than that i'm pretty much lost.. for now.

Offline ۞

  • Jr. Member
  • **
  • Posts: 340
  • Gender: Male
  • I dont know what to put here, I'll leave it blank.
Re:SSI Within a Template?
« Reply #1 on: August 06, 2003, 05:55:58 AM »
With YSE you could use php in the template to the same effect:

Code: [Select]
<? include('mypage.html'); ?>

I'm guessing it will be the same with SMF :)
TTTTTT  OOOOOO MMMMMM   BBBBBB


Offline Overseer

  • Sr. Member
  • ****
  • Posts: 746
  • Gender: Male
    • dubcc.com - West Coast Connection Forum
Re:SSI Within a Template?
« Reply #2 on: August 06, 2003, 06:01:58 AM »
cool thx, sounds real easy  :D

the only thing i now see 'issues' with now is how to get the output from the news on the other site onto my board.


is it possible to write a php script that 'copies' the page returned from a script (also php, but i guess that doesnt really matter) running on the other site  as the output from the local script?

(so basically a page, i know i can query the scripts on the other site with parameters, they're being custom written by a firend)

Offline ۞

  • Jr. Member
  • **
  • Posts: 340
  • Gender: Male
  • I dont know what to put here, I'll leave it blank.
Re:SSI Within a Template?
« Reply #3 on: August 06, 2003, 06:24:11 AM »
Anything is possible :P
TTTTTT  OOOOOO MMMMMM   BBBBBB


Offline alienine

  • SMF Friend
  • Sophist Member
  • *
  • Posts: 1,093
  • Gender: Male
  • Why would you say that?
Re:SSI Within a Template?
« Reply #4 on: August 06, 2003, 06:29:32 AM »
If it was I'd be swimming in red wine with naked women all around me... don't you say anything is possible.....

Offline vincent

  • Semi-Newbie
  • *
  • Posts: 70
  • Gender: Male
  • Don't believe what you see...
Re:SSI Within a Template?
« Reply #5 on: August 06, 2003, 06:36:14 AM »
Even THAT is possible alienine...
Life is what happens to you while you're busy making other plans - John Lennon

Offline alienine

  • SMF Friend
  • Sophist Member
  • *
  • Posts: 1,093
  • Gender: Male
  • Why would you say that?
Re:SSI Within a Template?
« Reply #6 on: August 06, 2003, 06:46:21 AM »
ok true.. I said that in the hope a winery run by about 20 beautiful women would read my post and try and prove me wrong

Offline Overseer

  • Sr. Member
  • ****
  • Posts: 746
  • Gender: Male
    • dubcc.com - West Coast Connection Forum
Re:SSI Within a Template?
« Reply #7 on: August 06, 2003, 06:47:12 AM »
LOL... back on topic.... how?  ;D

something like the following - lol

---
$output  = readpage( "http://www.sistersite.com/news.php?style=simplenews;stories=3;justheadlines=1" );

echo $output
------

Offline alienine

  • SMF Friend
  • Sophist Member
  • *
  • Posts: 1,093
  • Gender: Male
  • Why would you say that?
Re:SSI Within a Template?
« Reply #8 on: August 06, 2003, 06:54:44 AM »
is it just me or you don't need to use SSI just like 10 lines (max) of php code?

Offline Overseer

  • Sr. Member
  • ****
  • Posts: 746
  • Gender: Male
    • dubcc.com - West Coast Connection Forum
Re:SSI Within a Template?
« Reply #9 on: August 06, 2003, 08:59:05 AM »
for which part?

it certain seems its not strictly ssi now...

and since its not.. does the 'not outside your domain' rule apply?


Offline alienine

  • SMF Friend
  • Sophist Member
  • *
  • Posts: 1,093
  • Gender: Male
  • Why would you say that?
Re:SSI Within a Template?
« Reply #10 on: August 06, 2003, 09:33:08 AM »
depending on your hosts php config you can do anything from loading up other people's pages to running your house.

Offline Overseer

  • Sr. Member
  • ****
  • Posts: 746
  • Gender: Male
    • dubcc.com - West Coast Connection Forum
Re:SSI Within a Template?
« Reply #11 on: August 06, 2003, 09:52:31 AM »
ok well assuming my host will let me run my house what do I call to load up someone elses page and spit it out as my scripts output?

Offline ۞

  • Jr. Member
  • **
  • Posts: 340
  • Gender: Male
  • I dont know what to put here, I'll leave it blank.
Re:SSI Within a Template?
« Reply #12 on: August 06, 2003, 10:09:34 AM »
You should be able to just use <? include('http://url.com/to/page.html'); ?>
TTTTTT  OOOOOO MMMMMM   BBBBBB


Offline Overseer

  • Sr. Member
  • ****
  • Posts: 746
  • Gender: Male
    • dubcc.com - West Coast Connection Forum
Re:SSI Within a Template?
« Reply #13 on: August 06, 2003, 10:11:33 AM »
sweeeeeeeet  ;D

i've got full access to the other site.. back with results later!

Offline Overseer

  • Sr. Member
  • ****
  • Posts: 746
  • Gender: Male
    • dubcc.com - West Coast Connection Forum
Re:SSI Within a Template?
« Reply #14 on: August 06, 2003, 04:09:55 PM »
ok i've done it.

you cant use <? include('mypage.html'); ?>  to include a page on a remote site.

here is my script...

<?
echo "<!doctype html public \"-//W3C//DTD HTML 4.0 Transitional//EN\"><html>";
echo "<br>~inctest~<br>";
include 'local.php';
echo "<br>";
$target = "http://www.anothersite.com/remote.php";
$html = implode ('', file ( $target ));
echo $html

?>
 


remote.php contains...

<?
echo "remote";
?>

local.php contains...

<?
echo "local";
?>



kinda cool.. i'm ggonna have to do some additions for 1)errors loading and that kinda thing.. but that should be too much hassle!

Offline [Unknown]

  • SMF Friend
  • SMF Master
  • *
  • Posts: 36,102
  • Gender: Male
Re:SSI Within a Template?
« Reply #15 on: August 06, 2003, 07:26:00 PM »
I'd just like to say: there are reasons why you can't use SSI in a template, namely that it's parsed 100% by PHP.  Instead, you should use PHP like these people have told you.

Second rss is done by SMF ;).

-[Unknown]

Offline Overseer

  • Sr. Member
  • ****
  • Posts: 746
  • Gender: Male
    • dubcc.com - West Coast Connection Forum
Re:SSI Within a Template?
« Reply #16 on: August 07, 2003, 05:10:10 AM »
cool... I might have to do it this way for now, and switch to .rss later when the new scripts for that site are done. right now its using 'newspro' (flat file perl news system with no rss support).