When I View Profile I always see History (Member for .. days ..hours). I don't like it and I would like to remove it. But How? Please help me?

Comments

Please GIve me suggations on how to remove the History ( lying in the profile).

Please! Please!! please!!! help!!!!

Suraj

You would have to check http://drupal.org/node/35728

I wouldn't know any other simpler way. Am trying to edit them myself too.

I went and opened the user.module file in word pad, searched for history, and deleted that whole line of code. That seems to have worked for me.

Editing core code is a bad idea. Your changes will get wiped out on an upgrade.

For Drupal 6, copy this file from your /sites/modules/user directory:
user-profile-category.tpl.php

put the copy into your custom theme directory and within that file, replace this code

<?php if ($title) : ?>
  <h3><?php print $title; ?></h3>
<?php endif; ?>
<dl<?php print $attributes; ?>>
  <?php print $profile_items; ?>
</dl>

with:

<?php if ($title && $title != t(History)) : ?>
  <h3><?php print $title; ?></h3>
<?php endif; ?>
<?php if ($title != t(History)) : ?>
<dl<?php print $attributes; ?>>
  <?php print $profile_items; ?>
</dl>
<?php endif; ?>

reference url: http://network.acquia.com/node/1112624#comment-20421

Maybe a bit late, but it does work that way!

Open the user.module file in the Module>>user folder and comment out line 458 to 466 (including the '}')
(tested with Durpal 5.2)

Hi. I am also looking to remove the history from the views in profile. Do I actually have to count the lines?!!? How do I know which lines are are 458 to 466, a how do I comment something out?

Thanks!
Insane Fisher
www.insanefishingclub.com

I am the building. I am the tree. I am God, for God's in me.

I am the building. I am the tree. I am God, for God's in me.

Just saw your post..
Well I don't know any other way of doing it. Just get some basic code editor which is capable of counting the lines. (I use "proton", which is really nothing fancy)
There are some really powerful tools out there for free as well, for example Eclipse. Instead of deleting the relevant code, you could also just comment it out,

i am correct 1 line (num 474) in this block code:

<?php
/**
* Implementation of hook_user().
*/
function user_user($type, &$edit, &$user, $category = NULL) {
  if (
$type == 'view') {
   
$items['history'] = array('title' => t('Member for'),
     
'value' => format_interval(time() - $user->created),
     
'class' => 'member',
    );
    return array();
//t('History') => $items
// ...
?>

instead return array(t('History') => $items);
write this return array();

this is correct way http://drupal.org/node/35728
(use profile module in core)
1) create in template.php function phptemplate_user_profile

<?php
function phptemplate_user_profile($user, $fields = array()) {
return
_phptemplate_callback('user_profile', array('user' => $user, 'fields' => $fields));
}
?>

2) create file user_profile.tpl.php and output what you want,
test:
<div>
    <h3>$USER:</h3>
    <?php foreach($user as $k=>$v)
        if (
is_array($v)) foreach($v as $kk=>$vv) print "--$kk=$vv<br />\n";
        else print
"$k=$v<br />\n";
       
?>

    <h3>$FIELDS:</h3>
    <?php foreach($fields as $k=>$v) {
        if (
is_array($v)) {
            foreach(
$v as $kk=>$vv) {
                if (
is_array($vv)) foreach($vv as $kkk=>$vvv) print "-- -- $kkk=$vvv<br />\n";
                else print
"-- $kk=$vv<br />\n";
            }
        }
        else print
"$k=$v<br />\n";
        }
       
?>

</div>

You should not correct drupal's output by changing drupal's code.
If you want to change functionality instead of appearance, you should choose to modify drupal's output in a custom module. In the example, you would have a module called mywebsite. Into the file mywebsite.module you put the following code:

<?php
/**
* Implementation of hook user to do some customization of this website
*/
function mywebsite_user($type, &$edit, &$user, $category = NULL) {
  if (
$type == 'view') {
   
// turn off history by returning an empty array having the same key as the one defined in user_user()
   
$items['history'] = array();
    return array(
t('History') => $items);
  }
}
?>

Put the file into /sites/all/modules/custom/mywebsite directory. Put an according mywebsite.info into the directory, too. Activate the module as usual. More information in module developer guide.

I'm having the same issue, and i tought it would be as easy as you say MarcoR, in theory that should do it, but it doesn't :S, have you tried it? or you just came up with it and suggested it without trying?

Your code can be improved by using the already known $user variable and just empty the arrays you don't want to be outputted. For instance:

function mywebsite_user($type, &$edit, &$user, $category = NULL) {
  if ($type == 'view') {
    // Turn of user history
    $user->content['summary']['member_for'] = array();
    // Turn of userpoints
    $user->content['userpoints'] = array();
  }
}

Baris Wanschers (@BarisW)
Drupal specialist

There appears to be a module that can do this: http://drupal.org/project/myaccount_alter

"Gets rid of unwanted sections on the 'My Account' page such as the 'History' section or anything added there by a contributed module.

"Install, then go to the myaccount_alter settings page and check off the sections you would like to disable."

