change friend_request

Could someone give me a hint. I have the freind_request plugin installed on my network. However I needed to have installed another friend_request plugin, identical would only change translation. This is why I would use the second friend_request for my users to mark other users as real members who have already met. I know that it is not possible to have two identical plugins enabled. Just changing the word friend_request in all plugin files would I be able to activate this second plugin?
  • Just changing the word friend_request in all plugin files would I be able to activate this second plugin?

    Bad idea.

    Just copy language file from 'another friend_request plugin' to 'friend_request plugin' instead.

    E.g.:

    from mod/another_friend_request/languages/pt_br.php
    to mod/friend_request/languages/pt_br.php

    In this case, you shouldn't install 'another friend_request plugin'.

     

    Or create a new plugin (you can use My plugin also) and repeat above step:

    from mod/another_friend_request/languages/pt_br.php
    to mod/my_plugin/languages/pt_br.php

    In this case, you should install my_plugin and move it at the bottom, after 'friend_request'.

  • It's not as simple as to just modify the language file if you want to make use of both the original friend_request plugin (more importantly: still keep the "friend" relationship in its original functionality in use) and a second "real_life_friends" plugin.

    Even if you would only want to offer the "real_life_friends" functionality replacing the meaning of just a "friends" relationship you would also have to override some language strings of Elgg core that also handle the friends functionality because the friends_request plugin only adds some additional functionality and modifies existing functionality of Elgg core respectively.

    If you would want to keep the original "friends" functionality unchanged (and also want to keep the friends_request plugin in use in parallel to your "real_life_friends" plugin) you could start with the friends_request plugin to create a clone. But in addition to changing the language file only you would also have to change for example the function names as they need to be unique. And you would have to introduce your own relationship (relationship name) as using the existing "friend" relationship would not work (and friend would be a "real_life_friend" if the relationship is handled by the same relationship name). As the friend_request plugin only adds some additional functionality (dealing with the creation and deletion of the friend relationship but nothing between), you most likely would have to clone/adjust some friend functionality of Elgg core, too (e.g. real_life_friend page, widgets etc.). It shouldn't be too difficult to get this done. It would just take some time. One point would be difficult though: access control. The friend relationship isn't just some "visual" thing (that would just show which user is friend with another user) but also is used as an access level to restrict access to content (or some functionality) to friends only. It would be much more complicated if "real_life_friends" should also have some specific access restrictions. If this is not intended and it's only meant to have some visual indication of who knows who beyond the scope of the site community it would make this much easier.

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