if (count($items[$i]['links']) > 0) { $items[$i]['links_title'] = 'Links:<br />'; } $html .= apply_template($items[$i], BASEDIR . '/templates/template.curated.item.html'); $i++; } } $template = BASEDIR . '/templates/template.html'; $templatepiece = BASEDIR . '/templates/template.test.html'; $page = new xhtml_page($template); $page->set('title', 'Testing'); $piece = new xhtml_piece($templatepiece); $page->set('content', $piece->out()); $page->set('replaceme', $html); $fp = fopen(BASEDIR . '/testout.php', 'w'); fwrite($fp, $page->out()); fclose($fp); echo $page->out(); echo '<pre>'; print_r($items); echo '</pre>'; ?> <a href="javascript:MM_openBrWindow('<!--*-->location<!--*-->','<!--*-->name<!--*-->','status=yes,scrollbars=<!--*-->scroll<!--*-->,resizable=<!--*-->resize<!--*-->,width=<!--*-->width<!--*-->,height=<!--*-->height<!--*-->')" title=""> <img src="<!--*-->img_file<!--*-->" alt="<!--*-->img_alt<!--*-->" title="<!--*-->img_title<!--*-->" class="curatedImg" /></a><br /> <p> <a href="javascript:MM_openBrWindow('<!--*-->location<!--*-->','<!--*-->name<!--*-->','status=yes,scrollbars=<!--*-->scroll<!--*-->,resizable=<!--*-->resize<!--*-->,width=<!--*-->width<!--*-->,height=<!--*-->height<!--*-->')" title=""> <strong><!--*-->name<!--*--></strong></a><br /> <span class="author">by <!--*-->by<!--*--></span><br /> <br /> <!--*-->description<!--*--><br />