2011-01-30 103 views
0

之前發佈評論顯示一條消息:的Drupal 6:如何修改註釋模塊的顯示

Login or register to post comments 

我想修改的2個鏈接「登錄」和「註冊」的輸出,主要是我想要添加一些類的鏈接,以格式很好地與一些img。不同顏色的按鈕

我真的需要「告訴」輸出到放和,默認情況下沒有任何類....

我知道它可以與一些掛鉤或東西,但做我無法找到,沒有信息...

回答

1

這件作品負責該線路在drupal_root /模塊/評論/ comment.module theme_comment_post_forbidden被定位

它看起來像這樣

function theme_comment_post_forbidden($node) { 
    global $user; 
    static $authenticated_post_comments; 

    if (!$user->uid) { 
    if (!isset($authenticated_post_comments)) { 
     // We only output any link if we are certain, that users get permission 
     // to post comments by logging in. We also locally cache this information. 
     $authenticated_post_comments = array_key_exists(DRUPAL_AUTHENTICATED_RID, user_roles(TRUE, 'post comments') + user_roles(TRUE, 'post comments without approval')); 
    } 

    if ($authenticated_post_comments) { 
     // We cannot use drupal_get_destination() because these links 
     // sometimes appear on /node and taxonomy listing pages. 
     if (variable_get('comment_form_location_'. $node->type, COMMENT_FORM_SEPARATE_PAGE) == COMMENT_FORM_SEPARATE_PAGE) { 
     $destination = 'destination='. rawurlencode("comment/reply/$node->nid#comment-form"); 
     } 
     else { 
     $destination = 'destination='. rawurlencode("node/$node->nid#comment-form"); 
     } 

     if (variable_get('user_register', 1)) { 
     // Users can register themselves. 
     return t('<a href="@login">Login</a> or <a href="@register">register</a> to post comments', array('@login' => url('user/login', array('query' => $destination)), '@register' => url('user/register', array('query' => $destination)))); 
     } 
     else { 
     // Only admins can add new users, no public registration. 
     return t('<a href="@login">Login</a> to post comments', array('@login' => url('user/login', array('query' => $destination)))); 
     } 
    } 
    } 
} 

我建議修改你的主題的template.php並添加一個新功能phptemplate_comment_post_forbidden($node)你將複製theme_comment_post_comments的內容並做必要的修改。