$linksCat->setId($vars['cat']); $Archive->BuildData(); $links->BuildData(); $linksCat->BuildData(); if ($vars['url']) { if (is_array($row = $links->getRecords())) { foreach ($row as $info) { $url = $info['link_url']; } header("location: {$url}"); } } else { if ($vars['cat']) { $title = "Links : ( {$linksCat->getTitle($links->getCatId())} ) 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("page_name" => $title, "load" => "links/" . $loadFile, "filename" => $Archive->getFilename(), "archive_index" => $Archive->getIndex(), "records" => $records, "page_list" => $pageList, "sql_queries" => array_merge($Archive->getSQLQueries(), $links->getSQLQueries(), $linksCat->getSQLQueries()))); $smarty->display('public/body/index.tpl'); echo "<!-- page rendered in approx {$timer->Stop()} -->"; } } catch (Exception $e) { $smarty->assign(array("exception" => $e->getMessage())); $smarty->display('public/body/error.tpl'); }