set_file("listing", "offers_listing.tpl"); $template->set_block("listing", "offers_block", "offers"); $template->set_block("offers_block", "offer_row", "o_row"); $template->set_var(array( "HEAD" => head(), "BOTTOM" => bottom()) ); $sql = "SELECT offers.o_id, offers.o_name, offers.o_descr, offers.o_url FROM offers WHERE offers.o_flags = ".$_flags['show']." ORDER BY o_order ASC"; $result = mysql_query($sql); while ($row = mysql_fetch_assoc($result)) { extract($row); $template->set_var(array( "offer_row.NAME" => $o_name, "offer_row.DESCRIPTION" => $o_descr, "offer_row.URL" => $o_url) ); $template->parse("o_row", "offer_row", true); } $template->parse("offers", "offers_block", true); $template->pparse("listing", "listing"); ?>