if ($id != $user->id && !empty($id)) { try { $user1 = new User(); $user1->db = $db; $user1->getUserInfo($id); } catch (DataException $e) { die(require "blocks/errorTemplate.php"); } } else { $user1 = $user; } $friend = new Friends($user1->id, $db); if ($position == "requests" && empty($id)) { $friendsIds = $selfFriendsRequests; } else { $friendsIds = $friend->getConfirmedFriends(); $friendsCount = count($friendsIds); } for ($i = 0; $i < count($friendsIds); $i++) { $friend->getFriendInfo($friendsIds[$i]); } $friends = Friends::$friend; $endings = array('г', 'га', 'зей'); ?> <!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <link rel="shortcut icon" href="img/favicon.ico"> <link rel="stylesheet" type="text/css" href="css/reset.css"> <link rel="stylesheet" type="text/css" href="css/style.css">
<?php if (!isset($id)) { $id = ""; } if ($user1->pol == 2) { $ending1 = "а"; $ending2 = "ё"; } else { $ending1 = null; $ending2 = "го"; } if ($page != "friends") { // Блок кода приведенный ниже подключается на странице friends.php, и здесь исключается возможность переопределения. $self = new Friends($user->id, $db); $selfFriendsIds = $self->getConfirmedFriends(); $selfNotConfFriends = $self->getNotConfirmedFriends(); $selfFriendsRequests = $self->getFriendsRequests(); $requestsCount = count($selfFriendsRequests); } ?> <div class="leftUserBlock"> <div class="userAvatar"> <img src="avatars/<? echo $user1->avatar; ?>" width="150px" height="150px"> </div> <div class="userFunctions"> <ul> <? if ($id == $user->id || empty($id)) {?> <li <? if($page == "im") echo "class='active'"; ?>><a href="im.php">Личные сообщения</a></li> <? } else {?> <li><a href="im.php">Отправить сообщение</a></li>