. */ //Globals $MAXLIST=25; $MAXPHOTOTHUMBCOLS=4; $MAXPHOTOTHUMBROWS=10; $MAXPHOTOVIEW=$MAXPHOTOTHUMBCOLS*$MAXPHOTOTHUMBROWS; $MYSQLCONN=null; if( $_SERVER['SERVER_NAME']=="wimciu.kabel.utwente.nl" ) $DEBUG=true; else $DEBUG=false; //Maximum size of photos (in px) $MAXSIZEBIG=1024; $MAXSIZENORMAL=512; $MAXSIZETHUMB=100; $MAXPHOTOSPERUPLOAD=10; // maximum number of photos per upload $MAXUPLOADSIZE=ini_get("post_max_size"); $MAXPHOTOFILESIZE=get_bytes($MAXUPLOADSIZE)/$MAXPHOTOSPERUPLOAD; // We do not like deeplinking by google... if( stripos( $_SERVER["HTTP_REFERER"], "google" ) AND isset($_GET['login']) ) { header("location: http://www.aegee.utwente.nl/photo/"); exit(); } //Start the session if( $rundaily!="yes" ) { session_name("AEGEE_Photo"); session_start(); } //Check if MAXUPLOADSIZE is in bytes switch( strtoupper(substr($MAXUPLOADSIZE, -1, 1)) ) { case "K": $MAXUPLOADSIZE=substr($MAXUPLOADSIZE, 0, -1)*1024; break; case "M": $MAXUPLOADSIZE=substr($MAXUPLOADSIZE, 0, -1)*(1024*1024); break; case "G": $MAXUPLOADSIZE=substr($MAXUPLOADSIZE, 0, -1)*(1024*1024*1024); break; } if( $MAXUPLOADSIZE<$MAXPHOTOFILESIZE ) $MAXPHOTOFILESIZE=$MAXUPLOADSIZE; //Get URL of script $patha = strrpos("/".$_SERVER['SCRIPT_NAME'], "/"); $PATH = substr($_SERVER['SCRIPT_NAME'], 0, $patha); $FULL_URL = $_SERVER['SERVER_NAME'].$PATH; $patha = strrpos($_SERVER['SCRIPT_FILENAME'], "/"); $FULL_PATH = substr($_SERVER['SCRIPT_FILENAME'], 0, $patha+1); //Set the layout if( isset($_GET['layout']) ) $_SESSION['layout']=$_GET['layout']; if( isset($_POST['layout']) ) $_SESSION['layout']=$_POST['layout']; if( strlen($_SESSION['layout'])<1 OR isset($_GET['layout']) OR isset($_POST['layout']) ) { if( !preg_match("/^[a-z]+$/", $_SESSION['layout']) ) { // not matching regex, probably weird characters included $_SESSION['layout']="default"; }elseif( !is_dir($FULL_PATH."layout/".$_SESSION['layout']) ) { // directory does not exist $_SESSION['layout']="default"; } } ?>