Page 3 of 3

Posted: Mon May 05, 2008 7:01 pm
by Klemen
Ok, this should work then:

Code: Select all

$content.='<!--#include virtual="../footer.txt" -->';
Note that file has been changed to virtual

Posted: Mon May 05, 2008 7:23 pm
by Henrie
That will probably also not work. I did some looking around.

<!--#include file="included.html" -->

The format above will create an SSI that will include the text found in the file "included.html".

You use "file=" when the file that will be included is held within the same directory as the file that is calling for it. You can also use the file argument when the file is within a subdirectory of the directory containing the file that is calling for it.


<!--#include virtual="/directory/included.html" -->

You would use the virtual argument if the file you are calling for is located in a position requiring an address starting at the server root. That's an academic way of saying the file isn't in the same directory as the page that's calling for it.
That forward slash before the first directory is representative of the domain name (server root). By using that leading slash, the server will add the domain name to the front of the address for you.

So ../ will also not work when using virtual. You will have to add the path starting from the server root.

Greetings,
Henrie

Posted: Mon May 05, 2008 7:43 pm
by Klemen
virtual="../footer.txt" works on my server, give it a go :wink:

Posted: Mon May 05, 2008 7:55 pm
by Henrie
I just tested some more.
At home on my localhost webserver (aprelium under windows) ../ did not work. Online at a linux server (apache) ../ did work.
So i guess it depends on the webserver that is used.

But the online documentation says dat virtual needs a path from the base directory of the webserver.

Greetings,
Henrie

Posted: Tue May 06, 2008 11:38 am
by icepack
i believe i'm on redhat-linux so your suggestion is to change:

$content.=$footer;

to

$content.='<!--#include virtual="../footer.txt" -->';

am i right in thinking it will use the footer from my root directory, i.e. http://www.mydomain.com/footer.txt

so if i wanted to use a footer stored in a folder named mboard, i should use something like http://www.mydomain.com/mboard/footer.txt

will give it a go then!

Posted: Tue May 06, 2008 1:39 pm
by Klemen
Use $content.='<!--#include virtual="../footer.txt" -->'; and it should use your MBoard footer.txt (note that messages are in a lower folder, mboard/msg).

Just give it a try and see what happens.

Posted: Wed May 07, 2008 2:42 pm
by icepack
you guys are absolutely spendid! i did it for my header too, and it's all working like a dream. thanks! you're both pure genuis!!! :D thanks!!!

this is a bit off topic, but klemen, with regard to the image upload i bought of you, when do you think you'll be able code it so removal of the images occurs when the post is deleted?