user account "View recent links" points to links by category

satori@abc3400.be - September 23, 2006 - 20:19
Project:userlink
Version:4.7.x-1.x-dev
Component:Code
Category:bug report
Priority:minor
Assigned:satori@abc3400.be
Status:closed
Description

On the user's "my account"-page ("user/$uid"), the "View recent links"-link points to "userlink/$uid", which is a listing of that user's links sorted by category. It would make alot more sense if it would link to "userlink/$uid/recent" instead.

/**
* Implementation of hook_user().
*/
function userlink_user($type, &$edit, &$user) {
  if ($type == 'view' && user_access('view all userlinks', $user)) {
    $items[] = array('title' => t('Links'),
      'value' => l(t("View recent links."), "userlink/$user->uid", array('title' => t("Read %username's links.", array('%username' => $user->name)))),
      'class' => 'userlink',
    );
    return array(t('History') => $items);
  }
}

becomes

/**
* Implementation of hook_user().
*/
function userlink_user($type, &$edit, &$user) {
  if ($type == 'view' && user_access('view all userlinks', $user)) {
    $items[] = array('title' => t('Links'),
      'value' => l(t("View recent links."), "userlink/$user->uid/recent", array('title' => t("Read %username's links.", array('%username' => $user->name)))),
      'class' => 'userlink',
    );
    return array(t('History') => $items);
  }
}

#1

satori@abc3400.be - September 27, 2006 - 20:19
Status:needs review» closed

Closed in favor of node/86345.

 
 

Drupal is a registered trademark of Dries Buytaert.