Hi!
Here's something I think it would be interesting although I've no idea on how hard to code or server intensive this would be.
It's a simple idea though: a block to be placed on the profile page, that would display the affinity value between the logged on member (viewing the profile) and the profile owner.

Ricardo

Comments

jkamin’s picture

Hi -

I likewise think this would be a great additional to the affinity module.

I'm interested in creating a "content profile field" that would tell the viewing user how much affinity they have with the user in the profile (just as Ricardo suggested). I imagine it might just be a matter of putting some of the php code from the affinity module into a new customized content field, but not being a true geek, I have no idea what snippet of code that would be.

Any suggestions would be hugely appreciated!

Julia

Cesar Wild Wild Web’s picture

You can get this functionality creating a block with PHP code similar to this:

global $user;
$item = menu_get_item();
if ($item['path'] == 'user/%') {
  $account = $item['page_arguments'][0];
}
$output = '';
if ($user->uid != $account->uid) {
  module_load_include('module', 'affinity', 'affinity');
  $similarity = _affinity_user_similarity($user->uid, $account->uid);
  drupal_add_css(drupal_get_path('module', 'affinity') .'/affinity_match.css', 'module', 'all', FALSE);
  $output = theme('affinity_match', $account, $similarity);
}