sales = "info@nyq.org"; /* maximum qty a user can enter for one item on cart view */ $CFG->max_qty = 50; /* directory locations */ #these can be outside the webserver root #location of required libraries $CFG->libdir = __DIR__."/nyqincl"; #location of store interface templates $CFG->tpldir = __DIR__."/nyqtpl"; /* database settings */ #db user only needs select, insert, update, delete privs on dbname $CFG->dbhost = "rhammond.powwebmysql.com"; $CFG->dbname = "nyqpoets_1"; $CFG->dbuser = "nyqpoets_1"; $CFG->dbpass = "ej5zM#XgtC?RchN6"; $CFG->catalog = "/issues"; $CFG->viewcart = "/issues/viewcart.php"; $CFG->addtocart = "/issues/addtocart.php"; $CFG->checkout = "/issues/checkout.html"; /* FUNCTIONS */ /* STANDARD FUNCTIONS */ function setdefault(&$var, $default="") { /* if $var is undefined, set it to $default. otherwise leave it alone */ if (! isset($var)) { $var = $default; } } /* SHOPPING FUNCTIONS */ function get_cart_items() { //returns a query handle of items and associated options names global $SESSION; $in_clause = $SESSION["cart"]->get_productid_list(); if (empty($in_clause)) { return false; } $query = "SELECT id, title, price FROM issues WHERE id IN ($in_clause)"; return db_query($query); } /* INITIALIZE... */ /* load up include files */ require("$CFG->libdir/template.inc"); require("$CFG->libdir/cart.inc"); require("$CFG->libdir/dblib.inc"); /* start a session */ session_save_path(__DIR__."/../../../phpsessions"); session_start(); /* register SESSION variable */ session_register("SESSION"); /* initialize SESSION variable */ if (! isset($SESSION)) { $SESSION = array(); } /* initialize the CART object */ if (! isset($SESSION["cart"])) { $SESSION["cart"] = new Cart; } /* connect to the database */ db_connect($CFG->dbhost, $CFG->dbname, $CFG->dbuser, $CFG->dbpass); ?>