0) ? intval($_REQUEST["page"]) : 1; $pathToUserProfile = (isset($_REQUEST["pathToUserProfile"]) && is_string($_REQUEST["pathToUserProfile"])) ? trim($_REQUEST["pathToUserProfile"]) : ""; use Bitrix\Socialnetwork\Livefeed; use Bitrix\Main\Loader; $result = array(); if( check_bitrix_sessid() && Loader::includeModule("socialnetwork") && in_array($action, array('set_content_view', 'get_view_list')) ) { if ( $action == 'set_content_view' && !empty($xmlIdList) ) { foreach($xmlIdList as $val) { $xmlId = $val['xmlId']; $save = (!isset($val['save']) || $val['save'] != 'N'); $tmp = explode('-', $xmlId, 2); $entityType = trim($tmp[0]); $entityId = intval($tmp[1]); if ( !empty($entityType) && $entityId > 0 ) { $provider = Livefeed\Provider::init(array( 'ENTITY_TYPE' => $entityType, 'ENTITY_ID' => $entityId, )); if ($provider) { $provider->setContentView(array( 'save' => $save )); } } } } elseif ( $action == 'get_view_list' && !empty($contentId) ) { $userList = \Bitrix\Socialnetwork\Item\UserContentView::getUserList(array( 'contentId' => $contentId, 'page' => $page, 'pathToUserProfile' => $pathToUserProfile )); $result['items'] = $userList['items']; $result['itemsCount'] = count($result['items']); $result['hiddenCount'] = $userList['hiddenCount']; } $result["SUCCESS"] = "Y"; } if (empty($_REQUEST['mobile_action'])) { header('Content-Type: application/x-javascript; charset='.LANG_CHARSET); } echo CUtil::PhpToJSObject($result); \CMain::finalActions(); die; ?>