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

Размер файла: 2.98Kb
  1. <?
  2. define('SHCMS_ENGINE',true);
  3. include_once('../engine/system/core.php');
  4.  
  5. //Если вместо id num попытаются вставить текст то выводит ошибку
  6. if (!isset($_GET['id']) || !is_numeric($_GET['id']) and $act == '') {
  7. $templates->template(Lang::__('Извините, мы не можем найти это!')); //Название страницы
  8. header('Refresh: 1; url=index.php');
  9. engine::error(Lang::__('Вы запросили профиль несуществующего пользователя.')); //При ошибке
  10. exit;
  11. }
  12. //Если не авторизован пользователь то переадресация на гланую
  13. if(!$id_user and $act != '' and $act != 'friend_list') { //$id_user - id пользователя
  14. header("Location: /index.php"); //Переадресация
  15. exit; //Закрыть дальнейщее действие
  16. }
  17.  
  18. //из $_GET в обычную переменную
  19. $id = (int) $_GET['id'];
  20. //Вывод всех данных из базы по $luser[parametr]
  21. $luser = $db->get_array($db->query("SELECT * FROM `users` WHERE `id` = '".$id."'"));
  22. $iduser = $db->get_array($db->query("SELECT * FROM `users` WHERE `id` = '".$id_user."'"));
  23. //Название страницы
  24. if($act == '') {
  25. $title = ''.$luser['nick'].' - Просмотр профиля';
  26. }elseif($act == 'warnings') {
  27. $title = 'Просмотр профиля: - Предупреждения';
  28. }else {
  29. $title = 'Профиль пользователя';
  30. }
  31. $templates->template($title);
  32. switch($act):
  33. default:
  34. include_once(H.'/modules/profile/view.php');
  35. break;
  36.  
  37. case 'view':
  38. include_once(H.'/modules/profile/view.php');
  39. break;
  40. case 'avatar':
  41. include_once(H.'/modules/profile/avatar.php');
  42. break;
  43. case 'edit_profile':
  44. include_once(H.'/modules/profile/edit.php');
  45. break;
  46. case 'core':
  47. include_once(H.'/modules/profile/core.php');
  48. break;
  49. case 'email':
  50. include_once(H.'/modules/profile/email.php');
  51. break;
  52. case 'act_email':
  53. include_once(H.'/modules/profile/actemail.php');
  54. break;
  55. case 'act_pass':
  56. include_once(H.'/modules/profile/actpass.php');
  57. break;
  58. case 'playname':
  59. include_once(H.'/modules/profile/playname.php');
  60. break;
  61. case 'ignoredusers':
  62. include_once(H.'/modules/profile/ignoredusers.php');
  63. break;
  64. case 'attachments':
  65. include_once(H.'modules/profile/attachments.php');
  66. break;
  67. case 'notificationlog':
  68. include_once(H.'modules/profile/notificationlog.php');
  69. break;
  70. case 'friend_list':
  71. include_once(H.'modules/profile/friend_list.php');
  72. break;
  73. case 'warnings':
  74. include_once(H.'modules/profile/warnings.php');
  75. break;
  76. endswitch;
  77. ?>