By Christopher caruk on Friday, 11 July 2014
Posted in Technical Issues
Replies 11
Likes 0
Views 1.3K
Votes 0
Hello,

I am creating a plugin that will link EasySocial and Joomla groups... Creating one will automatically create the other. Adding a person to one will automatically add the same user to the other.

I am doing this so I can use EasyDiscuss with EasySocial within groups.

We are currently stuck at the point where we are trying to create an EasySocial group when someone creates a Joomla Group. Can you please help us identify which function within EasySocial to call to create a group.

Thanks for the help.
Chris
Hello Christopher,

Take a look at the file /components/com_easysocial/controllers/groups.php
·
Friday, 11 July 2014 23:55
·
0 Likes
·
0 Votes
·
0 Comments
·
Hi,
I need API to create, update, delete group, example:
new a group instant, then call api to create new group (same with update, delete)

my request: if create Joomla group under specific parent -> plugin creates easy social group

Could you help me?
·
Saturday, 12 July 2014 22:18
·
0 Likes
·
0 Votes
·
0 Comments
·
Hello Christopher,

I can't really help you extensively as this requires quite a bit of work but if you take a look at the example codes from that file, it would give you an idea on how you could create / update / delete an EasySocial group
·
Sunday, 13 July 2014 13:16
·
0 Likes
·
0 Votes
·
0 Comments
·
Hi Mark,

Thank you for responding. The last question was from a gentleman named Han... He is helping me write the code for the plugin.

I understand that a full blown API would be allot of work for you.

From your experience as an expert joomla developer... Do you think that it would be simpler for us to create a helper that sits somewhere within easySocial, with the functions that we need OR replicate the necessary code within our own plugin? My gut feel is that creating a small helper would be easiest and safest way because then we do not have to worry about local dependencies within the groups class and because we would avoid a longer term problem with compatibility if/when the groups class changes. If you think that it would be good to have, I would be happy to donate the helper and perhaps even the plugin to easySocial.

Perhaps you would approach this from a different angle? What do you think?

Thanks Again
Chris
·
Sunday, 13 July 2014 18:21
·
0 Likes
·
0 Votes
·
0 Comments
·
Hi Again Mark,

Perhaps I should have also mentioned that Han was the fellow who wrote the EasySocial/Zoo app... He's an extremely versatile programmer with good knowledge of Joomla, EasySocial and Zoo. Han meet Mark... Mark, meet Han.

On a related note... I'm not sure is Benoit is still feeling bad that no one else contributed to the development. I am still of the opinion that it should be donated to Stack Ideas for all to use. If of interest to you, I'll have a word with him about it.

Kind Regards
Chris
·
Sunday, 13 July 2014 18:29
·
0 Likes
·
0 Votes
·
0 Comments
·
Hello Christopher,

It's best to do this via an app because that would be less troublesome in the future If you are looking for an "easy way out", probably hacking the controller file would be the easiest but do keep in mind that you will have maintenance nightmare in the future and you will have troubles upgrading in the future.

In my personal opinion, it's NEVER a good idea to hack the core files. You might find it easier now to add your hacks in the controller, but down the road, you'll most likely be sitting down swearing at the developers of EasySocial for releasing updates so quickly
·
Sunday, 13 July 2014 21:57
·
0 Likes
·
0 Votes
·
0 Comments
·
Hi Mark,

Thanks for the response. I completely agree re maintainability and hacking core files… I was thinking more of a helper that would sit alongside the core files just to ensure that all path based inclusions work… but I’m far from a Joomla expert.

An app? Wont that make it difficult to draw in the functionality from other Joomla components? Can an app be hidden? Were basically just doing a bit of background work when someone creates a Joomla group in an area that’s synced with ES. From a Joomla perspective isn’t this what plugins are meant to be for? Surely an app is only in context when ES is being displayed?

Thanks Again
Chris

P.S. Apologies for replying to the mail rather than responding here... Somehow I thought that the mail would get added to the thread. I know this really cool extension called EasyDiscuss that will do this. You guys should check it out
·
Monday, 14 July 2014 06:09
·
0 Likes
·
0 Votes
·
0 Comments
·
Hello Christopher,

Yes, apps are not always visible. If you look at some of our apps, they don't actually display anything. It's more of an app that performs specific logics when certain actions occurs.
·
Monday, 14 July 2014 10:59
·
0 Likes
·
0 Votes
·
0 Comments
·
Hello Again,

I've been revisiting the whole joomla / EasySocial group sync thing. My first stop was the API documentation.

Strangely I do not see anything in there for groups. Lots of coverage for Users and even a way to add a user to a Joomla group but nothing there to allow me to add users to or create groups in EasySocial.

Is there someplace else I should be looking?

Thanks
Chris
·
Saturday, 11 April 2015 21:17
·
0 Likes
·
0 Votes
·
0 Comments
·
subscribe++
·
Saturday, 11 April 2015 22:40
·
0 Likes
·
0 Votes
·
0 Comments
·
Hello Christopher,

We're actually in the midst of reworking on our documentation but at the mean time, you should take a look at the file /administrator/components/com_easysocial/includes/group/group.php . These are some of the available API methods which you can call. For instance,


$group = FD::group($id);
$group->createMember($userId);
·
Sunday, 12 April 2015 15:29
·
0 Likes
·
0 Votes
·
0 Comments
·
View Full Post