Get user guid

Hi, I'm a beginner in php and in elgg.

I can ask the database myself and code in php myself BUT, I do have a problem I'm trying to tweak the friendrequest plugin to only allow friendship between group of people I choosed.

I need to ask elgg for the curent user guid and friend guid. I get functions on the web but I can't make it work :/

I am really beginning in functions, if u could get me the really tiny piece of code wich ask elgg the guid and prompt it in a "$guid_searched" I would be so glad.

Thank u all for your support :)

  • just a last question, is there a way to force friendship between two id's?

  • add_entity_relationship($friend->getGUID(), "friend", $user->getGUID())

     

    will create the friendship.  In order to 'force' it, you'd have to put in checks to make sure that it's not removed.  This can be done with a plugin hook for 'delete', 'friend'

  • Hi,

    thank you.

    How should I do in order to make this being a plugin?

  • noone can help in making a plugin?

    I need to know how to tell elgg to overwrite the plugin friend_request...

  • What to override of the friend_request plugin? It's quite difficult to tell you what to do when we don't know what you have modified exactly.

    Do you really think it necessary to make it a separate plugin? It seems to me you made some changes that are very specific (maybe only useful for you). It might be easier to just modify the friend_request plugin directly on your site. Of course, you would need to take care to preserve your modiffications when a new release of the friend_request plugin is available. But it's quite likely that you would need to make sure that any changes you would have made via a separate plugin still work, too. So I don't think you would gain much in any way you would handle it.

  • ok that was exactly what I was worrying about.

    I was afraid to do changes inside the plugin.

  • waw I could find my old post back. I decided to continue my project.

    Anyone can help making a plugin? I didn't do any change exept those quoted above. I just tried to disallow friendship between men and women for a very specific community needs.

Beginning Developers

Beginning Developers

This space is for newcomers, who wish to build a new plugin or to customize an existing one to their liking