""){ echo 'deleting'; unlink('pix/large/'.$_REQUEST["picname"]); unlink('pix/small/'.$_REQUEST["picname"]); $stmt = $pdodb->prepare("DELETE FROM pix WHERE ID=:did "); $stmt->bindParam(':did',$_REQUEST["did"]); $stmt->execute(); $stmt = $pdodb->prepare("SELECT ID,picis FROM pix WHERE approved=1 AND mid=:sessid LIMIT 1"); $stmt->bindParam(':sessid',$_SESSION["uid"]); $stmt->execute(); while($i3=$stmt->fetch()) { $npic = $i3["picis"]; } $stmt = $pdodb->prepare("UPDATE LOW_PRIORITY girls SET mainpic=:mainpic WHERE ID=:sessid "); $stmt->bindParam(':sessid',$_SESSION["uid"]); $stmt->bindParam(':mainpic',$npic); $stmt->execute(); } if($_REQUEST["setmain"] <> ""){ $stmt = $pdodb->prepare("UPDATE LOW_PRIORITY girls SET mainpic=:mainpic WHERE ID=:sessid "); $stmt->bindParam(':sessid',$_SESSION["uid"]); $stmt->bindParam(':mainpic',$_REQUEST["setmain"]); $stmt->execute(); echo 'main photo now set'; } if(strstr(strtolower($_FILES['uploadfile']['name']),".jpg") || strstr(strtolower($_FILES['uploadfile']['name']),".jpeg") || strstr(strtolower($_FILES['uploadfile']['name']),".gif") || strstr(strtolower($_FILES['uploadfile']['name']),".png")){ //print_r($_FILES); $smalldir = $_SERVER["DOCUMENT_ROOT"].'/pix/small/'; $largedir = $_SERVER["DOCUMENT_ROOT"].'/pix/large/'; //echo $_FILES['uploadfile']['name']; $thisdate=date("YmdHis").uniqid(); $filelarge = $largedir .$thisdate.'.jpg'; $filesmall = $smalldir .$thisdate.'.jpg'; $filename = $thisdate.'.jpg'; echo "almost up"; if (move_uploaded_file($_FILES['uploadfile']['tmp_name'], $filelarge)) { echo "upping"; $image = new WideImage(); $image->load($filelarge)->resize(800, 600)->saveToFile($filelarge); $image = new WideImage(); $image->load($filelarge)->resize(300, 150)->crop('center', 'center', 150, 150)->saveToFile($filesmall); $_SESSION["emailis"] = $_REQUEST["emailis"]; $_SESSION["realname"] = $_REQUEST["realname"]; $stmt2 = $pdodb->prepare("INSERT INTO pix(picis,mid) VALUES(:filesmall , :user_id) "); $stmt2->bindParam(':filesmall', $filename); $stmt2->bindParam(':user_id',$_SESSION["uid"],PDO::PARAM_INT); $stmt2->execute(); $lastid = $pdodb->lastInsertId(); $stmt = $pdodb->prepare("UPDATE LOW_PRIORITY girls SET newphoto=1 WHERE ID=:did "); $stmt->bindParam(':did',$_SESSION["uid"]); $stmt->execute(); $betreff = '***approve new photos Miss Viral***'; $message2 = ' http://www.missviral.com/'.str_replace(" ","-",trim($tname)).' http://www.missviral.com/c.php '; sendmail('',"daniel.eder@gmail.com", $betreff, $message2); /* if($_REQUEST["emailis"] <> ""){ $what="Your YoModel Contest Photo Link"; $notice='Congratulations. You just uploaded a photo to the YoModel contest. In case somebody else used your email addresses you can write to us by replying and we will block your email address from entering the contest in the future. To win the contest you need to send the following link to your friends: http://www.yomodel.com/contest/'.$lastid.''.$adq.' The Winner will be the model which ranks #1 on the deadline. Recommended: Like this Facebook page http://www.facebook.com/yomodel Follow us on Twitter http://www.twitter.com/yomodel you can write me anytime to danieltravolto or www.facebook.com/travolto www.yomodel.com/travolto if you have questions '; send_notification('',$what,$_REQUEST["emailis"],$notice); $stmt = $pdodb->prepare("SELECT ID FROM contestmailing2 WHERE emailis LIKE :emailis "); $stmt->execute(array(':emailis' => $_REQUEST["emailis"])); if($stmt->rowCount() == 0){ $stmt = $pdodb->prepare("INSERT INTO contestmailing2(emailis) VALUES(:emailis) "); $stmt->execute(array(':emailis' => $_REQUEST["emailis"])); } */ $message2 .= "success|".$thisdate; } else { //echo "error up"; $message2 .= "error"; } }elseif($_FILES['uploadfile']['name'] <> ""){ echo '

incorrect image format. only JPEG or GIF

'; } class SimpleImage { var $image; var $image_type; function load($filename) { $image_info = getimagesize($filename); $this->image_type = $image_info[2]; if( $this->image_type == IMAGETYPE_JPEG ) { $this->image = imagecreatefromjpeg($filename); } elseif( $this->image_type == IMAGETYPE_GIF ) { $this->image = imagecreatefromgif($filename); } elseif( $this->image_type == IMAGETYPE_PNG ) { $this->image = imagecreatefrompng($filename); } } function save($filename, $image_type=IMAGETYPE_JPEG, $compression=75, $permissions=null) { if( $image_type == IMAGETYPE_JPEG ) { imagejpeg($this->image,$filename,$compression); } elseif( $image_type == IMAGETYPE_GIF ) { imagegif($this->image,$filename); } elseif( $image_type == IMAGETYPE_PNG ) { imagepng($this->image,$filename); } if( $permissions != null) { chmod($filename,$permissions); } } function output($image_type=IMAGETYPE_JPEG) { if( $image_type == IMAGETYPE_JPEG ) { imagejpeg($this->image); } elseif( $image_type == IMAGETYPE_GIF ) { imagegif($this->image); } elseif( $image_type == IMAGETYPE_PNG ) { imagepng($this->image); } } function getWidth() { return imagesx($this->image); } function getHeight() { return imagesy($this->image); } function resizeToHeight($height) { $ratio = $height / $this->getHeight(); $width = $this->getWidth() * $ratio; $this->resize($width,$height); } function resizeToWidth($width) { $ratio = $width / $this->getWidth(); $height = $this->getheight() * $ratio; $this->resize($width,$height); } function scale($scale) { $width = $this->getWidth() * $scale/100; $height = $this->getheight() * $scale/100; $this->resize($width,$height); } function resize($width,$height) { $new_image = imagecreatetruecolor($width, $height); imagecopyresampled($new_image, $this->image, 0, 0, 0, 0, $width, $height, $this->getWidth(), $this->getHeight()); $this->image = $new_image; } } ?>
""){ $stmt = $pdodb->prepare("SELECT mainpic FROM girls WHERE ID=:sessid LIMIT 1"); $stmt->bindParam(':sessid',$_SESSION["uid"]); $stmt->execute(); while($i3=$stmt->fetch()) { $mainpic2 = $i3["mainpic"]; } $stmt = $pdodb->prepare("SELECT ID,picis FROM pix WHERE mid=:sessid ORDER BY ID desc"); $stmt->bindParam(':sessid',$_SESSION["uid"]); $stmt->execute(); if($stmt->rowCount() < 100){ ?> upload your best model photos now

No Nudity and implied nudity please.

Select Photo:
Maximum 6 photos. Now its time to promote your profile to Win! :-)
If you want to change your photos delete some first.

fetch()) { $npic = str_replace("s","",$i3["picis"]); $mainpic2 = str_replace("s","",$mainpic2); echo '

delete

set as main

promote photo!
'; } }else{ echo 'login now'; } ?>