Ejemplo n.º 1
0
if ($_POST["saveAddCats"] && $admingroup && $_POST["addcategory"]) {
    $db = new clsDBNetConnect();
    $newcats = explode(";", $_POST["addcategory"]);
    $i = 0;
    while ($newcats[$i]) {
        $newcats[$i] = trim($newcats[$i]);
        if (strlen($newcats[$i]) > 0) {
            $db->query("insert into `categories` set `name` = '" . mysql_escape_string($newcats[$i]) . "', `sub_cat_id` = '" . $_GET["CatID"] . "'");
        }
        $i++;
    }
    header("Location: ViewCat.php?" . CCGetQueryString("QueryString", array()));
}
$itemcatcounts = get_catcounts($_GET["CatID"]);
if (!CCGetUserID() && $_GET["CatID"]) {
    $db = new CLSDBNetConnect();
    $query = "select * from categories where cat_id=" . $_GET["CatID"];
    $db->query($query);
    if ($db->next_record()) {
        if ($db->f("member") == 1) {
            CCSecurityRedirect("1;2", "login.php", "ViewCat.php", CCGetQueryString("QueryString", ""));
        }
    }
}
//End Include Common Files
$page = "Viewing Listings";
global $REMOTE_ADDR;
global $now;
$ip = $REMOTE_ADDR;
$timeout = $now["timeout"];
$db1 = new clsDBNetConnect();
Ejemplo n.º 2
0
    }
    header("Location:ViewItem.php?ItemNum={$ItemNum}");
}
// Make sure Item Number exists
if ($_GET["ItemNum"]) {
    $db = new CLSDBNetConnect();
    $query = "select user_id from items where ItemNum = " . $_GET["ItemNum"];
    $db->query($query);
    if (!$db->next_record()) {
        print "<b>Item Number not Found</b><br>This item is not on the system, if you are trying to access it from a saved link, bookmark or 'Wishlist' entry then the Item has been deleted by the seller or has been cleaned out by the system.  Please update your link to reflect this.<br><a href=\"myaccount.php\">Click here to go to your account</a><br><a href=\"index.php\">Click here to return to the Home Page</a>";
        exit;
    }
}
// Check if the user it logged in and if this Item is in a "members only" category
if (!CCGetUserID() && !CCGetFromGet("PreviewNum", "") && !$admingroup) {
    $db = new CLSDBNetConnect();
    $query = "select c.cat_id from categories c, items i where i.ItemNum = " . $_GET["ItemNum"] . " and c.cat_id=i.category and (c.member != 1 or c.member IS NULL)";
    $db->query($query);
    if (!$db->next_record()) {
        CCSecurityRedirect("1;2", "login.php", "ViewItem.php", CCGetQueryString("QueryString", ""));
    }
}
//End Include Common Files
$page = "Viewing Item #" . CCGetFromGet("ItemNum", "");
if (CCGetFromGet("PreviewNum", "")) {
    $page = "Previewing Item Preview #" . CCGetFromGet("PreviewNum", "");
}
global $REMOTE_ADDR;
global $now;
$ip = $REMOTE_ADDR;
$timeout = $now["timeout"];