Exemple #1
0
<?php

define("__ADMIN__", true);
try {
    $links = new Links();
    $linksCat = new LinkCat();
    $Users = new Users();
    $links->setId($vars['id']);
    $Users->BuildData();
    $links->BuildData();
    $linksCat->BuildData();
    $smarty->assign(array("load" => "links/form/link_edit.tpl", "loadindex" => "links/view/link_index.tpl", "user_list" => $Users->getRecords(), "link_cat_list" => $linksCat->getIndex(), "linkCat_index" => $linksCat->getIndex(), "records" => $links->getRecords()));
    $smarty->display('admin/body/index.tpl');
} catch (Exception $e) {
    print "Exception: " . $e->getMessage();
}
Exemple #2
0
<?php

if ($vars['cat'] && !isal_num($vars['cat'])) {
    header("Location: /public/LinkCategories");
}
try {
    $Archive = new Archive();
    $links = new Links();
    $links->setFileName("/LinkCategories");
    $links->setPage($vars['page'], "page");
    $links->setCatId($vars['cat']);
    $links->setId($vars['url']);
    if (!$_SESSION['login']) {
        $Archive->setPublic(1);
    }
    $linksCat = new LinkCat();
    $linksCat->setFileName("/LinkCategories");
    if (!$vars['cat']) {
        $linksCat->setPage($vars['page'], "page");
    }
    $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}");
        }