@vovaburyii

Как вывести информацию о друге?

Вопрос по поводу Devel Studio: есть у меня список друзей (вывел через api Вк), на этом списке стоит событие клик... когда нажимаю на имя и фамилию друга то показывает мою информацию а не друга, подскажите как реализовать информацию друга! Буду очень благодарен!
ЗЫ: вот пхп код на страницу профиля :
class Profile{
	
	function User($uid){
		$user = VK::request('users.get', 'user_id=' . $uid . '&fields=photo_200,bdate,city,country,followers_count,online,online_mobile,contacts,connections,status,last_seen,counters,sex');
		if(!$user){
			messageDlg("Не удалось получить информацию о пользователе!", mtConfirmation, MB_OK);
		}else{
			c('User->imageUser')->loadFromUrl($user['response']['0']['photo_200']);
			c('User->firstName')->caption = iconv('UTF-8', 'cp1251', $user['response']['0']['first_name']);
			c('User->lastName')->caption = iconv('UTF-8', 'cp1251', $user['response']['0']['last_name']);
			c('User->status')->text = iconv('UTF-8', 'cp1251', $user['response']['0']['status']);
			c('User->bDate')->caption = iconv('UTF-8', 'cp1251', $user['response']['0']['bdate']);
			c('User->Id')->caption = $user['response']['0']['uid'];
			c('User->followers')->caption = iconv('UTF-8', 'cp1251', $user['response']['0']['followers_count']);
			c('User->friends')->caption = iconv('UTF-8', 'cp1251', $user['response']['0']['counters']['friends']);
			c('User->photos')->caption = iconv('UTF-8', 'cp1251', $user['response']['0']['counters']['photos']);
			c('User->groups')->caption = iconv('UTF-8', 'cp1251', $user['response']['0']['counters']['groups']);
			c('User->videos')->caption = iconv('UTF-8', 'cp1251', $user['response']['0']['counters']['videos']);
			c('User->audios')->caption = iconv('UTF-8', 'cp1251', $user['response']['0']['counters']['audios']);
			if($user['response']['0']['online'] == 1){
				if($user['response']['0']['online_mobile'] == 1){
					c("User->online")->caption = "В сети(м)";
				}else{
					c("User->online")->caption = "В сети";
				}
			}elseif($user['response']['0']['deactivated'] == 'banned'){
				messageDlg("Страница пользователя заморожена!", mtConfirmation, MB_OK);
				exit;
			}elseif($user['response']['0']['deactivated'] == 'deleted'){
				messageDlg("Страница пользователя удалена!", mtConfirmation, MB_OK);
				exit;
			}else{
				c("User->online")->caption = "Был в сети";
				c("User->dateOnline")->caption =  date("d.m.y H:i", $user['response']['0']['last_seen']['time']);
			}
			LoadForm(c("User"), LD_NONE);
		}
	}
}


а это список друзей:
class Friends{
	
	function get($uid){
		$get = VK::request('friends.get', 'user_id=' . $uid . '&order=hints&fields=online,last_seen,online_mobile');
		$friendsall = VK::request('users.get', 'user_id=' . $uid . '&fields=counters');
		if(!$get){
			messageDlg("Не удалось получить список друзей!", mtConfirmation, MB_OK);
		}else{
			c('Friends->all')->caption = iconv('UTF-8', 'cp1251', $friendsall['response']['0']['counters']['friends']);
			for($i = 0; $i < count($get['response']); $i++){
				if($get['response']["$i"]['online'] == 0){
					if($get['response']["$i"]['last_seen']['platform'] == 1){
						c('Friends->listFriends')->text .= iconv("UTF-8", "cp1251", $get['response']["$i"]['first_name']) . ' ' . iconv("UTF-8", "cp1251", $get['response']["$i"]['last_name']) . '  (Mobile)';
					}elseif($get['response']["$i"]['last_seen']['platform'] == 2){
						c('Friends->listFriends')->text .= iconv("UTF-8", "cp1251", $get['response']["$i"]['first_name']) . ' ' . iconv("UTF-8", "cp1251", $get['response']["$i"]['last_name']) . '  (iPhone)';
					}elseif($get['response']["$i"]['last_seen']['platform'] == 3){
						c('Friends->listFriends')->text .= iconv("UTF-8", "cp1251", $get['response']["$i"]['first_name']) . ' ' . iconv("UTF-8", "cp1251", $get['response']["$i"]['last_name']) . '  (iPad)';
					}elseif($get['response']["$i"]['last_seen']['platform'] == 4){
						c('Friends->listFriends')->text .= iconv("UTF-8", "cp1251", $get['response']["$i"]['first_name']) . ' ' . iconv("UTF-8", "cp1251", $get['response']["$i"]['last_name']) . '  (Android)';
					}elseif($get['response']["$i"]['last_seen']['platform'] == 5){
						c('Friends->listFriends')->text .= iconv("UTF-8", "cp1251", $get['response']["$i"]['first_name']) . ' ' . iconv("UTF-8", "cp1251", $get['response']["$i"]['last_name']) . '  (WPhone)';
					}elseif($get['response']["$i"]['last_seen']['platform'] == 6){
						c('Friends->listFriends')->text .= iconv("UTF-8", "cp1251", $get['response']["$i"]['first_name']) . ' ' . iconv("UTF-8", "cp1251", $get['response']["$i"]['last_name']) . '  (Win8)';
					}elseif($get['response']["$i"]['last_seen']['platform'] == 7){
						c('Friends->listFriends')->text .= iconv("UTF-8", "cp1251", $get['response']["$i"]['first_name']) . ' ' . iconv("UTF-8", "cp1251", $get['response']["$i"]['last_name']) . '  (Browser)';
					}
				}elseif($get['response']["$i"]['online_mobile'] == 1){
						c('Friends->listFriends')->text .= iconv("UTF-8", "cp1251", $get['response']["$i"]['first_name']) . ' ' . iconv("UTF-8", "cp1251", $get['response']["$i"]['last_name']) . '  •(Mobile)';
				}elseif($get['response']["$i"]['online'] == 1){
					c('Friends->listFriends')->text .= iconv("UTF-8", "cp1251", $get['response']["$i"]['first_name']) . ' ' . iconv("UTF-8", "cp1251", $get['response']["$i"]['last_name']) . '  •';
				}
			}
		}
	}
}
  • Вопрос задан
  • 248 просмотров
Пригласить эксперта
Ваш ответ на вопрос

Войдите, чтобы написать ответ

Похожие вопросы