XE 노하우 및 TIP 관련된 내용만 게시해주세요.

외부에서 얻은 정보가 있을 시 출처를 최대한 남겨주세요. 반대로 내용을 퍼갈 시 출처를 남겨주세요.

초보자도 쉽게 알아 볼 수 있도록 내용을 채워주시면 고맙겠습니다.

  • 목록
  • 아래로
  • 위로
  • 쓰기
  • 검색

게시판 별 획득 포인트 정보 출력하기

너에게제공 너에게제공
515 0 0
게시판 별로 설정된 포인트이 어떻게 되어 있는 게시판에 표현하고 할 때 


point.png



게시판 별로 값을 넣어야지 변수가 출력이 되더라구요.

게시판 스킨 파일을 수정하여서 변수를 출력하면 됩니다.

참조*출처 - https://www.xpressengine.com/qna/23143527
 

{@
$oModuleModel = getModel('module');
$point_config = $oModuleModel->getModuleConfig('point');
$module_config = $oModuleModel->getModulePartConfig('point', $module_info->module_srl);
$insert_document_point = $module_config['insert_document'];
$insert_comment_point = $module_config['insert_comment'];
$upload_file_point = $module_config['upload_file'];
$download_file_point = $module_config['download_file'];
$read_document_point = $module_config['read_document'];
$voted_document_point = $module_config['voted'];
$blamed_document_point = $module_config['blamed'];
$voted_comment_point = $module_config['voted_comment'];
$blamed_comment_point = $module_config['blamed_comment'];
}


<!--@if($insert_document_point)-->글 작성 포인트 : {number_format($insert_document_point)}P<!--@end-->
<!--@if($insert_comment_point)-->댓글 작성 포인트 : {number_format($insert_comment_point)}P<!--@end-->
<!--@if($upload_file_point)-->파일 업로드 포인트 : {number_format($upload_file_point)}P<!--@end-->
<!--@if($download_file_point)-->파일 다운로드 필요포인트 : {number_format($download_file_point)}P<!--@end-->
<!--@if($read_document_point)-->게시글 조회 포인트 : {number_format($read_document_point)}P<!--@end-->
<!--@if($voted_document_point)-->추천 받음 포인트 : {number_format($voted_document_point)}P<!--@end-->
<!--@if($blamed_document_point)-->비추천 받음 포인트 : {number_format($blamed_document_point)}P<!--@end-->
<!--@if($voted_comment_point)-->댓글 추천 받음 포인트 : {number_format($voted_comment_point)}P<!--@end-->
<!--@if($blamed_comment_point)-->댓글 비추천 받음포인트 : {number_format($blamed_comment_point)}P<!--@end-->

 



두번 째 소스입니다.

게시판 별로 포인트 설정을 안 하여도 , 기본 포인트 값으로 출력이 된다.

기존 tip은 모두 게시판의 설정 값이 출력되지만, 해당 게시판 포인트 설정 값만 출력되게 수정하였다.

참조*출처 - https://www.xpressengine.com/tip/22586080​

 
<h2>{$module_info->browser_title}</h2>
<table cellpadding="0" cellspacing="0" border="0" class="PointList">
    <thead>
        <tr>
         
            <th>글 작성</th>
            <th>댓글 작성</th>
            <th>파일 업로드</th>
            <th>파일 다운로드<br /><span style="color:#777;">(이미지 제외)</span></th>
            <th>게시글 조회</th>
            <th>추천 받음</th>
            <th>비추천 받음</th>
            <th>댓글 추천 받음</th>
            <th>댓글 비추천 받음</th>
        </tr>
    </thead>
    <tbody>
        <tr >
            {@
                $oModuleModel = &getModel('module');
                $config = $oModuleModel->getModuleConfig('point');
                $module_config =  $oModuleModel->getModulePartConfig('point', $module_info->module_srl);
 
                if($module_config['insert_document']) $insert_document = $module_config['insert_document'];
                else $insert_document = $config->insert_document;
 
                if($module_config['insert_comment']) $insert_comment = $module_config['insert_comment'];
                else $insert_comment = $config->insert_comment;
 
                if($module_config['upload_file']) $upload_file = $module_config['upload_file'];
                else $upload_file = $config->upload_file;
 
                if($module_config['download_file']) $download_file = $module_config['download_file'];
                else $download_file = $config->download_file;
 
                if($module_config['read_document']) $read_document = $module_config['read_document'];
                else $read_document = $config->read_document;
 
                if($module_config['voted']) $voted = $module_config['voted'];
                else $voted = $config->voted;
 
                if($module_config['blamed']) $blamed = $module_config['blamed'];
                else $blamed = $config->blamed;
            
               if($module_config['voted_comment']) $blamed = $module_config['voted_comment'];
                else $voted_comment = $config->voted_comment;
            
               if($module_config['blamed_comment']) $blamed = $module_config['blamed_comment'];
                else $blamed_comment = $config->blamed_comment;
            }
           
            <td><span>{$insert_document}</span></td>
            <td><span>{$insert_comment}</span></td>
            <td><span>{$upload_file}</span></td>
            <td><span>{$download_file}</span></td>
            <td><span>{$read_document}</span></td>
            <td><span>{$voted}</span></td>
            <td><span>{$blamed}</span></td>
            <td><span>{$voted_comment}</span></td>
            <td><span>{$blamed_comment}</span></td>
        </tr>
    </tbody>   
</table>

 
신고공유스크랩

댓글 0

댓글 쓰기
권한이 없습니다. 로그인
에디터 모드

신고

"님의 댓글"

이 댓글을 신고하시겠습니까?

댓글 삭제

"님의 댓글"

이 댓글을 삭제하시겠습니까?

공유

퍼머링크