2012-11-29 34 views

回答

5

按照配置 - >人員 - >帳戶設置 - >管理顯示(admin/config/people/accounts/display)並將歷史記錄的格式設置爲「隱藏」。

+0

It works!Great!..非常感謝你 – LoganPHP

0

嗨希望到u從上面的鏈接:) How can I remove History from profileCustomizing the user profile layout

點這些鏈接將是有益的...... 1.複製下面的代碼

<?php 
// $Id: user-profile-category.tpl.php,v 1.2 2007/08/07 08:39:36 goba Exp $ 

/** 
* @file user-profile-category.tpl.php 
* Default theme implementation to present profile categories (groups of 
* profile items). 
* 
* Categories are defined when configuring user profile fields for the site. 
* It can also be defined by modules. All profile items for a category will be 
* output through the $profile_items variable. 
* 
* @see user-profile-item.tpl.php 
*  where each profile item is rendered. It is implemented as a definition 
*  list by default. 
* @see user-profile.tpl.php 
*  where all items and categories are collected and printed out. 
* 
* Available variables: 
* - $title: Category title for the group of items. 
* - $profile_items: All the items for the group rendered through 
* user-profile-item.tpl.php. 
* - $attributes: HTML attributes. Usually renders classes. 
* 
* @see template_preprocess_user_profile_category() 
*/ 
?> 
<?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; ?> 

2.保存上面的代碼在一個名爲「user-profile-category.tpl.php」的文件中(請不要使用任何其他名稱,因爲我們已經覆蓋了Drupal的核心tpl文件),並將所提到的文件保存到主題的根文件夾中,無論您使用哪一個... 3.確認您正在使用相同的主題(因爲我們覆蓋了tpl文件 4.清除緩存並查看結果:)

+0

請在這個答案中從上面的鏈接總結步驟/ howto。 – GoodSp33d

0

管理»配置»人們»帳戶設置»管理顯示

0

tulvit provides definitely the easiest solution但如果你需要通過代碼來做到這一點比你可以使用hook_user_view_alter

在自定義模塊添加:

/** 
* Implements hook_user_view_alter(). 
*/ 
function YOURCUSTOMMODULE_user_view_alter(&$build) { 
    unset($build['summary']); 
} 

變量$構建[「總結」]適用於渲染的用戶配置文件的歷史部分中的所有信息。

相關問題