$links->setFileName("/links.php"); $links->setPage($vars['page'], "page"); $links->setCatId($vars['cat']); $links->setId($vars['id']); $linksCat = new LinkCat(); $linksCat->setFileName("/links.php"); $linksCat->setPage($vars['page'], "page"); $linksCat->setId($vars['cat']); $Archive->BuildData(); $links->BuildData(); $linksCat->BuildData(); if ($vars['id']) { header("location: {$links->getRecords()}"); } else { if ($vars['cat']) { $title = "Links : ( {$linksCat->getTitle()} ) Page : " . (1 + $links->getPage()) . " of " . $links->getnumOfRecords(); $loadFile = "links.tpl"; $records = $links->getRecords(); $pageList = $links->getCountDisplay(); } else { $title = "Link Categories : Page : " . (1 + $linksCat->getPage()) . " of " . $linksCat->getnumOfRecords(); $loadFile = "linkcat.tpl"; $records = $linksCat->getRecords(); $pageList = $linksCat->getCountDisplay(); } $smarty->assign(array("title" => "Compubomb.The Development Solutions : Blog & Everything Else", "page_name" => $title, "load" => "links/" . $loadFile, "filename" => $Archive->getFilename(), "archive_index" => $Archive->getArchiveIndex(), "records" => $records, "archive_page_list" => $pageList)); $smarty->display('public/body/index.tpl'); } } catch (Exception $e) { print "Exception: " . $e->getMessage(); }