"localhost", SERVER_TEST => "test.doitlater.com", SERVER_BETA => "beta.doitlater.com", SERVER_RELEASE => "doitlater.com", ); $flipped = array_flip($servers); $site = getDomain(); if(isset($flipped[$site])){ define('WHICH_SERVER', $flipped[$site]); } else { // TODO: AT RELEASE - uncomment this or log it somehow. define('WHICH_SERVER', SERVER_RELEASE); //print "Server type cannot be determined for server: $site. Please make sure you have updated \$servers array in defines.php."; } // Jquery defines define('JQUERY_VERSION', '1.1.2'); switch( WHICH_SERVER ){ case SERVER_DEV: define('JQUERY_DIR', 'jquery/'.JQUERY_VERSION.'/src/'); break; case SERVER_TEST: case SERVER_BETA: case SERVER_RELEASE: default: define('JQUERY_DIR', 'jquery/'.JQUERY_VERSION.'/packed/'); }; // TODO: Make the structure use these like Pedlr did instead of a fixed width like is currently in struct. define('CSS_WRAPPER_MIN_WIDTH', 772); define('CSS_WRAPPER_MAX_WIDTH', 965); define('MIN_AGE_REGISTER', 14); // can't register if less than this age define('MIN_AGE_ADULT', 18); // user doesn't have total freedom until this age // For profile pics define('IMG_WIDTH_LIL', 50); define('IMG_WIDTH_MED', 100); define('IMG_WIDTH_BIG', 186); define('IMG_HEIGHT_LIL', (IMG_WIDTH_LIL*2.5)); define('IMG_HEIGHT_MED', (IMG_WIDTH_MED*2.5)); define('IMG_HEIGHT_BIG', (IMG_WIDTH_BIG*2.5)); // For album pics define('ALBUM_PIC_WIDTH', 550); // 640x480 left little room for anything else on the page... (for ref: Flickr is 500, facebook is ??, MySpace is ??, PhotoBucket is ??, WebShots is ??, linkinn is ??, CollegeHumor is ??). define('ALBUM_PIC_HEIGHT', 800); define('ALBUM_THUMB_WIDTH', IMG_WIDTH_MED); define('ALBUM_THUMB_HEIGHT', ALBUM_THUMB_WIDTH); // make it fit into a square. GLOBAL $USER_CONSTS; //// // Given a prefix and a value, returns the original key that starts with that prefix and is set to the value. // For instance, if you want the CART_STATE_* which was defined to value '2', call lookupDef('CART_STATE_', 2); // If the key you are looking up does not have a solid prefix, use preg_lookupDef(). // Returns false if no match is found. Returns the keyname otherwise. //// function lookupDef($prefix, $value){ GLOBAL $USER_CONSTS; if(!is_array($USER_CONSTS)){ $defs = get_defined_constants(true); $USER_CONSTS = $defs['user']; } $defs = $USER_CONSTS; $retVal = false; foreach($defs as $defKey=>$defVal){ if(($defVal === $value) && (startsWith($defKey, $prefix))){ $retVal = $defKey; break; } } return $retVal; } // end lookupDef() //// // Same as lookupDef except that the first parameter is not a prefix, it is a regular expression which the key // should match. // Returns false if no match is found. Returns the keyname otherwise. //// function preg_lookupDef($regEx, $value){ GLOBAL $USER_CONSTS; if(!is_array($USER_CONSTS)){ $defs = get_defined_constants(true); $USER_CONSTS = $defs['user']; } $defs = $USER_CONSTS; $retVal = false; foreach($defs as $defKey=>$defVal){ if(($defVal === $value) && (0