I installed the FRIENDLIST and i can only see five buttons:
Friend Feed
Oneway management
Twoway management
Twoway received
Twoway send

but nothing like ADD AS A FRIEND etc. is something i am missing?

Comments

mariusooms’s picture

The links are output on the user profile.

Regards,

Marius

kaay’s picture

there isn't any link in the profile except the links (as i mentioned earlier post) in the sidebar. I am using advance profile kit and i can see one new panel, CONNECTIONS and showing: "No available connections."

mariusooms’s picture

Does advance profile kit uses nodes for profiles? In that case you need to manually load the links in your user-profile.tpl.php.

<?php
print friendlist_ui_user_links($account);
?>

In nodes it is a little bit more involved, since you have to load the uid, so something like this in a block should generally work:

<?php
global $user;
if (arg(0) == 'node' && is_numeric(arg(1))) {
  $nid = arg(1);
  $node = node_load(array('nid' => $nid));
  $uid = $node->uid;
}
$account = user_load(array('uid' => $uid));

print friendlist_ui_user_links($account);
?>

Regards,

Marius

kaay’s picture

thanks for the reply. well i understand the first piece of php i have to add manually in the user-profile.tpl.php but the second one bit unclear for me, so where do i have to add that piece of php

I used content profile module to create profile and its working fine with advance profile kit i think it uses the nodes.

mariusooms’s picture

You can put that code in a custom block and enable that in any region within your theme.

Regards,

Marius

mariusooms’s picture

Status: Active » Fixed
mariusooms’s picture

Title: how to add friend?? » Friendlist links for APK/Panels (aka nodes as user profiles)

Changing the title as it looks like I'll be linking here frequently.

bensemmel’s picture

Hi,

me as well I used a custom block and used the following simple code for the use within apk profile panel, as I wanted only the friendlist action links as output. That works fine for me.

$x=arg(1);
print friendlist_ui_get_link('add', $x, 1).'<br>';
print friendlist_ui_get_link('delete', $x, 1);

Marius, I tried your code and it doesn't work because APK uses panels to override the user/% site and collects the info from content profile (nodes). So your code should be adapted to work with the "user" argument, but I don't know how

Regards,
Ben

mariusooms’s picture

Hi Ben, glad it worked with your approach. I'm not familiar enough with apk and panels. If it does uses the user/% path the user can be loaded like so:

<?php
$uid = arg(1);
$account = user_load(array('uid' => $uid));
print friendlist_ui_user_links($account);
?>

Regards,

Marius

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

blueblade’s picture

Hi kaay,

did you figure out how to add it to Advanced Profile Kit user profile?

BB

blueblade’s picture

Hi bensemmel,

Sorry for asking a stupid question but how do you add php codes into a custom block? I did it but the code is showing just the way it is, as codes, on my apk page...

BB

blueblade’s picture

Hi mariusooms and bensemmel,

I figured that I had to turn on PHP filter under admin/build/modules in order for the code to show correctly but none of those two codes work for me. Do you guys have any updates? Thanks for your help =)

BB

jesuscmd@gmail.com’s picture

Hi every one. Ive got a solution: I went to the author-panel.tpl.php and added a custom "if" getting the argument before AKP does like this:


	$url = request_uri();
	$main_string= $url;
	//REMOVE WHEn LOCATED IN THE FINAL SERVER HEY THIS JUST IN MY CASE
	$no_localserver = "/drupalTest/drupal/";
	$pure_url = str_replace($no_localserver," ", $main_string);
	$pure_url = strtolower($pure_url);
	$seccion_actual = $pure_url;

if (strpos($seccion_actual, "user")):{
	
	$account = arg(1);
	print friendlist_ui_user_links($account);
	} else:{


====here goes everithing=====
     

 <?php endif; 

THE JUST place the panel info inside the panel of AKP