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

$titel = 'Einstellungen - Fotos';
$low = mysql_fetch_array(mysql_query("select * from accounts where name='".$_SESSION[foto]."'"));
if(isset($_GET[delete])) {
unlink("pics/photos/l/$low[photo].jpg");
unlink("pics/photos/s/$low[photo].jpg");
unlink("pics/photos/m/$low[photo].jpg");
header("location:photos-profile?id=$_SESSION[foto]");
mysql_query("update accounts set photo='',priviMessage='1' where name='".$_SESSION[foto]."'");
}
if(!$_SESSION[foto]) {
header("location:photos-login.php");
}else{
if($_POST[edit] != '') {
mysql_query("update accounts set commentsOnlyFam='".$_POST[commentsOnlyFam]."',ratingEnable='".$_POST[ratingEnable]."', fansEnable='".$_POST[fansEnable]."',commentsEnable='".$_POST[commentsEnable]."',photoTitle='".htmlspecialchars(mysql_real_escape_string(utf8_decode($_POST[title])))."' where name = '".$_SESSION[foto]."'");
header("location:photos-profile.php?id=$_SESSION[foto]");
}
$inhalt .= '
<div class="photo">
<div class="noh1"></div>
<div class="box settings 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 h1"><div class="hbegin"></div><h1>Einstellungen</h1></div>
</div></div>
</div>
<div class="bd fade bd-fade">
<div class="m">
<div class="mi">
<form action="photos-settings.php" method="POST" accept-charset="utf-8" name="edit">';

if($low[photo] != '') {
$inhalt .= '<div class="photosingleview">
<div class="imgcontainer">
<img src="pics/photos/l/'.$low[photo].'.jpg" class="albumimage large" />
</div>
</div>';
}
$inhalt .= '<table class="none photovalues">
<tbody>
<tr id="formline-settings-profileimgbuttons" class="formline formline-settings-profileimgbuttons formres-no formres-noresult-settings-profileimgbuttons ">
<td class="formlabel">
<span class="label"><label for="settings-profileimgbuttons">Profilfoto</label>:</span>
</td><td class="formelement">
<div class="formelementbody">';
if($low[photo] != '') {
$inhalt .= '<div class="bbutton delprofilephoto"><a href="photos-settings?delete"><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-1285401225-img" class="jsFixHeight" style="" height="22" width="" /><div class="btmi"><span class="text">Profilfoto löschen</span></div></div><div class="btbl corner"></div><div class="btbr corner"></div><div class="btbm"></div></a></div>';
}
if($low[commentsEnable] == 1) {
$commentsEnable = 'checked="checked"';
}
if($low[fansEnable] == 1) {
$fansEnable = 'checked="checked"';
}
if($low[ratingEnable] == 1) {
$ratingEnable = 'checked="checked"';
}
if($low[commentsOnlyFam] == 1) {
$commentsOnlyFam = 'checked="checked"';
}
$inhalt .= '
<div class="bbutton uploadbutton"><a href="photos-upload"><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-1494468663-img" class="jsFixHeight" style="" height="22" width="" /><div class="btmi"><span class="text">Neues Profilfoto hochladen</span></div></div><div class="btbl corner"></div><div class="btbr corner"></div><div class="btbm"></div></a></div>

<div class="formerror hidden" id="err-settings-profileimgbuttons">

</div>
</div>
</td>
</tr>
<tr id="formline-settings-photocomment" class="formline formline-settings-photocomment formres-no formres-noresult-settings-photocomment ">
<td class="formlabel">
<span class="label"><label for="settings-photocomment">Bildunterschrift</label>:</span>
</td><td class="formelement">
<div class="formelementbody">
<input type="text" class="text type-String"
name="title" id="settings-photocomment"
value="'.$low[photoTitle].'" /><div class="formerror hidden" id="err-settings-photocomment">

</div>
</div>
</td>
</tr>

</tbody>
</table>
<div class="h h3"><div class="hbegin"></div><h3>Optionen</h3></div>
<table class="none checkboxes"
>
<tbody>
<tr id="formline-settings-commentsonoff" class="formline formline-settings-commentsonoff formres-no formres-noresult-settings-commentsonoff ">
<td class="formlabel">
<span class="label"><label for="settings-commentsonoff">Kommentare erlaubt?</label></span>
</td><td class="formelement">
<div class="formelementbody">
<input type="checkbox" class="checkbox type-String"
name="commentsEnable" value="1" id="settings-commentsonoff" '.$commentsEnable.'
/><div class="formerror hidden" id="err-settings-commentsonoff">

</div>
</div>
</td>

</tr>
<tr id="formline-settings-commentsfamilyonoff" class="formline formline-settings-commentsfamilyonoff formres-no formres-noresult-settings-commentsfamilyonoff ">
<td class="formlabel">
<span class="label"><label for="settings-commentsfamilyonoff">Kommentare nur für Family-Mitglieder?</label></span>
</td><td class="formelement">
<div class="formelementbody">
<input type="checkbox" class="checkbox type-String"
name="commentsOnlyFam" value="1" id="settings-commentsfamilyonoff" '.$commentsOnlyFam.'
 /><div class="formerror hidden" id="err-settings-commentsfamilyonoff">

</div>
</div>
</td>
</tr>
<tr id="formline-settings-ratingonoff" class="formline formline-settings-ratingonoff formres-no formres-noresult-settings-ratingonoff ">
<td class="formlabel">
<span class="label"><label for="settings-ratingonoff">Profilfoto nimmt am Rating teil?</label></span>

</td><td class="formelement">
<div class="formelementbody">
<input type="checkbox" class="checkbox type-String"
name="ratingEnable" value="1" id="settings-ratingonoff" '.$ratingEnable.'
 /><div class="formerror hidden" id="err-settings-ratingonoff">

</div>
</div>
</td>
</tr>
<tr id="formline-settings-fansonoff" class="formline formline-settings-fansonoff formres-no formres-noresult-settings-fansonoff ">
<td class="formlabel">
<span class="label"><label for="settings-fansonoff">Fans erlaubt?</label></span>
</td><td class="formelement">
<div class="formelementbody">
<input type="checkbox" class="checkbox type-String"
name="fansEnable" value="1" id="settings-fansonoff" '.$fansEnable.'
 /><div class="formerror hidden" id="err-settings-fansonoff">

</div>

</div>
</td>
</tr>
</tbody>
</table>
<span class="formline formline-plain formline-settings-save formres-no formres-noresult-settings-save ">
<div class="bbutton submit"><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" class="jsFixHeight" style="" height="22" width="" /><input type="submit" name="edit" value="Speichern" class="image-submit" /><div class="btmi"><span class="text">Speichern</span></div></div><div class="btbl corner"></div><div class="btbr corner"></div><div class="btbm"></div></div>

</form>
</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")));
?>    