This will return the unread private messages in Drupal 7.
<?php
global $user; privatemsg_unread_count($user);
?>
Refer this for more discussion
This will return pending relationship request for the loggedin user.
<?php
function _count_pending_relationships($account = NULL) {
$counts = &drupal_static(__FUNCTION__, array());
if (!$account || $account->uid == 0) {
global $user;
$account = $user;
}
if (!isset($counts[$account->uid])) {
$count = 0;
$pending_relationships = user_relationships_load(array('requestee_id' => $account->uid, 'approved' => 0), array('count' => TRUE));
if (!empty($pending_relationships)) {
foreach($pending_relationships as $requester_uid => $relationship) {
if($account->uid != $requester_uid) {
$count++;
}
}
}
$counts[$account->uid] = $count;
}
return $counts[$account->uid];
}
?>
Refer this for detail discussion.
You can create a block and create respective links with the functions shown above.