Файл: modules/user/privacy.php
Строк: 57
<?php
/**
* Licensed under The MIT License
* For full copyright and license information, please see the LICENSE.txt
* Redistributions of files must retain the above copyright notice.
*
* @copyright Copyright (c) 2013, Taras Chornyi, Sergiy Mazurenko, Ivan Kotliar
* @link http://perf-engine.net
* @package PerfEngine
* @license http://www.opensource.org/licenses/mit-license.php MIT License
*/
$locate = 'in_cabinet';
if(isset($user)) {
if(isset($_POST['save']) && $_GET['act']== 'save') {
$show_email = input($_POST['show_email']);
$view_profile = input($_POST['view_profile']);
$db->query("UPDATE `settings` SET `show_email` = '". $show_email."', `view_profile` = '". $view_profile."' WHERE `user_id` = '". $user['id']."' ");
// print_r($db->errorInfo());
go('/user/privacy/?act=edited');
}
$title = _t('privacy');
include_header($title);
if($_GET['act']=='edited') {$tpl->div('block', _t('succ_save'));}
$tpl->div('title', _t('privacy'));
echo '<div class="post">
<form action="/user/privacy/?act=save" method="post">
<b>'. _t('show_email') .'</b>:<br />
<input type="radio" name="show_email" value="yes"'. ($settings['show_email'] == 'yes'?' checked="checked"':NULL) .' />'. _t('ons') .'
<input type="radio" name="show_email" value="no"'. ($settings['show_email'] == 'no'?' checked="checked"':NULL) .' />'. _t('offs') .'<br />
<b>'. _t('view_profiles') .'</b>:<br />
<input type="radio" name="view_profile" value="all"'. ($settings['view_profile'] == 'all'?' checked="checked"':NULL) .' />'. _t('alls') .'
<input type="radio" name="view_profile" value="regs"'. ($settings['view_profile'] == 'regs'?' checked="checked"':NULL) .' />'. _t('regs') .'
<input type="radio" name="view_profile" value="self"'. ($settings['view_profile'] == 'self'?' checked="checked"':NULL) .' />'. _t('selfs') .'<br />
<input type="submit" name="save" value="'. _t('save') .'" />
</form>
</div>';
$tpl->div('block', NAV.'<a href="/user/panel/">'._t('user_panel').'</a><br/>'. HICO .'<a href="/">'. _t('home') .'</a>');
include_footer();
} else { go('/'); }
?>