Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*** Implements hook_menu ***/
- function ea_custom_menu() {
- $items['users/%user'] = array( //the %user will be used as argument for the page callback
- 'title' => t('User Profile'),
- 'page callback' => 'ea_custom_render_userpage',
- 'page arguments' => array(1), //zero base array. This tells hook menu to first load user with the specified uid specified by %user parameter.
- 'access callback' => 'user_access', //so non-onwer can also view it
- 'access arguments' => array('access content'),
- );
- return $items;
- }
- /**** page callback for users/%user ****/
- function ea_custom_render_userpage($user) {
- //you now have accessed to the user object
- drupal_set_message('<pre>' . print_r($user, TRUE) . '</pre>');
- //assemble your output using the values inside $user object
- $output = $user->uid; //etc.. etc...
- return $output;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement