redirect_header("index.php", 1, _MD_NEWLINKADDED); } if (!isset($_POST['op'])) { $op = isset($_GET['op']) ? $_GET['op'] : 'main'; } else { $op = $_POST['op']; } switch ($op) { case "delNewLink": delNewLink(); break; case "approve": approve(); break; case "addCat": addCat(); break; case "addLink": addLink(); break; case "listBrokenLinks": listBrokenLinks(); break; case "delBrokenLinks": delBrokenLinks(); break; case "ignoreBrokenLinks": ignoreBrokenLinks(); break; case "listModReq": listModReq();
$rSet = dbQuery("SELECT category_id AS cid FROM [db]categories WHERE status >= 0 ORDER BY sequence"); if ($rSet !== false) { $count = 1; while ($row = mysql_fetch_assoc($rSet)) { dbQuery("UPDATE [db]categories SET sequence=" . $count++ . " WHERE category_id = " . $row['cid']); } } } return $msg; } //Control logic if ($privs >= 4) { //manager or admin $msg = ''; if (isset($_POST['addExe'])) { $msg = addCat(); } elseif (isset($_POST['updExe'])) { $msg = updateCat(); } elseif (isset($_GET['delExe'])) { $msg = deleteCat(); } echo "<p class='error'>{$msg}</p>\n\t\t<div class='scrollBoxAd'>\n\t\t<div class='centerBox'>\n"; if (!$editCat or isset($_POST['back'])) { showCategories(false); //no edit } else { editCategory($editCat, $cid); //action = "add" or "edit" showCategories(true); //edit }
$rowArray = $stH->fetchAll(PDO::FETCH_ASSOC); $stH = null; $stH = stPrep("UPDATE `categories` SET `sequence` = ? WHERE `ID` = ?"); $count = 1; foreach ($rowArray as $row) { stExec($stH, array($count++, $row['ID'])); } } 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);
<?php include_once "header.php"; include_once "db.php"; include_once "sourlib.php"; if (stripslashes(!$_POST['checksubmit']) && checkCookie()) { showCatAddform(); } else { if (checkCookie()) { $cat = stripslashes($_POST['cat']); addCat($cat); } else { echo "please <a href='login.php'>login</a> in order to change the site settings!"; } } ?> </body> </html>