<?php
require("mysql.php");

$titel = 'Verifizierungsfoto komfortabel hochladen - Fotos';
if(!$_SESSION[foto]) {
	header("location:photos-login");
}else{

if($_GET[msgid] == 'ERRORONLYJPG') {
	$inhalt .= '<div class="servermessage">Es sind nur JPG Files zum Upload erlaubt.</div>';
} else if($_GET[msgid] == 'PHOTOUPLOADED') {
	$inhalt .= '<div class="servermessage">Dein Verify Foto wurde hochgeladen.</div>';
}

if ($_POST[upload] != '') {
	if (!empty($_FILES['photo']['name'])) {
		$time = md5(time());
		$zahl = rand(0,100);
		$size = @getimagesize($_FILES['photo']['tmp_name']);
		$ex = strtolower(end(explode('.', $_FILES['photo']['name'])));
		$newfile = $time.$zahl.'.'.$ex;

		if (!in_array($_FILES['photo']['type'], array('image/jpg', 'image/jpeg', 'image/pjpeg'))) {
			header("location:photos-verifyphoto.php?msgid=ERRORONLYJPG");
		} else {
			resize($_FILES['photo']['tmp_name'], 'pics/photos/verify/' .  $newfile, 280, 280, false);
			mysql_query("update accounts set verifyPhoto='".$time.$zahl."' where name = '".$_SESSION[foto]."'");
			header("location:photos-verifyphoto.php?msgid=PHOTOUPLOADED");
		}
	}
}

$inhalt .= '<div class="photo">
<div class="noh1"></div>
<div class="box small">
<div class="hd">
<div class="tl"></div>
<div class="tr"></div>
<div class="tm"></div>
<div class="m"><div class="mi">
<div class="h h2"><div class="hbegin"></div><h2>
Verifizierungsfoto komfortabel hochladen
</h2></div>
</div></div>
</div>
<div class="bd fade bd-fade">
<div class="m">
<div class="mi">

<div class="verifycontentwrapper">
<div class="introduction">Bestätige mit der Foto Verify, dass dein Profilfoto echt ist.</div>
<div class="h h3"><div class="hbegin"></div><h3> Vorteile </h3></div>
<ul class="bullet">
<li>Deine Gesprächspartner im Chat haben mehr Vertrauen in dich</li>
<li>Mehr interessante Gespräche, weil andere User sehen, dass du "echt" bist</li>
<li>Erhalte einen Verifizierungs-Smiley als Belohnung</li>
<li>Verify-Icon (<img src="sf/m/verify/fv_checked.png" style="top:3px;position:relative;" />) hinter deinem Nick</li>
<li><a href="javascript:showAdditionalVerifyBenefits(\'additionalverifybenefit\');">Weitere Vorteile ...</a></li>
<li class="additionalverifybenefit">Du kannst 3x mehr Alben und Fotos hochladen</li>
<li class="additionalverifybenefit">Nur Nutzer mit verifiziertem Foto können Mentor werden</li>
<li class="additionalverifybenefit">Exklusiven Zugang zum Channel "Foto Verified"</li>
<li class="additionalverifybenefit">Doppelte Punktzahl bei allen FotoContest- und FotoFlirt-Spielen</li>
</ul>
<div class="innerbox verificationadvices">
<div class="corner ctl"></div>
<div class="corner cbl"></div>
<div class="corner ctr"></div>
<div class="corner cbr"></div>
<div class="h h3"><div class="hbegin"></div><h3> Verifiziere dein Foto jetzt:</h3></div>
<div class="privacyadvice"> HINWEIS: Dein Verify-Foto ist privat, nur das Foto-Team kann es einsehen! </div>
<div class="helpitem">
<div class="description num1">
<div class="content right"> Schreibe handschriftlich deinen <strong>Nicknamen</strong> und deinen Code <strong> D5EH3V </strong> auf einen Zettel. </div>
</div>
<div class="example">
<div style="position:relative;display:inline-block;display:inline;display:inline-block;">
<div style="float:left;">
<img src="sf/m/verify/fv_sign_l.png" />
</div>
<div style="float:left; background-image: url(sf/m/verify/fv_sign_c.png); background-repeat: repeat-x">
<div class="photoverifycode">'.$_SESSION[foto].'</div>
<div class="photoverifycode">D5EH3V</div>
</div>
<div style="float:left;">
<img src="sf/m/verify/fv_sign_r.png" />
</div>
<div style="float:left;">
<img src="sf/m/verify/fv_pen.png" style="margin-left:-15px;margin-top:20px" />
</div>
<div class="clear"></div>
</div>
</div>
<div class="clear"></div>
</div>
<div style="border:solid 1px #9F8CAB;border-width:1px 0 0 0;margin:auto;padding:2px 0 2px 0"></div>
<div class="helpitem">
<div class="description num2">
<div class="content right"> Schieße ein Farbfoto auf dem Augen, Gesicht, der Zettel, die Arme, die Hand, die den Zettel hält und der "Daumen hoch" komplett und gut zu sehen sind. </div>
</div>
<div class="example">
<div style="float:left; margin-right:5px;">
<a href="sf/m/verify/fv_example-01_large.jpg" target="_blank">
<img src="sf/m/verify/fv_example-01.jpg" />
</a>
</div>
<div style="float:left;">
<a href="sf/m/verify/fv_example-02_large.jpg" target="_blank">
<img src="sf/m/verify/fv_example-02.jpg" />
</a>
</div>
<div class="clear"></div>
</div>
<div class="clear"></div>
</div>
<div style="border:solid 1px #9F8CAB;border-width:1px 0 0 0;margin:auto;padding:2px 0 2px 0"></div>
<div class="helpitem">
<div class="description num3">
<div class="content down"> Lade dein Verifizierungsfoto unbearbeitet hoch. </div>
</div>
<div class="example">

</div>
<div class="clear"></div>
</div>
</div>
</div>
<div class="verifychecklist">
<div class="h h3"><div class="hbegin"></div><h3> <img src="sf/m/verify/fv_checklist.png" /> </h3></div>
<ul class="bullet">
<li>Zettel mit handschriftlich geschriebenem Nick und korrektem Code in der Hand?</li>
<li>Gesicht, Augen, Arme, Zettel und die Hand, die den Zettel hält, komplett und gut sichtbar?</li>
<li>Daumen einer Hand "Daumen hoch"?</li>
</ul>
</div>


<div class="uploader">

<div id="flash_uploader">
<p class=""><strong>Du kannst mit dem Uploader jetzt eine Datei hochladen.</strong></p>
<form action="photos-verifyphoto.php" method="POST" accept-charset="UTF-8"
enctype="multipart/form-data"
id="form-alternate"
name="form-alternate">
<ol id="alternate_file_list">

<li>
<span id="formline-alternate-file0" class="formline formline-plain formline-alternate-file0 formres-no formres-noresult-alternate-file0 ">
<input type="file" class="file type-String"
name="photo" id="alternate-file0"
accept="*/*" /><div class="formerror hidden" id="err-alternate-file0">
$inhalt .= $meldung;

</div>

</span>
</li>

</ol>
<div id="flashhandles">
<div class="buttons">
<div class="bbutton submit" id="submit-button-alternate-nojava"><div class="bttl corner"></div><div class="bttr corner"></div><div class="bttm"></div><div class="btm"><img src="/sf/m/buttons/bt-nm.png" id="submit-button-alternate-nojava-img" class="jsFixHeight" style="" height="22" width="" /><input type="submit" name="upload" class="image-submit" /><div class="btmi"><span class="text">Hochladen</span></div></div><div class="btbl corner"></div><div class="btbr corner"></div><div class="btbm"></div></div>
<div class="bbutton"><a href="photo?n='.$_SESSION[foto].'"><div class="bttl corner"></div><div class="bttr corner"></div><div class="bttm"></div><div class="btm"><img src="/sf/m/buttons/bt-nm.png" id="button-870873937-img" class="jsFixHeight" style="" height="22" width="" /><div class="btmi"><span class="text">Abbrechen</span></div></div><div class="btbl corner"></div><div class="btbr corner"></div><div class="btbm"></div></a></div>
<div class="clear"></div></div></div></div>
</div></div>
<div class="clear"></div>

</div>';

}
$inhalt .= '
          
          <div class="bl"></div>
          <div class="br"></div>
          <div class="bm"></div>

         
        </div></div></div>
       </div>';

$styles = '<link href="/sf/f/registration/registration.css" rel="stylesheet" type="text/css">
<link href="/sf/m/buttons/buttons.css" rel="stylesheet" type="text/css"><link href="/sf/f/index/index.css" rel="stylesheet" type="text/css"><link href="/sf/m/boxes/boxes.css" rel="stylesheet" type="text/css"><link href="/sf/m/forms/forms.css" rel="stylesheet" type="text/css"><link href="/sf/f/photos/photos.css" rel="stylesheet" type="text/css"><link href="/sf/m/tables/tables.css" rel="stylesheet" type="text/css"><link href="/sf/m/uploader/uploader.css" rel="stylesheet" type="text/css"><link href="/sf/f/photos/photos-rate.css" rel="stylesheet" type="text/css">
';
echo str_replace(array('<?url?>','<?inhalt?>', '<?titel?>', '<?fotonavi?>', '<?registrieren?>', '<?styles?>', '<?fotos?>'),array($_SERVER[SERVER_NAME], $inhalt, $titel, $fotonavi, $registrieren, $styles, $fotos),implode("",file("sf/b/style.tpl")));
?>    