Hello,
This must be very simple (for the Drupal experts at least).
Is there a clear explanation of
how to show the picture of the user in the USERS summary list page
and the User Profile Page in Drupal 4.7 ?
The default profile page outputs various info except the picture.
The standard explanation is to create a template.php and user_profile.tpl.php
and place this code in the user_profile.tpl.php.
if($user->picture):
endif;
By doing this you get the picture but lose all other default items
which need tobe put in by additional code to customise the page.
SURELY there must be a way to include the above line in the stock
DRUPAL execution. Ihad a look at the profile.module but can't figure out
how and where?
Can someone suggest how to do this ?
Many thanks in advance
Shred
++++++++++++++++
A great deal for business
Http://affiliatesexcel.com
| Comment | File | Size | Author |
|---|---|---|---|
| #3 | user_profile.tpl__.php.txt | 4.42 KB | valley-1 |
Comments
Comment #1
Egon Bianchet commentedComment #2
Egon Bianchet commentedAre you talking about the picture uploaded under "my account" right?
Then it has nothing to do with image module ... it's a feature coded in user module so I'm moving the issue there (yeah it's not profile, I was wrong.)
You must print out every other item you want to display along with the picture ... look for example at what this function prints out http://api.drupal.org/api/4.7/function/theme_user_profile
Btw, did you chech this handbook page? http://drupal.org/node/35728
Comment #3
valley-1 commentedDear Anton,
Now I understand a little more
I have cheked the user.module and have located the theme_user _profile function call.
"You must print out every other item you want to display along with the picture ... look for example at what this function prints out http://api.drupal.org/api/4.7/function/theme_user_profile"
The issue is this call correctly outputs every thing except the picture in the profile view
function theme_user_profile($account, $fields) {
$output = '
$output .= theme('user_picture', $account);
which is in the beginning doesn't seem to output correctly
Could you please check this and let me know ?
++++++++++++++++++++++
I have seen
"Btw, did you chech this handbook page? http://drupal.org/node/35728"
and tried out a template.php and user_profile.tpl.php which actually outputs the picture.
Since the feature is already available in the user.module , I am trying to use this.
I attach the user_profile.tpl.php file I tried out
Cheers
Shred
Comment #4
valley-1 commentedCome to think of it this is the base function which seems to have
a bug or conflict with URL modules like pathauto or other
function theme_user_picture($account) {
if (variable_get('user_pictures', 0)) {
if ($account->picture && file_exists($account->picture)) {
$picture = file_create_url($account->picture);
}
else if (variable_get('user_picture_default', '')) {
$picture = variable_get('user_picture_default', '');
}
if (isset($picture)) {
$alt = t('%user\'s picture', array('%user' => $account->name ? $account->name : variable_get('anonymous', 'Anonymous')));
$picture = theme('image', $picture, $alt, $alt, '', false);
if (!empty($account->uid) && user_access('access user profiles')) {
$picture = l($picture, "user/$account->uid", array('title' => t('View user profile.')), NULL, NULL, FALSE, TRUE);
}
return "
";
}
}
}
Comment #5
valley-1 commentedHello
Unable to change PictureImage Path value in admin>>settings>>users
Does anyone know where the value you enter in the field Picture Image Path
for the Avatar picutres in the User Profiles entered at admin>>settings>>user.
is saved.
I searched the datbase and can't find .
When you delete the field and update an old value keep coming up
when you enter a new value you get error message#
warning: mkdir(): No such file or directory in /home/paratlan/paratlan-www/includes/file.inc on line 91.
The directory does not exist.
The settings have not been saved because of the errors.
IT looks it is almost impossible to implement this simple feature
in DRUPAL 4.7 .
Cheers
Shred
Comment #6
magico commentedClosing support request older than 1 month.
Comment #7
(not verified) commented