Categories > TinyButStrong general >

Add SSI.php commands

The forum is closed. Please use Stack Overflow for submitting new questions. Use tags: tinybutstrong , opentbs
By: Tebian
Date: 2009-11-15
Time: 00:11

Add SSI.php commands

I am trying to mod a system what was completely written using TBS to call the header and body of each page, merge and display. I am not that familiar with TBS but I just want to add two lines in one of the long templates. First calls the SSI.php script with all the functions and 2nd line is the actual function. I have spent most of day and got as far as maybe putting them in variables so they are not translated but then TBS does not seem to want to execute them.

Problem is I have this and a few other functions I want to call from the ssi.php file on this one page. The template is big atm i have it all done with iframes. Is there some way to trick TBS into not converting the lines and then executing them ? Would really appreciate any help.

Thanks in advance.

this is what i want to put in the middle of a template:

<?php require(dirname(__FILE__) . '/SSI.php'); ?>
<?php ssi_welcome(); flush(); ?>

This was my one way of doing it..
(calling file)
$ssi="<?php require(dirname(__FILE__) . '/SSI.php'); ?>";
$welcome_ssi="<?php ssi_welcome(); flush(); ?>";
(template)
<!--[var.ssi;htmlconv=no;comm;]-->
<!--[var.welcome_ssi;htmlconv=no;comm;]-->


this the old way i did it but its really hard with 5 frames to open:
<iframe width="600" height="100" src="./templates/ssi_frontpage_events_block.php"
By: Skrol29
Date: 2009-11-15
Time: 01:03

Re: Add SSI.php commands

Hi Tebian,

PHP code placed in the template will not be processed. It is a HTML template, not a PHP script template.

If you can get the part to display within a string then you can do:
PHP side:
require(dirname(__FILE__) . '/SSI.php');
$welcome_ssi = ssi_welcome();
HTML side:
[var.welcome_ssi;htmlconv=no;comm;]-

If you can get the part to display within a string becasue ssi_welcome() does a echo() , then you can us a sub-template:
sub-template ssi_insert.php:
<?php
require(dirname(__FILE__) . '/SSI.php');
ssi_welcome();
?>
HTML side:
[onload;script=ssi_insert;subtpl]
By: Tebian
Date: 2009-11-15
Time: 01:14

Re: Add SSI.php commands

Dang never thought about that. Preload the items in variables then just put the variables in the the template. Hours I sit thinking of work around. Thank you very much for solution.