Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
how to add a user picture in version 7.x in user_relationships-pending_block.tpl.php
in 6x version
<?php
// $Id: user_relationships-pending_block.tpl.php,v 1.1.2.12 2010/01/03 19:19:11 alexk Exp $
/**
* @file
* Template for relationships requests block
* List all pending requests and provide links to the actions that can be taken on those requests
*/
if ($relationships) {
$list = array();
foreach ($relationships as $rtid => $relationship) {
$tt_rel_name = ur_tt("user_relationships:rtid:$rtid:name", $relationship->name);
$tt_rel_plural_name = ur_tt("user_relationships:rtid:$rtid:plural_name", $relationship->plural_name);
if ($user->uid == $relationship->requester_id) {
$relation_to =& $relationship->requestee;
$usr = user_load($relationship->requestee_id);
$picture = theme('imagecache', 'minithumb_pict', ($usr->picture) ? $usr->picture : variable_get('user_picture_default', ''), strip_tags(theme('username', $relation_to)));
$controls = theme('user_relationships_pending_request_cancel_link', $user->uid, $relationship->rid);
$line = t('@rel_name to !username (!controls)', array('@rel_name' => $tt_rel_name, '!username' => theme('username', $relation_to), '!controls' => $controls));
$key = t('Sent requests');
}
else {
$relation_to =& $relationship->requester;
$usr = user_load($relationship->requester_id);
$picture = theme('imagecache', 'minithumb_pict', ($usr->picture) ? $usr->picture : variable_get('user_picture_default', ''), strip_tags(theme('username', $relation_to)));
$controls =
theme('user_relationships_pending_request_approve_link', $user->uid, $relationship->rid).'|'.
theme('user_relationships_pending_request_disapprove_link', $user->uid, $relationship->rid);
$line = t('@rel_name from !username (!controls)', array('@rel_name' => $tt_rel_name, '!username' => theme('username', $relation_to), '!controls' => $controls));
$key = t('Received requests');
}
$list[$key][] = $picture . $line;
}
$output = array();
foreach ($list as $title => $users) {
$output[] = theme('item_list', $users, $title);
}
}
drupal_add_css(drupal_get_path('theme', 'lds_theme') .'/css/modifs/user_relationships-pending_block.css', 'theme');
print isset($output) ? implode('', $output) : t('No Pending Requests');
?>
Comment | File | Size | Author |
---|---|---|---|
#4 | Selection_034.jpeg | 120.47 KB | mrf |
Comments
Comment #1
BenK CreditAttribution: BenK commentedSubscribing
Comment #2
D2ev CreditAttribution: D2ev commentedyou can use this
Comment #3
RKS CreditAttribution: RKS commentedThis may or may not have helped Charlie, but it did for me. So thanks for that.
What about on the normal user relationships page? Is that covered somewhere?
Comment #4
mrf CreditAttribution: mrf commentedRKS for a normal relationships page there is a setting in the admin form.
Anyone up for creating a documentation page for this?
Comment #5
Anonymous (not verified) CreditAttribution: Anonymous commentedHow would we change the user pictures to use a custom image field/style instead of the drupal default?
Comment #6
broncomania CreditAttribution: broncomania commentedThe imagecache integration is really bad. Here has some work tobe done. It's also missing in the pending requests block. So the easiest way is to code yourself what you need.