Everyone Friends v0.2

Release Notes

I thought it was about time I updated this! The plugin has now been updated to automatically use Elgg's database settings, and automatically fill in the correct table prefix as suggested by Evan Winslow. I've also updated to the new manifest.xml format, although left the legacy one there as an option. I've briefly tested this new version today with Elgg 1.8.15 and it still works. I was unable to replicate the error ranok37 posted so should be ok.

  • Hi, I use your plugin, and it is very usefull.

    But it fails with the elgg 1.9rc release.

    Do you have some plans to migrate your plugin to be supported by elgg 1.9 ?

  • To avoid the error "time_created doesn't have a default value" in everyonefriends.php script:

    LINE 15:
    $addToFriends = "INSERT INTO ".$CONFIG->dbprefix."entity_relationships (guid_one,relationship,guid_two,time_created) VALUES";

    LINE 33:
    $addToFriends .= ", (".$value.",'friend',".$user.",".time().")";

    LINE 37:
    $addToFriends .= " (".$value.",'friend',".$user.",".time().")";

  • @Xavier - There is no Elgg 1.9 release yet, not even a beta or RC.

  • Conceptually great! But what are the possible use cases? I am trying to imagine the pros and cons

  • I'm not sure of the use case, but has anybody actually tested this with actual users?  I don't think it's mathematically possible.

    Consider you have 2 users - you need 2 relationships, one each way

    3 users - you need 6 relationships for everyone to be friends with everyone else

    4 users = 24 relationships

    I'm not a mathematician, but I think number of relationships ends up as the number of users factorial - which will grow to be huge in very short order.

    In fact 13! = 6227020800

    Which exceeds the 32 bit integer limit...

  • It's been pointed out to me that I was wrong in my assessment of it being n! (I did say I'm not a mathematician) - but it is n(n-1) which is still not scalable

    Assuming absolutely no other relationships exist you could have a theoretical maximum limit of 46341 users before you hit the 32 bit integer limit.  That's before considering the performance impact of such a table, and queries that use things like ACCESS_FRIENDS...

Stats

  • Category: User admin
  • License: GNU General Public License (GPL) version 2
  • Updated: 2014-11-17
  • Downloads: 2472
  • Recommendations: 5