This plugin adds a field below user's profile, which displays the levels of separation (a list of users between you and a person whose profile you're watching). It works in two directions - when you're a friend of someone, as well as when someone is your friend.
You can define in plugin settings the number of levels being shown.
This plugin works with and without the friendrequest plugin.
View Mike Zacher (vazco)'s plugins
info@elgg.org
Security issues should be reported to security@elgg.org!
©2014 the Elgg Foundation
Elgg is a registered trademark of Thematic Networks.
Cover image by Raül Utrera is used under Creative Commons license.
Icons by Flaticon and FontAwesome.
Hi vasco
How can I change diractions? (from right to left)?
yoram
you would have to rebuild the code a bit - treat the logged in user as page owner and vice versa.
I guess this is the code:
------------------------------------
<?php
if ( isloggedin() && get_loggedin_userid() != page_owner()){
$levels = vazco_lofseparation::getLevelsOfSeparationString(page_owner_entity());
?>
<div class="levels_of_separation">
<?php echo elgg_echo('vazco_levels:levels').' '.$levels;?>
</div>
<?php } ?>
-----------------------------------------
that's all I need to change:
you have to change:
$levels = vazco_lofseparation::getLevelsOfSeparationString(page_owner_entity());
to:
$levels = vazco_lofseparation::getLevelsOfSeparationString(get_loggedin)user());
and in models/model.php, in line 9 from:
$userTable = vazco_lofseparation::searchForUser($user,get_loggedin_user(), $finishLevel, $userTable);
to:
$userTable = vazco_lofseparation::searchForUser($user,page_owner_entity(), $finishLevel, $userTable);
This should help.
ah, also change:
line 25: if ( $level == $finishLevel || ($currentUser->guid == get_loggedin_userid() && $level !=0) )
line 65: if ($user->guid == get_loggedin_userid())
from get_loggedin_userid() to page_owner()
Got it. tnx
a nice improvement is to show the display name and not the username.
A way to do that ?
enadri,
you have to change line 13 from:
$string.= ' <span class="levels_separator">'.elgg_echo('vazco_levels:separator').'</span> <a href="'.$userTable[$i]->getURL().'">'.$userTable[$i]->username.'</a>';
to:
$string.= ' <span class="levels_separator">'.elgg_echo('vazco_levels:separator').'</span> <a href="'.$userTable[$i]->getURL().'">'.$userTable[$i]->name.'</a>';
perfect, thx
Hi,
is it possible to show the information on top (over the profile) ?
thanks
Oliver,
you would have to modify the line:
extend_view('profile/userdetails','vazco_lofseparation/levels');
in start.php to:
extend_view('profile/userdetails','vazco_lofseparation/levels',1);
Hello Mike,
a problem appears when the network increases. For example, I am a friend of 2 persons, and they are friends themselves. When I see my level of separation between my first firend, the plugin said me I am in contact with him, but our firends is between us.
To be more clear :
A is a friend of B and C
B is a friend of A and C
C is, of course a friend of A and B
Whan A looks C, it 's written A->B->C !! and not A->C like at the beginning
@enadri, ok, I will look into this.
This component is interesting.
Hi,
perfect work, but where can I change the code to display the tiny icon and below the username?
MfG