Hi,
I am currently building my first website using the PHPLIB Template system. The website will display information about mobile(cell) phones and some info on network deals.
I am currently trying to make a page that will display all phones by maunfacture.
What im trying to achieve is to setup the template to put a header for each manufacture followed by a row of 4 phone images and then start a new row of 4 images and continue until all phones made by that manufacture are displayed then for that to happen for all manfuactures.
The problem is that i dont know enough about templates to do this i can make a series of rows or columns with one phone on each but not together.
below is my function so far
function get_allphones()
{
$t = new Template("_templates/modules");
$t->set_file("content", "allphones.php");
$t->set_block("content", "allphone_row", "allphone_rows");
$t->set_block("content", "allphones", "show_allphones");
$Result = @ mysql_query(sprintf("SELECT * FROM Makes WHERE Display='Y' ORDER BY SortOrder"));
while($Row = @ mysql_fetch_object($Result))
{
$MakeID = $Row->ID;
$Make = $Row->Name;
$t->set_var("MAKEIMAGE", $Row->Image);
$PhoneResult = @ mysql_query(sprintf("SELECT * FROM Model WHERE Display='Y' AND MakeID=%s", $MakeID));
while($PhoneRow = @ mysql_fetch_object($PhoneResult))
{
$PhoneID = $PhoneRow->ID;
$PhoneName = $PhoneRow->Name;
$PhoneThumb = $PhoneRow->Thumbnail;
$t->set_var("PHONETHUMB", $PhoneThumb);
$t->set_var("NAME", $PhoneName);
$t->parse("allphone_rows", "allphone_row", true);
}
$t->parse("show_allphones", "allphones");
}
$t->parse("OUTPUT", "content");
return $t->parse("OUTPUT", "content");
}
Any help would be most appriciated
Thanx
Tim