Page 1 of 1

include HTML file in template file

Posted: Sun Mar 22, 2009 12:13 am
by msp_erv
i need to include an html file into bulletproof template

and am failing on all fronts

things that should work do not

Code: Select all

{php}
include ("/full/server/path/to/file/counter.html")
{/php}

{include file='/("/full/server/path/to/file/counter.html'}

{include file='/counter.html'}

{include file='counter.html'}

i have even tried to include the counter file directly....

[code]{include virtual='/full/server/path/to/file/_stats/counter.cgi?site=cptr'}

{include file='/full/server/path/to/file/_stats/counter.cgi?site=cptr'}
[/code]

i will be using a stats app locally that uses an SSI include that is parsed in an html file

we have been using this successfully in PHP sites for years with an addhandler in htaccess and this simple php tag

Code: Select all

<?php



  virtual ("/counter.html");

?>
so far i am unable to include this into the app...

i am working with inded.tpl from the bulletproof dir - and get errs...
Warning: Smarty error: unable to read resource: "html/counter.html" in ("/full/server/path/to/file/bundled-libs/Smarty/libs/Smarty.class.php on line 1092
how can i get this html file pulled into the app?

ultimately this is what will get parsed as html as thsi wi8ll be the contents of counter.html

Code: Select all

<!--#include virtual="/_webshop101Stats/counter.cgi?site=041"-->
thoughts?

Re: include HTML file in template file

Posted: Sun Mar 22, 2009 2:29 am
by msp_erv
my eyes hurt frm staring at this dam monitor an dproblem for way too long...

ok...

here is the poor boy solution if any one else ever needs to run cgi or server parsed html inside this blog...

i wound up usinng and iframe to call my html file that holds my SSI call

the heck with it....

here it is for anyone that can use this

Code: Select all

<!--[if IE]>
<iframe align="middle" scrolling="no" frameborder="0" height="3" width="20" src="http://www.yourniftywebsite.com/counter.html"></iframe>
<!--[if !IE]>
<iframe align="middle" scrolling="no" frameborder="0" height="3" width="20" src="http://www.yourniftywebsite.com.com/counter.html"></iframe>
<![endif]-->
  

Re: include HTML file in template file

Posted: Sun Mar 22, 2009 2:43 am
by msp_erv
this iframe is catching only local referrals...

i would be most greaeful if someone could please point to a way for me to do this without iframes

thank you very much

Re: include HTML file in template file

Posted: Sun Mar 22, 2009 11:30 am
by yellowled
msp_erv wrote:i need to include an html file into bulletproof template
Do you actually need to include the file or would it suffice to include its content? BP offers a theme option for that.

YL

Re: include HTML file in template file

Posted: Tue Mar 24, 2009 6:27 pm
by msp_erv
many thanks

...content....

this is what i need here... in one form or another -- the virtual call of the actual cgi counter script

Code: Select all

<!--#include virtual="/_webshop101Stats/counter.cgi?site=041"-->
failing miserably!

Re: include HTML file in template file

Posted: Tue Mar 24, 2009 6:58 pm
by msp_erv
found this ---

looking to see if this will help any where...

http://board.s9y.org/viewtopic.php?f=1&t=3851&hilit=SSI

Re: include HTML file in template file

Posted: Wed Mar 25, 2009 3:48 pm
by judebert
I'd try {include file='that_script_url'}. I'm not sure it would work, but it's possible.

Does the script return a graphic? That would get it called. Or is it just a link that needs to be clicked to be activated?

Re: include HTML file in template file

Posted: Wed Mar 25, 2009 4:36 pm
by msp_erv
the script can be used 2 ways -- with 'image' thsi will not count outside referrs -- bad

and the virtual include that is the intended way-- later today i will try to tweeek the cfg file to allow the php include and report back

thanks

Re: include HTML file in template file

Posted: Wed Mar 25, 2009 4:40 pm
by judebert
Simply including the line as you originally typed it into the index.tpl should include the file -- IF your server is set up correctly.

Here is some documentation on Server Side Includes that might help you:
http://en.wikipedia.org/wiki/Server_Side_Includes
http://httpd.apache.org/docs/1.3/howto/ssi.html

Re: include HTML file in template file

Posted: Wed Apr 15, 2009 5:58 am
by daniello
yellowled wrote:
msp_erv wrote:i need to include an html file into bulletproof template
Do you actually need to include the file or would it suffice to include its content? BP offers a theme option for that.

YL
Hi Yellowled .. could you clarify .. which option exactly you mean? I edited the template and put the content directly there .. maybe there is a better way.

br
Daniello

Re: include HTML file in template file

Posted: Wed Apr 15, 2009 10:25 am
by yellowled
daniello wrote:could you clarify .. which option exactly you mean?
As a matter of fact, the theme option to include text in the footer can also be used to include HTML or JS in the footer. This is sometimes an easy way out to include counter scripts etc.

YL