akrivola (08 Сентябрь 2016 - 11:54) писал:
Та же история, пока не разобрался в чем дело. Если найду решение - отпишусь тут
11 публикаций создано BorisSuvorov (учитываются публикации только с 14-Май 23)
Отправлено от BorisSuvorov в 11 Сентябрь 2016 - 02:32 in Как это сделать
Отправлено от BorisSuvorov в 06 Сентябрь 2016 - 03:43 in Как это сделать
$fields = [ 'photo_id', 'verified', 'sex', 'bdate', 'city', 'country', 'home_town', 'has_photo', 'photo_50', 'photo_100', 'photo_200_orig', 'photo_200', 'photo_400_orig', 'photo_max', 'photo_max_orig', 'online', 'lists', 'domain', 'has_mobile', 'contacts', 'site', 'education', 'universities', 'schools', 'status', 'last_seen', 'followers_count', 'common_count', 'occupation', 'nickname', 'relatives', 'relation', 'personal', 'connections', 'exports', 'wall_comments', 'activities', 'interests', 'music', 'movies', 'tv', 'books', 'games', 'about', 'quotes', 'can_post', 'can_see_all_posts', 'can_see_audio', 'can_write_private_message', 'can_send_friend_request', 'is_favorite', 'is_hidden_from_feed', 'timezone', 'screen_name', 'maiden_name', 'crop_photo', 'is_friend', 'friend_status', 'career', 'military', 'blacklisted', 'blacklisted_by_me' ]; $request_params = [ 'user_ids' => $line['id пользователя'], 'name_case' => 'nom', 'fields' => implode(',',$fields), 'access_token' => 'тут_токен' ]; $url = "https://api.vk.com/method/users.get?".http_build_query($request_params); $result = file_get_contents($url); $line['Массив ВК'] = $result;
Отправлено от BorisSuvorov в 16 Сентябрь 2016 - 10:09 in Как это сделать
$userfirst = $line['VK (личная)']; // получаем короткое имя из url $whatis = substr($userfirst, 0,5); if($whatis="https"){ $userid = substr($userfirst, 15); } elseif ($whatis="http"){ $userid = substr($userfirst, 14); } elseif ($whatis="vk.co"){ $userid = substr($userfirst, 7); } $fields = array ( 'photo_id', 'verified', 'sex', 'bdate', 'city', 'country', 'home_town', 'has_photo', 'photo_200', 'online', 'lists', 'domain', 'has_mobile', 'contacts', 'site', 'status', 'last_seen', 'followers_count', 'common_count', 'nickname', 'relatives', 'relation', 'personal', 'connections', 'exports', 'wall_comments', 'activities', 'interests', 'about', 'can_post', 'can_see_all_posts', 'can_see_audio', 'can_write_private_message', 'can_send_friend_request', 'screen_name', 'maiden_name', 'counters', 'first_name_gen', 'last_name_gen', ); $request_params = array ( 'user_ids' => $userid, 'name_case' => 'nom', 'fields' => implode(',',$fields), 'access_token' => 'сюда вставляем токен', // 'captcha_sid' => 380354804047, эти два поля использовал один раз для ввода капчи, больше не потребовались // 'captcha_key'=>'vz5qxqa' ); $url = "https://api.vk.com/method/users.get?".http_build_query($request_params); $ch = curl_init($url); curl_setopt($ch,CURLOPT_RETURNTRANSFER,TRUE); curl_setopt($ch,CURLOPT_SSL_VERIFYHOST,false); curl_setopt($ch,CURLOPT_SSL_VERIFYPEER,false); curl_setopt($ch,CURLOPT_FOLLOWLOCATION,true); $json = curl_exec($ch); curl_close($ch); $json_decode = json_decode($json , true); $line['id VK'] = $json_decode["response"][0]["uid"]; //Id пользователя $line['Имя'] = $json_decode["response"][0]["first_name"]; //Имя $line['Фамилия'] = $json_decode["response"][0]["last_name"]; //Фамилия if(!$line['Артист']){ $line['Артист']=$line['Имя'] ." ".$line['Фамилия'] ; } $gender = $json_decode["response"][0]["sex"]; //Пол if($gender==0) { $line['Пол'] = "Не известно"; } elseif ($gender==1) { $line['Пол'] = "Женский"; } elseif ($gender==2) { $line['Пол'] = "Мужской"; } $line['Дата рождения'] = $json_decode["response"][0]["bdate"]; //Дата рождения $cityid = $json_decode["response"][0]["city"]; //Получаем id города $city_params = array ( 'city_ids' => $cityid, ); $cityurl= "https://api.vk.com/method/database.getCitiesById?".http_build_query($city_params); //$cityjson = file_get_contents($cityurl); $cityculr= curl_init($cityurl); curl_setopt($cityculr,CURLOPT_RETURNTRANSFER,TRUE); curl_setopt($cityculr,CURLOPT_SSL_VERIFYHOST,false); curl_setopt($cityculr,CURLOPT_SSL_VERIFYPEER,false); curl_setopt($$cityculr,CURLOPT_FOLLOWLOCATION,true); $cityjson = curl_exec($cityculr); curl_close($cityculr); $city_json_decode = json_decode($cityjson , true); $line['Город'] = $city_json_decode["response"][0]["name"]; //Выводим название города $countryid = $json_decode["response"][0]["country"]; //Получаем id страны $country_params = array ( 'country_ids' => $countryid, ); $countryurl= "https://api.vk.com/method/database.getCountriesById?".http_build_query($country_params); //$countryjson = file_get_contents($countryurl); $countr = curl_init($countryurl); curl_setopt($countr,CURLOPT_RETURNTRANSFER,TRUE); curl_setopt($countr,CURLOPT_SSL_VERIFYHOST,false); curl_setopt($countr,CURLOPT_SSL_VERIFYPEER,false); curl_setopt($countr,CURLOPT_FOLLOWLOCATION,true); $countryjson = curl_exec($countr); curl_close($countr); $country_json_decode = json_decode($countryjson , true); $line['Страна'] = $country_json_decode["response"][0]["name"]; //Выводим название страны $line['Фото'] = "<img src=".$json_decode["response"][0]["photo_200"].">"; //Ссылка на фото if(!$line['Телефон']){ $line['Телефон'] = $json_decode["response"][0]["mobile_phone"]; //Телефон } if(!$line['Сайт артиста']){ $line['Сайт артиста'] = $json_decode["response"][0]["site"]; //Сайт } $twittet = $json_decode["response"][0]["twitter"]; //Твиттер if($twittet){ $line['Twitter'] = "https://twitter.com/".$twittet; } $insta = $json_decode["response"][0]["instagram"]; //Инстаграмм if($insta){ $line['Instagram'] = "https://www.instagram.com/".$insta; } $last_seen_code = $json_decode["response"][0]["last_seen"]["time"]; //Последний визит $line['Последний онлайн ВК'] = date("y-m-d h:i:s", $last_seen_code ); $line['Интересы'] = $json_decode["response"][0]["interests"]; //Интересы $line['Деятельность'] = $json_decode["response"][0]["activities"]; //Деятельность $superstar = $json_decode["response"][0]["verified"]; //Звезда if($superstar==0) { $line['Звезда'] = "Нет"; } elseif ($superstar==1) { $line['Звезда'] = "Да"; } $friends = $json_decode["response"][0]["counters"]["friends"]; //Число Друзей $followers = $json_decode["response"][0]["counters"]["followers"]; //Число подписчиков $line['VK (к-во подп. Личной Страницы)'] = $friends + $followers; //Друзья + подписчики $name_gen = $json_decode["response"][0]["first_name_gen"]; //Имя в родительном падеже $last_name_gen = $json_decode["response"][0]["last_name_gen"]; //Фамилия в родительном падеже $gen = $name_gen . " " . $last_name_gen; $line['Имя для рассылки (в род. падеже)'] = $gen;
Отправлено от BorisSuvorov в 14 Сентябрь 2016 - 10:38 in Как это сделать
$userid = $line['vkid']; $fields = array ( 'photo_id', 'verified', 'sex', 'bdate', 'city', 'country', 'home_town', 'has_photo', 'photo_200', 'online', 'lists', 'domain', 'has_mobile', 'contacts', 'site', 'status', 'last_seen', 'followers_count', 'common_count', 'nickname', 'relatives', 'relation', 'personal', 'connections', 'exports', 'wall_comments', 'activities', 'interests', 'about', 'can_post', 'can_see_all_posts', 'can_see_audio', 'can_write_private_message', 'can_send_friend_request', 'screen_name', 'maiden_name', 'counters', 'first_name_gen', 'last_name_gen', ); $request_params = array ( 'user_ids' => $userid, 'name_case' => 'nom', 'fields' => implode(',',$fields), 'access_token' => 'тут_токен' ); $url = "https://api.vk.com/method/users.get?".http_build_query($request_params); $json = file_get_contents($url); $json_decode = json_decode($json , true); $line['Имя'] = $json_decode["response"][0]["first_name"]; //Имя
Отправлено от BorisSuvorov в 13 Сентябрь 2016 - 09:39 in Как это сделать
maksn (13 Сентябрь 2016 - 08:43) писал:
Отправлено от BorisSuvorov в 13 Сентябрь 2016 - 06:31 in Как это сделать
Отправлено от BorisSuvorov в 06 Сентябрь 2016 - 03:32 in Как это сделать
Отправлено от BorisSuvorov в 16 Сентябрь 2016 - 10:05 in Как это сделать
Отправлено от BorisSuvorov в 16 Сентябрь 2016 - 09:30 in Как это сделать
$sqlQuery = "SELECT * FROM ".DATA_TABLE."311 WHERE status=0 AND f7711='".$line['Похожий артист']['ID']."'"; $res = sql_query($sqlQuery); foreach ($res as $value) { $row = sql_fetch_array($res); $data_arr['Email (р)'] = $line['ID']; $data_arr['Песня'] = $row['f4761']; $data_arr['Прослушать'] = $row['f7221']; $data_arr['Soundcloud'] = $row['f4941']; insert_query($data_arr, "Рассылка"); }
Отправлено от BorisSuvorov в 05 Сентябрь 2016 - 11:45 in Как это сделать
$field_id = '4601'; //id поля, где расположено название файла $line_id = $line['ID']; $fname = $line['Файл с демо']; $fpath = get_file_path($field_id, $line_id, $fname); $line['Прослушать'] = '<audio controls="" name="media"><source src="'.$fpath.'" type="audio/mp3"></audio>'; // Результат вывожу в текстовое поле с html форматированием, чтобы иметь возможность прослушивать файл из браузера
Отправлено от BorisSuvorov в 03 Октябрь 2016 - 10:48 in Как это сделать