Server IP : 80.87.202.40 / Your IP : 216.73.216.169 Web Server : Apache System : Linux rospirotorg.ru 5.14.0-539.el9.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Dec 5 22:26:13 UTC 2024 x86_64 User : bitrix ( 600) PHP Version : 8.2.27 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /home/bitrix/ext_www/ilovecveti.ru/bitrix/modules/seo/lib/retargeting/services/ |
Upload File : |
<? namespace Bitrix\Seo\Retargeting\Services; use Bitrix\Main\Context; use Bitrix\Main\Web\Json; use Bitrix\Main\Web\Uri; use \Bitrix\Seo\Retargeting\Account; use Bitrix\Main\Result; use Bitrix\Main\Type\Date; class AccountVkontakte extends Account { const TYPE_CODE = 'vkontakte'; protected static $listRowMap = array( 'ID' => 'ACCOUNT_ID', 'NAME' => 'NAME', ); public function getList() { $result = $this->getRequest()->send([ 'methodName' => 'retargeting.account.list', ]); if ($result->isSuccess()) { $list = []; while ($item = $result->fetch()) { if ( ( isset($item['CLIENT_NAME']) || isset($item['NAME']) ) && isset($item['ID']) ) { $list[] = [ 'NAME' => !empty(trim($item['CLIENT_NAME'])) ? $item['CLIENT_NAME'] : $item['NAME'], 'ACCOUNT_ID' => $item['ID'], ]; } } $result->setData($list); } return $result; } public function getProfile() { $response = $this->getRequest()->send(array( 'methodName' => 'retargeting.profile', 'parameters' => array() )); if ($response->isSuccess()) { $data = $response->fetch(); return array( 'ID' => $data['ID'], 'NAME' => $data['FIRST_NAME'] . ' ' . $data['LAST_NAME'], 'LINK' => 'https://vk.com/' . $data['SCREEN_NAME'], 'PICTURE' => (Context::getCurrent()->getRequest()->isHttps() ? 'https' : 'http') . '://' . Context::getCurrent()->getServer()->getHttpHost() . '/bitrix/images/seo/integration/vklogo.svg', ); } return null; } }