Просмотр файла modules/user/privacy.php

Размер файла: 1.97Kb
  1. <?
  2. /**********************************
  3. * @package: PerfCMS *
  4. * @year: 2012 *
  5. * @author: Artas *
  6. * @link: http://perfcms.pp.ua *
  7. **********************************/
  8. $locate = 'in_cabinet';
  9. if(isset($user)) {
  10. if(isset($_POST['save']) && $_GET['act']== 'save') {
  11. $show_email = input($_POST['show_email']);
  12. $view_profile = input($_POST['view_profile']);
  13. $db->query("UPDATE `settings` SET `show_email` = '". $show_email."', `view_profile` = '". $view_profile."' WHERE `user_id` = '". $user['id']."' ");
  14. // print_r($db->errorInfo());
  15. go('/user/privacy/?act=edited');
  16. }
  17.  
  18. $title = $lang->word('privacy');
  19. require_once(SYS.'/view/header.php');
  20. if($_GET['act']=='edited') {$tpl->div('block', $lang->word('succ_save'));}
  21. $tpl->div('title', $lang->word('privacy'));
  22. echo '<div class="post">
  23. <form action="/user/privacy/?act=save" method="post">
  24. <b>'. $lang->word('show_email') .'</b>:<br />
  25. <input type="radio" name="show_email" value="yes"'. ($settings['show_email'] == 'yes'?' checked="checked"':NULL) .' />'. $lang->word('ons') .'
  26. <input type="radio" name="show_email" value="no"'. ($settings['show_email'] == 'no'?' checked="checked"':NULL) .' />'. $lang->word('offs') .'<br />
  27. <b>'. $lang->word('view_profiles') .'</b>:<br />
  28. <input type="radio" name="view_profile" value="all"'. ($settings['view_profile'] == 'all'?' checked="checked"':NULL) .' />'. $lang->word('alls') .'
  29. <input type="radio" name="view_profile" value="regs"'. ($settings['view_profile'] == 'regs'?' checked="checked"':NULL) .' />'. $lang->word('regs') .'
  30. <input type="radio" name="view_profile" value="self"'. ($settings['view_profile'] == 'self'?' checked="checked"':NULL) .' />'. $lang->word('selfs') .'<br />
  31. <input type="submit" name="save" value="'. $lang->word('save') .'" />
  32. </form>
  33. </div>';
  34. $tpl->div('block', NAV.'<a href="/user/panel/">'.$lang->word('user_panel').'</a><br/>'. HICO .'<a href="/">'. $lang->word('home') .'</a>');
  35. require_once(SYS.'/view/footer.php');
  36. } else { go('/'); }
  37. ?>