css 질문입니다ㅠ 채택완료

초보 퍼블리셔입니다ㅠ https://sir.kr/qa/131842 여기 링크의 답변글을 참고했구요

 

lib/common.lib.php

Copy
$list['icon_secret'] = '';
    if (strstr($list['wr_option'], 'secret'))
        $list['icon_secret'] = '<img src="'.$skin_url.'/img/icon_secret.gif" alt="비밀글">';

여기 밑에

Copy
$list['register_ing'] = '';
           if($list['wr_3'] < date("Y-m-d", G5_SERVER_TIME))
               $list['register_ing'] = '<div class="end">종료</div>';

           $list['register_end'] = '';
           if($list['wr_3'] > date("Y-m-d", G5_SERVER_TIME))
               $list['register_end'] = '<div class="ing">진행중</div>';

이렇게 추가하였구요..

 

쓰고자 하는 스킨의 list.skin.php에

Copy
<!-- 진행중 or 종료 -->
<?if (isset($list[$i]['register_end'])) echo $list[$i]['register_end'];?>
<?if (isset($list[$i]['register_ing'])) echo $list[$i]['register_ing'];?>

이렇게 추가하고 스타일도 적용했습니다. 

 

질문1. 클래스명이 td_won_percen인 파란부분에도 진행중(초록색) 종료(검정색)일때에 따라 글자 색상을 다르게 주고싶은데

238243165_1577420116.7127.png

이렇게 시도를 해봤지만 

238243165_1577419877.3946.png

반응이 없습니다... 어떻게 하면 좋을까요? 벌써 2시간째 씨름중이네유ㅠㅠ 고수님들의 답변을 기다립니다.

답변 1개

채택된 답변
+20 포인트

common.lib.php 파일안에 굳이 추가 하실필요가 있나요? 개인적인생각;;

 

노출되는 파일쪽 상단에  구분용으로 넣고 타이틀 색상 넣으면 될거같은데요


$show_ing_end_title = '';
$show_add_color  = '';
if($list[$i]['wr_3'] < date("Y-m-d", G5_SERVER_TIME)){
 $show_ing_end_title = '<div class="end">종료</div>';
 $show_add_color  = '#88888';
}else if($list[$i]['wr_3'] > date("Y-m-d", G5_SERVER_TIME)){
 $show_ing_end_title = '<div class="ing">진행중</div>';
 $show_add_color  = '#8fc11f';
}

 

<!-- 상단 진행 or 종료 -->
<?php echo $show_ing_end_title; ?>


<!-- 색상 -->
<div class='' ><span style="color:<?php echo $show_add_color; ?>"> 퍼센트 </span></div>

 

 

이렇게 하면 되지 않을가요?

로그인 후 평가할 수 있습니다

답변에 대한 댓글 1개

답변해주셔서 정말 감사합니다. 이런 방법도 있었군요 ^0^ 한번 참고해보겠습니다.

댓글을 작성하려면 로그인이 필요합니다.

답변을 작성하려면 로그인이 필요합니다.

로그인
🐛 버그신고