commons_profile.api.php in Drupal Commons 6.2
File
modules/features/commons_profile/commons_profile.api.php
View source
<?php
function hook_commons_profile_action_links_alter(&$links, $account) {
global $user;
if ($user->uid == $account->uid) {
if (messaging_simple_access($account)) {
$sql = "SELECT COUNT(uid) FROM {messaging_store} WHERE uid = %d";
$count = db_result(db_query($sql, $account->uid));
$links['notification_messages'] = array(
'title' => t('Messages') . ($count > 0 ? " ({$count})" : ''),
'href' => "user/{$account->uid}/messages",
);
}
if (notifications_access_user($account)) {
$links['notification_settings'] = array(
'title' => t('Notification settings'),
'href' => "user/{$account->uid}/notifications",
);
}
}
}