Hi there,
I'm building myself a small, lightweight blog system - nothing too serious, it's just for show.
I've decided to use TBS for my template system, and have hit a small snag.
I'm using AJAX widgets for each block of code in the system, so you can place your items anywhere and I want to. Each widget has a position and order. I've tried this so far.
In my template file, I specify each area as such:
[body.widget_name;position=body] |
For some reason, I think I don't need the position=, do i? But I can't seem to find out how to get the template tags name.
now here is my PHP:
<?php
$jBlogTemplate->LoadTemplate('themes/default/index.jtemp');
$jBlogTemplate->MergeField('header,body,footer','display_widgets',true);
function display_widgets($Subname,$position) {
global $database;
$result = $database->query("SELECT widget_title FROM jb_widgets WHERE widget_area=" . $position . " ORDER BY widget_order ASC",__FILE__,__LINE__);
echo $result;
$widgets = $database->fetch_array($result);
return $widgets['widget_name'];
}
$jBlogTemplate->Show();
?>
|
All I get back from this is a SQL error:
Error Unknown column 'Array' in 'where clause' in query SELECT widget_title FROM jb_widgets WHERE widget_area=Array ORDER BY widget_order ASC. In file C:\Documents and Settings\Alexandria Siemens\My Documents\Tane\xampplite\htdocs\jblog\themes\default\template_default.php in line 9. Date: 2006-08-22 12:03:51
Object id #4Error You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'Object' at line 1 in query Object id #4. In file in line 0. Date: 2006-08-22 12:03:51
|
What I need to know is, can I cut out using the position parameter, and some how grab the name directly from the tag. if not, how do I extract the data from that array to be used in the SQL code?
Thanks