add('TITLE', 'Manage Affiliates'); } else if ($type == 'webprojs') { $template->add('TITLE', 'Manage Website Projects'); } $getlinks = "SELECT * FROM links WHERE type = \"" . mysql_real_escape_string($type) . "\" ORDER BY id ASC"; $getlinks2 = mysql_query($getlinks); $i=0; while ($getlinks3[$i] = mysql_fetch_array($getlinks2)) { $i++; } if ($i != 0) { $template->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' => $getlinks3)); $j=0; foreach ($pager->getPageData() as $link) { if (!empty($link)) { $template->adds_block('LINK', array( 'TITLE' => htmlentities($link['title']), 'URL' => $link['url'], 'ID' => $link['id'], 'ODD' => ($j % 2 ? '' : ' class="odd"'))); } $j++; } $template->add('PAGEID', $pager->getCurrentPageID()); $template->add('PAGINATION', $pager->links); $template->display(); ?>