i am new to drupal, iam trying to make a module so far i have extendeed the registeration page and added fields in it u can see in the image i have attached. and i want to show the image of the user that he had uploaded in register form to be appear in the user account if mean hook_user( $op== 'view' ) .i dont want to use the template option . i want it through coding and not through a module.. plz help........

CommentFileSizeAuthor
#1 database.JPG156.9 KBAnonymous (not verified)
my module..JPG116.13 KBAnonymous (not verified)

Comments

Anonymous’s picture

StatusFileSize
new156.9 KB

i have uploaded the pics in the user table under the picture column and saved the files in the sites/default/files/ folder

nagarajanl’s picture

Try this one in your custom module to display the picture...

function mymodule_user($type, &$edit, &$account, $category = NULL) {
if ($type == 'view') {
$account->content['custom_user_picture'] = array(
'#value' => theme('image', $account->picture),
);
}

Anonymous’s picture

thx nagarajanl 4 the reply so soon but it is not working dear....

nagarajanl’s picture

Then do some degugging stuff like printing the $accout object and make sure $account->picture has a vaild file (or image ) path.

And follow this link to make sure (http://api.drupal.org/api/drupal/modules--user--user.module/function/tem...) what is going wrong dear....

Anonymous’s picture

k dear ll let u know if i get through to it.....

heine’s picture

Status: Active » Closed (won't fix)

1. Please use the module development forum for these kind of support requests.
2. Read the Tips for posting to the Drupal forums.