Example #1
0
 case 'add':
     $admintpl->set("category_add", true, true);
     $admintpl->set("language", $language);
     $admintpl->set("category_name", "");
     $admintpl->set("frm_action", "index.php?page=admin&user="******"uid"] . "&code=" . $CURUSER["random"] . "&do=category&action=save&mode=new");
     $admintpl->set("image_combo", image_combo());
     $admintpl->set("subcat_combo", sub_categories());
     $admintpl->set("category_sort", "");
     $admintpl->set("category_porn", "");
     $admintpl->set("nop", 'checked="checked"');
     $admintpl->set("yep", '');
     $admintpl->set("category_image", "{$STYLEURL}/images/categories/spacer.gif");
     $admintpl->set("image_url", "{$STYLEURL}/images/categories/");
     break;
 case 'order':
     sortCategories('categories_list');
     break;
 case 'edit':
     if (isset($_GET["id"])) {
         // we should get only 1 style, selected with radio ...
         $id = max(0, $_GET["id"]);
         $cres = get_result("SELECT * FROM {$TABLE_PREFIX}categories WHERE id={$id}", true);
         $admintpl->set("category_add", true, true);
         $admintpl->set("language", $language);
         $admintpl->set("category_name", $cres[0]["name"]);
         $admintpl->set("frm_action", "index.php?page=admin&user="******"uid"] . "&code=" . $CURUSER["random"] . "&do=category&action=save&mode=edit&id={$id}");
         $admintpl->set("image_combo", image_combo($cres[0]["image"]));
         $admintpl->set("subcat_combo", sub_categories($cres[0]["sub"]));
         $admintpl->set("category_sort", $cres[0]["sort_index"]);
         $admintpl->set("category_porn", $cres[0]["p**n"]);
         if ($cres[0][p**n] == "yes") {
Example #2
0
    }
    return $msg;
}
//Control logic
if ($privs >= 4) {
    //manager or admin
    $msg = '';
    if (isset($_POST['addExe'])) {
        $msg = addCat($cat);
    } elseif (isset($_POST['updExe'])) {
        $msg = updateCat($cat);
    } elseif (isset($_GET['delExe'])) {
        $msg = deleteCat($cat);
    }
    echo "<p class='error'>{$msg}</p>\n\t\t<div class='scrollBoxAd'>\n\t\t<div class='centerBox'>\n";
    if ($mode == 'sort') {
        sortCategories();
        //sort on name
    }
    if ($mode != 'add' and $mode != 'edit' or isset($_POST['back'])) {
        showCategories(false);
        //no add / no edit
    } else {
        editCategory($cat);
        //add or edit
        showCategories(true);
    }
    echo "</div>\n</div>\n";
} else {
    echo "<p class='error'>{$ax['no_way']}</p>\n";
}