Users are not aware of the possibility to add a content's author to their friendlist. Now the only way to add a user to your friendlist, is by navigating to the users' profile.
It would be great if the module would create a block (like User Relationships does) with some actions like "add this user to my friendlist", and of course "remove this user from my friendlist.

Comments

Babalu’s picture

subscribing

gausarts’s picture

Or by appending a link add or remove at the end of the username like buddylist. Perhaps in template layer? Subscribing. Thanks

mercmobily’s picture

Title: "Add this user to my friendlist" feature » "Add this user to my friendlist" block

Hi,

* Adding a link to the user name can be done by theming the user name. However, I don't think it's a good idea

* Having a block with the possible links about that user seems like a _good_ idea. I will probably code it tomorrow.
But... before I do that, Marius, it is possible to create such a block using Views? I would prefer it as a solution...

Bye,

Merc.

Flying Drupalist’s picture

What's the code for a custom link? So I can place it anywhere, not just in a block, which afterall is a big space.

mercmobily’s picture

Hi,

I just realised... (It was 5Am when I wrote my previous message)

This needs to be a custom block. It's very easy to write, but Views is not gonna do it. Sorry to bother you Marius :-D

If you look into friendlist_ui.module, you will find:

##################################################################
# UTILITY FUNCTIONS USEFUL TO SNIPSETS AND CODERS
##################################################################

Amongst those functions:

/**
 * An HTML-formatted list of links for EVERY relation type for
 * the user. This function is used by the hook_user() hook
 * to show links about the user.
 *
 * @param $account
 *   The user object (or id) you want the links for
 *
 * @return
 *   HTML items, formatted with theme_item_list
 */
function friendlist_ui_user_links($account) {
...

That's how you do it :-D

Merc.

mercmobily’s picture

Status: Active » Fixed

Hi,

OK, documentation fixed and block added.
Please let me know if there are any problems with ut.

Merc.

Anonymous’s picture

Status: Fixed » Closed (fixed)

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

Babalu’s picture

Status: Closed (fixed) » Active

can someone please make a patch to integrate this code ?
i'm not really good in code integrating :)

mercmobily’s picture

Status: Active » Fixed

Hi,

Why did you reopen this?
The request was about having a block that listed the available links for the content author.
This has been implemented -- all you have to do is add the block.

If the block doesn't work as intended, please reopen this.

If you have any other questions or doubts, please open a new ticket.

Bye!

Merc.

Babalu’s picture

oh sorry sorry
i haven't recognize it

Anonymous’s picture

Status: Fixed » Closed (fixed)

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

chicagotech’s picture

After installing the Friendlist module, all you need to do is add a line like

print (friendlist_ui_get_link('add', $node->uid, 'friend'));

to your node.tpl.php template, or other functional area that you want the "Add to friends" link to show up. Integrating the functionality seems easy at the beginning (which is where I am at). The readme file lays out the use of this and other functions.

mercmobily’s picture

Hi,

(thanks chicagotech)

Merc.

andrenoronha’s picture

how can i do this with user relationship? it creates a block for this, but i'd like to get the add or remove link to a custom block