Categories > TinyButStrong general >

why does this simple template not work

The forum is closed. Please use Stack Overflow for submitting new questions. Use tags: tinybutstrong , opentbs
By: Pete Dickson
Date: 2006-05-19
Time: 01:01

why does this simple template not work

questions.php:

<?php

include_once('./classes/tbs_class_php5.php') ;
require ('./cnx_mysql.php') ;

$TBS = new clsTinyButStrong ;

// Load the template to display all the questions
$sql = 'SELECT * FROM flycatcher';
$TBS->MergeBlock('blk1',$cnx_id,$sql) ;
mysql_close($cnx_id);
$TBS->LoadTemplate('questions.html') ;   
$TBS->Show() ;

?>

questions.html:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">

<html>
<head>
    <title>Questions Asked</title>
</head>

<body>
    <h1>All Questions</h1>
    <div>[blk1.question;block=div]</div>
</body>
</html>

Gives the following result: http://www.lunchwithmillionaires.com/questions.php

I've used TBS before and found it quick and easy. Am totally baffeld why above does not work! Btw, I'm using v. 3.0.4

Thanks

Pete
By: TomH
Date: 2006-05-19
Time: 01:42

Re: why does this simple template not work

You need to load the template -before- you try to do the Merge
/ Load the template to display all the questions
$TBS->LoadTemplate('questions.html') ;

$sql = 'SELECT * FROM flycatcher';
$TBS->MergeBlock('blk1',$cnx_id,$sql) ;
mysql_close($cnx_id);

$TBS->Show() ;
By: Pete Dickson
Date: 2006-05-19
Time: 08:23

Re: why does this simple template not work

doh! :)

Knew it would be something stupid!

Thanks so much for quick response!

Pete