G
G
Greg Plitt2016-05-06 09:52:10
PHP
Greg Plitt, 2016-05-06 09:52:10

How to display a list of groups through the Bitrix API?

Good afternoon!
I've been suffering with the same problem for a long time. Regarding the social network module from Bitrix.
On the /club/ page,
I need to display a list of groups ( socialnetwork.user_group ) that are in the system (in my case, they are all created by the admin and there will be no other groups), and under this list display a live feed ( bitrix:socialnetwork )
i.e. there are two components on one page immediately involved.
And everything works fine if you are an administrator yourself, then the situation is as follows:
3942b608f5b7462fa7a257d2c26bad8e.jpg
But it’s worth logging in as a different user.
d881c4a37fa641ef9353f96879bdde65.jpg
As groups become inaccessible, more precisely, you can go to them via direct links, but I just need to display this list of groups for all users.
Bitrix support gave strange answers around the bush, and then said
"In this case, you will have to get this list of groups through the API and display it in the right place. An example of selecting groups can be seen in the same component bitrix:socialnetwork.user_groups"
But with the API I not at all familiar ... here, as I understand it, there will be no more assistants in support.
Maybe here a hundred came across a similar one, or at least understands how to insert a piece of the request into php?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
P
Pavel Shcheglov, 2016-05-06
@webfarrock

Advice - start using the API
Many things are easier/faster to write yourself than cut out from ready-made components
In this case, you probably need this method dev.1c-bitrix.ru/api_help/socialnetwork/classes/cs
...
group method are cut based on permissions ($arFilter CHECK_PERMISSIONS)
To display all groups, you just need to make $arFilter empty

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question