I haven't used it, but was searching site on similar keywords and thought this might be a good lead for you. I note the module was updated 2008-Feb-16 (rel. 5.x-1.2), which indicates its a living project.

How does that history data get there?

?

its part of core.

There is a hook_profile_alter to modify this, just implement it in a module:

<?php
function mymodule_profile_alter(&$account, &$fields) {
    foreach (
$fields AS $category => $items) {
        if(
$category == 'History') {
            unset(
$fields[$category]);
        }
      }
}
?>

If you using other language then default English, don't forget about t() function other wise above code will not work.
I've change 'History' > t('History')

<?php
/**
* implementation of hook_profile_alter
*/
function mymodule_profile_alter(&$account, &$fields) {
  foreach (
$fields AS $category => $items) {
    if(
$category == t('History')) {
      unset(
$fields[$category]);
    }
  }
}
?>

how would be this code for Drupal6?

In Drupal6, create a file in your theme's directory called: user-profile.tpl.php

Give that file the following contents:

<div class="profile">
<?php
unset($profile[t('summary')]);
foreach (
$profile AS $k => $v) {
  print
$v;
}
?>

</div>

That's all I did to remove that section. Hope this helps!

Web Developer, Iowa State University College of Veterinary Medicine

try the code but nothing happened, could you give any detail missing please?

Clear your drupal cache under: www.example.com/admin/settings/performance in order for this change to take effect.

Adding the user-profile.tpl.php file solved it in 30 seconds, no need for an extra module, thanks!

4 years later - and this solution came in very handy - many thanks! We had changed our theme, and the person doing it hadn't realised that there was a user-profile.tpl.php file in the original theme folder that contained this modification. I just copied it into the new theme folder and - hey presto! "History" disappeared - fantastic.

wendyconnect

...or make a custom module and put this inside:

<?php
function mymodule_profile_alter(&$account) {
  foreach (
$account->content AS $key => $field) {
      if (
$key=='summary') {
      unset(
$account->content['summary']);
    }
  }
}
?>

Write your own custom module and put this code in it:

/**
* Implementation of hook_profile_alter
*/
function custom_profile_alter(&$account) {
unset($account->content['summary']['#title']);
unset($account->content['summary']['member_for']);
}

---------------------------------------------------
AdAstra.ca - Web Redesign for Life Coaches & Wellness Practices

In the example above from @AdAstra , the custom module's name is "custom." Lets say you named your module, "sitecustomizations." So then the code would look like:

/**
* Implementation of hook_profile_alter
*/
function sitecustomizations_profile_alter(&$account) {
unset($account->content['summary']['#title']);
unset($account->content['summary']['member_for']);
}

In other words; you prepend "_profile_alter" with your module name.

Continuing with this example, you create a directory called: sitecustomizations

You place that directory in sites/all/modules

That directory would contain two files: sitecustomizations.info and sitecustomizations.module

The code snippet above goes in sitecustomizations.module

In sitecustomizations.info you would put:

name = Site Customizations
description = Module for implementing site customizations
core = 6.x

Once you enable the module on the modules admin page, your "History" section will disappear from user profiles.

If you just want to hide the history, it might be easiest just to hide the tab with http://drupal.org/project/tabtamer

This worked like a charm, thanks!

Other noobs (like myself) who are reading this might want to remember to add your php delimiters so your .module file will actually contain:

<?php
/**
* Implementation of hook_profile_alter
*/
function sitecustomizations_profile_alter(&$account) {
unset(
$account->content['summary']['#title']);
unset(
$account->content['summary']['member_for']);
}
?>

I ended up with code printed into my header on my first try. :|

Can anyone tell me how to edit this to also get rid of the "view recent blog entries?"

Hi,

Here's another way of removing member since using hook_user

<?php
/**
* Implementation of hook_user
*/
function custommodule_user($op, &$edit, &$account, $category = NULL) {
                if (
$op == 'view') {
               unset(
$account->content['summary']);
                }
}
?>

Regards
Sagar

Need help ?
Reach me on skype : sag_13684

Share your Posts, Url, Sites
www.sociopost.com

Note that you shouldn't actually use the php close tag, unless you are going to reopen the php tags later in the file, as per the drupal coding standards:
http://drupal.org/node/318#phptags

I accomplished it by doing this:

1. Move the file user-profile-category.tpl.php from modules/user to your sites theme folder.
2. Edit the file that is now in your theme folder and comment out everything using the <!-- --> html tags.
3. Clear your cache.

If there is a better way for doing this in D7 please let me know.

in D7 history is a field on the user entity

goto admin/config/people/accounts/display
set the format of the history field to 'hidden'

@vm Thank you!

in D7 history is a field on the user entity

goto admin/config/people/accounts/display set the format of the history field to 'hidden'

Drupal Developer

If you want to just hide the header ("History"), this will do:

.profile h3 {
  display: none;
}

Of course, make sure that you don't have any other h3's in there.

its pretty simple Go to Home » Administration » Configuration » People » Account settings » Manage Display , History -> Format chose hidden.

Rashid Alshobaki
iAraby Team

The above suggestion applies only to Drupal 7.x and was already stated 2 years ago above @ https://drupal.org/comment/5256332#comment-5256332