function echoDebug( $string) { global $debug; if( $debug) echo $string; } // ** this is to include the site style layout // ** if( !file_exists('site.xml') ) die( '

Non existing database, check the arguments

'); else $db = simplexml_load_file('site.xml') or die ("Unable to load XML file!"); include( 'guest.pass.php'); if (!@mysql_connect( $dbServer, $dbUser, $dbPass)) die( "

Connectie met de database mislukt ($dbUser)

"); mysql_select_db($db['name']) or die(mysql_error()); include( 'layout.php'); $menu= getDbItem( $db->menu); loadHeader(); loadMenu(); echo "
\n"; // ** end layout ** // if( ($submit = $_REQUEST['submit']) ) { // A POST has been done, get POST arguments // $spgmGal = $_REQUEST['spgmGal']; $naam = $_REQUEST['naam']; $code = $_REQUEST['wachtwoord']; $onderschrift = $_REQUEST['onderschrift']; if( strcmp( $code, "chuan") != 0) { $submit= ""; $error= "Wachtwoord klopt niet, probeer opnieuw of informeer naar het juiste wachtwoord

"; $action= "upload"; } } else { $action= $_GET['action']; $spgmGal = $_GET['spgmGal']; } if( $submit == "Verzend" ) { $fDir= dirname($_SERVER['PHP_SELF'] ); $root = $_SERVER['DOCUMENT_ROOT'].$fDir; $fName= $_FILES['userfile']['name']; $fSize= $_FILES['userfile']['size']; $fType= $_FILES['userfile']['type']; $fTemp= $_FILES['userfile']['tmp_name']; $words= explode( " ", $spgmGal); $spgmGal= implode( "%20", $words); $large= 150; if( strstr( $root, "Program Files/xampp") != NULL) $fPath= $root."/spgm-1.4.4/gal/".$spgmGal; else $fPath= $root."spgm-1.4.4/gal/".$spgmGal; echo "

Verzend status

"; echo "$naam, bedankt voor het laden van de foto.
"; echo "Onderschrift foto..$onderschrift
"; echo "Bestandsnaam......$fName
"; echo "Upload map..........$fPath
"; echo "Orginele grootte....$fSize bytes
"; echo "Bestandstype.......$fType

"; /* echo "

Verzend status

  $naam, bedankt voor het laden van de foto.
Onderschrift foto: $onderschrift
Bestandsnaam: $fName
Upload map: $fPath
Orginele grootte: $fSize
Breedte x hoogte: $width x $height
Type: $fType
"; */ /* remove all the spaces from file name */ $words= explode( " ", $fName); $fName= implode( "_", $words); $add="$fPath/$fName"; // the path with the file name where the file will be stored, upload is the directory name. // echo "move upload file $fTemp -> $add
"; if( move_uploaded_file($fTemp, $add) ) { // echo "Het bestand is succesvol geladen
"; chmod("$add",0777); } else { echo "Helaas is het uploaden fout gegaan, neem contact op met Eric of Nikolaj"; exit; } //////////////////////////////// Starting of JPG thumb nail creation ////////// $tsrc="$fPath/_thb_$fName"; // Path where thumb nail image will be stored // echo "$tsrc
"; if( $fType != "image/jpeg") { echo "Het geladen bestand wordt niet als JPG herkend
"; echo "Gegeven bestandstype $fType is niet gelijk image/jpeg
"; exit; } if( $fType=="image/jpeg") { $im=ImageCreateFromJPEG($add); $width=ImageSx($im); // Original picture width is stored $height=ImageSy($im); // Original picture height is stored echo "Breedte x hoogte...$width x $height
"; if( $width > $height) { $n_width= $large; $n_height= round( $large/$width * $height); } else { $n_height= $large; $n_width= round( $large/$height * $width); } // echo "new size of jpg image is $n_width x $n_height
"; $newimage=imagecreatetruecolor($n_width,$n_height); imageCopyResized($newimage,$im,0,0,0,0,$n_width,$n_height,$width,$height); ImageJpeg($newimage,$tsrc); chmod("$tsrc",0777); }//////////////// End of JPG thumb nail creation ////////// // echo "Writing $fPath/pic-desc.txt
"; $file_var= fopen( "$fPath/pic-desc.txt","a") or die( "Error - picture description file couldn't be openend"); $bytes_written = fwrite( $file_var, "_thb_$fName | $naam\n") or die( "Error - picture description file couldn't be written"); $bytes_written = fwrite( $file_var, "$fName | $onderschrift ($naam)\n") or die( "Error - picture description file couldn't be written"); fclose( $file_var); echo "

Meer foto's in dezelfde map laden <klik dan hier>
Om geladen foto's te bekijken <klik dan hier>.

"; } else if( $action == "upload") { echo "

Foto upload voor leden

 

Huidige map: $spgmGal
  • Zorg er voor dat je in de juiste map begint, de foto's komen nl. in die betreffende map te staan. Als er nog geen map over het onderwerp aanwezig is, laat dan eerst een map aanmaken door Eric of Nikolaj.
  • Het is alleen mogelijk om JPG images in de Galerij te zetten
  • Zonder het wachtwoord kun je geen foto's laden
  • De grootte wordt automatisch terug gebracht tot max. 500 Kb per plaatje, je hoeft ze dus niet zelf te verkleinen
Korte beschrijving:
Je naam:
Wachtwoord:
Image Upload:
"; // end echo // if( $error != "") echo "

$error

"; } else { require("spgm.php"); echo "

Foto's laden (ga eerst naar de juiste map) "; echo "<klik dan hier>

"; } echo "
"; echo "
\n"; ?>