Closed (fixed)
Project:
User Relationships
Version:
6.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
14 Nov 2008 at 23:35 UTC
Updated:
29 Nov 2008 at 09:32 UTC
Hello.
I followed the API description in the handbook (http://drupal.org/node/203396) but found that this has changed for D6.
e.g.
In D5, you call:
user_relationships_load($param = array(), $count = FALSE, $sort = 'rid', $order = NULL, $limit = NULL, $include_user_info = FALSE)
In D6, you call:
user_relationships_load($params, $options, FALSE); (where both $params and $options are arrays)
I am trying to call this function within a module function like so:
$user_id = $GLOBALS['user']->name;
$params = array("user" => $user_id, 'rtid' => 1);
$options = array("count" => FALSE, 'sort' => 'rtid', 'order' => 'rid DESC', 'limit' => '10', 'include_user_info' => TRUE);
$friends = user_relationships_load($params, $options, TRUE);
$page_content = '';
$page_content .= "<pre>";
$page_content .= print_r($friends, true);
$page_content .= "</pre>";
return $page_content;
But the array is empty. Can someone point out what I'm doing wrong?
Thanks!
Comments
Comment #1
allanh commentedWOW. I'm so sorry about all the submissions on this. It kept giving me a white screen of death after submitting, and then a 'page not found' a couple of times. I didn't think it would create so many entries. Please forgive me!!
Comment #2
steve22 commentedWhy don't you delete the rest of the posts?
Comment #3
allanh commentedI would be happy to clean up after myself, but unless I'm completely blind, I don't have permissions to do so.
Comment #4
allanh commentedNever mind. It was the simple fact that I was using
When I should have been using $uid (the users user *number*, not the string).
I'm sorry again about the repeated posts. Again, I would delete them, but I can't.
Comment #5
alex.k commented@allanh no worries, please just link from other issues to this one and close them.
You need something like
Comment #6
alex.k commentedOops, did not see you got it sorted.
Comment #7
allanh commentedThank you very much Alex.