Файл: monst/core/pag/setting/theme.php
Строк: 48
<?
if ( !empty($_POST['color']) ) {
$color = null_html($_POST['color']);
// if ( substr($color, 0, 1) != '#' OR strlen($color) != 7 OR !preg_match('/^[a-z0-9#]*$/', $color) ) {
// g('/main');
// }
if (!preg_match('/^[a-z0-9#]*$/', $color) ) {
g('/main');
}
$_users -> update(
[
'id' => $user['id']
],
[
'$set' => [
'theme_color' => $color,
]
]
);
g('/setting/theme');
} else {
?>
<script src='/core/j/jquery-3.2.1.min.js'></script>
<script src='/core/j/jscolor.min.js'></script>
<div class='padding' style='text-ali2gn: center;'>
<div id='box' style='display: inline-block; width: 25px; height: 25px; background: <?=$user['theme_color']?>;'></div>
<span id='name' style='color: <?=$user['theme_color']?>;'><?=$lang['setting.php']['theme']['example']?></span>
<br/><br/>
<button style='border: 0; padding: 10px;' class="jscolor {valueElement:'chosen-value', onFineChange:'setTextColor(this)'}">
<?=$lang['setting.php']['theme']['sel']?>
</button>
</div>
<br/><br/>
<div style='text-align: center;'>
<form method='post' action='/setting/theme'>
<input name='color' id='color' value='<?=$user['theme_color']?>'/><br/>
<input type='submit' value='<?=$lang['setting.php']['theme']['submit']['save']?>'/>
</form>
</div>
<br/>
<div>
<a href='/setting'><?=$lang['setting.php']['back']?></a>
</div>
<script>
function setTextColor(picker) {
$("#box").css('background', '#' + picker.toString());
$("#name").css('color', '#' + picker.toString());
$("#color").val('#' + picker.toString());
}
</script>
<?
}