adds_block('AVAIL',array('exi'=>1)); } else { $template->adds_block('NOTAVAIL',array('exi'=>1)); } $pager = &Pager::factory(array( 'mode' => 'Sliding', 'perPage' => 20, 'delta' => 2, 'itemData' => $getcomments3)); $j=0; foreach ($pager->getPageData() as $comment) { if (!empty($comment)) { $template->adds_block('COMMENT', array( 'TEXT' => parseText($comment['comment']), 'AUTHOR' => $comment['author'], 'ID' => $comment['id'], 'ODD' => ($j % 2 ? '' : ' class="odd"'))); } $j++; } $template->add('PAGEID', $pager->getCurrentPageID()); $template->add('PAGINATION', $pager->links); $template->display(); ?>