2011-01-26 11 views

答えて

3

あなたは次の操作を行うことができます:Drupalの管理者に あなたが設定]タブ上にあることを確認し、ホーム»管理»設定»人々»アカウント設定に移動します。

ページの下部(7つのテーマ)までスクロールすると、E-mailという名前のセクションが見つかります。 そこに追加することができます。

hi [user:name] your ID is :[user:uid] 

は、すべての電子メールにこれを追加あなたは、ユーザIDを望んテンプレート

そして、あなたは以下のINGのテンプレートを追加することができますプロフィールページにこれを追加します。 PHPファイル:

/** 
* Process variables for user-profile.tpl.php. 
* 
* The $variables array contains the following arguments: 
* - $account 
* 
* @see user-profile.tpl.php 
*/ 
function THEMENAME_preprocess_user_profile(&$variables) { 
    $account = $variables['elements']['#account']; 

    // Helpful $user_profile variable for templates. 
    foreach (element_children($variables['elements']) as $key) { 
    $variables['user_profile'][$key] = $variables['elements'][$key]; 
    } 

    //this is added to print user id 
    $variables['user_profile']['uid']['#type'] = 'user_profile_item'; 
    $variables['user_profile']['uid']['#title'] = 'User ID'; 
    $variables['user_profile']['uid']['#markup'] = $account->uid; 


    field_attach_preprocess('user', $account, $variables['elements'], $variables); 
} 

歓声、 ヨルゲン

+0

ヨルゲン私はこれを試してください:HI [ユーザー:名]:[ユーザー:UID]あなたのIDがある が、それはn個のDASああ、仕事!あなたのIDは:[user:uid] " –

+0

私はtamplate.phpファイルにも行を追加しています。私のアカウントの下にIDはありません! ガーランドテーマからtemplate.phpファイルの最後に貼り付けます - > garland - > template.php ist this ok? 投稿者 –

+0

私はdrupalを使用しています6.20 istは知っているimportent? –

関連する問題