2011-01-30 5 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)))); 
     } 
    } 
    } 
} 
01과 같은

테마의 template.php를 수정하고 theme_comment_post_comments의 내용을 복사하고 필요한 수정을 수행 할 새 기능 phptemplate_comment_post_forbidden($node)을 추가하는 것이 좋습니다.

관련 문제