게시판 별점을 최신글에도 표시되게 하는 방법...
본문
아래의 최신글에 평점(별모양) 나오게 하고 싶은데 잘안되네요ㅠㅠ
어떻게 해야하는지 알려주시면 감사합니다..
아래 코드는 게시판 리스트에 나오는 별점코드입니다.
<td class="td_rating">
<?php if ($list[$i]['wr_1'] == '0') {
echo '
<i class="fa fa-star-o" aria-hidden="true" style="color:#ff0000;" ></i>
<i class="fa fa-star-o" aria-hidden="true" style="color:#ff0000;" ></i>
<i class="fa fa-star-o" aria-hidden="true" style="color:#ff0000;" ></i>
<i class="fa fa-star-o" aria-hidden="true" style="color:#ff0000;" ></i>
<i class="fa fa-star-o" aria-hidden="true" style="color:#ff0000;" ></i>
';}
elseif ($list[$i]['wr_1'] == '1') {echo '
<i class="fa fa-star" aria-hidden="true" style="color:#ff0000;" ></i>
<i class="fa fa-star-o" aria-hidden="true" style="color:#ff0000;" ></i>
<i class="fa fa-star-o" aria-hidden="true" style="color:#ff0000;" ></i>
<i class="fa fa-star-o" aria-hidden="true" style="color:#ff0000;" ></i>
<i class="fa fa-star-o" aria-hidden="true" style="color:#ff0000;" ></i>
';}
elseif ($list[$i]['wr_1'] == '1.5') {echo '
<i class="fa fa-star" aria-hidden="true" style="color:#ff0000;" ></i>
<i class="fa fa-star-half-o" aria-hidden="true" style="color:#ff0000;" ></i>
<i class="fa fa-star-o" aria-hidden="true" style="color:#ff0000;" ></i>
<i class="fa fa-star-o" aria-hidden="true" style="color:#ff0000;" ></i>
<i class="fa fa-star-o" aria-hidden="true" style="color:#ff0000;" ></i>
';}
elseif ($list[$i]['wr_1'] == '2') {echo '
<i class="fa fa-star" aria-hidden="true" style="color:#ff0000;" ></i>
<i class="fa fa-star" aria-hidden="true" style="color:#ff0000;" ></i>
<i class="fa fa-star-o" aria-hidden="true" style="color:#ff0000;" ></i>
<i class="fa fa-star-o" aria-hidden="true" style="color:#ff0000;" ></i>
<i class="fa fa-star-o" aria-hidden="true" style="color:#ff0000;" ></i>
';}
elseif ($list[$i]['wr_1'] == '2.5') {echo '
<i class="fa fa-star" aria-hidden="true" style="color:#ff0000;" ></i>
<i class="fa fa-star" aria-hidden="true" style="color:#ff0000;" ></i>
<i class="fa fa-star-half-o" aria-hidden="true" style="color:#ff0000;" ></i>
<i class="fa fa-star-o" aria-hidden="true" style="color:#ff0000;" ></i>
<i class="fa fa-star-o" aria-hidden="true" style="color:#ff0000;" ></i>
';}
elseif ($list[$i]['wr_1'] == '3') {echo '
<i class="fa fa-star" aria-hidden="true" style="color:#ff0000;" ></i>
<i class="fa fa-star" aria-hidden="true" style="color:#ff0000;" ></i>
<i class="fa fa-star" aria-hidden="true" style="color:#ff0000;" ></i>
<i class="fa fa-star-o" aria-hidden="true" style="color:#ff0000;" ></i>
<i class="fa fa-star-o" aria-hidden="true" style="color:#ff0000;" ></i>
';}
elseif ($list[$i]['wr_1'] == '3.5') {echo '
<i class="fa fa-star" aria-hidden="true" style="color:#ff0000;" ></i>
<i class="fa fa-star" aria-hidden="true" style="color:#ff0000;" ></i>
<i class="fa fa-star" aria-hidden="true" style="color:#ff0000;" ></i>
<i class="fa fa-star-half-o" aria-hidden="true" style="color:#ff0000;" ></i>
<i class="fa fa-star-o" aria-hidden="true" style="color:#ff0000;" ></i>
';}
elseif ($list[$i]['wr_1'] == '4') {echo '
<i class="fa fa-star-o" aria-hidden="true" style="color:#ff0000;" ></i>
<i class="fa fa-star" aria-hidden="true" style="color:#ff0000;" ></i>
<i class="fa fa-star" aria-hidden="true" style="color:#ff0000;" ></i>
<i class="fa fa-star" aria-hidden="true" style="color:#ff0000;" ></i>
<i class="fa fa-star" aria-hidden="true" style="color:#ff0000;" ></i>
';}
elseif ($list[$i]['wr_1'] == '4.5') {echo '
<i class="fa fa-star" aria-hidden="true" style="color:#ff0000;" ></i>
<i class="fa fa-star" aria-hidden="true" style="color:#ff0000;" ></i>
<i class="fa fa-star" aria-hidden="true" style="color:#ff0000;" ></i>
<i class="fa fa-star" aria-hidden="true" style="color:#ff0000;" ></i>
<i class="fa fa-star-half-o" aria-hidden="true" style="color:#ff0000;" ></i>
';}
elseif ($list[$i]['wr_1'] == '5') {echo '
<i class="fa fa-star" aria-hidden="true" style="color:#ff0000;" ></i>
<i class="fa fa-star" aria-hidden="true" style="color:#ff0000;" ></i>
<i class="fa fa-star" aria-hidden="true" style="color:#ff0000;" ></i>
<i class="fa fa-star" aria-hidden="true" style="color:#ff0000;" ></i>
<i class="fa fa-star" aria-hidden="true" style="color:#ff0000;" ></i>
';}
?>
</td>
아래 코드는 게시판 뷰스킨에 나오는 별점코드입니다.
<br>
<?php if ($view['wr_1'] == '0') {
echo '
<i class="fa fa-star-o" aria-hidden="true" style="color:#ff0000; font-size:20px;" ></i>
<i class="fa fa-star-o" aria-hidden="true" style="color:#ff0000; font-size:20px;" ></i>
<i class="fa fa-star-o" aria-hidden="true" style="color:#ff0000; font-size:20px;" ></i>
<i class="fa fa-star-o" aria-hidden="true" style="color:#ff0000; font-size:20px;" ></i>
<i class="fa fa-star-o" aria-hidden="true" style="color:#ff0000; font-size:20px;" ></i>
';}
elseif ($view['wr_1'] == '1') {echo '
<i class="fa fa-star" aria-hidden="true" style="color:#ff0000; font-size:20px;" ></i>
<i class="fa fa-star-o" aria-hidden="true" style="color:#ff0000; font-size:20px;" ></i>
<i class="fa fa-star-o" aria-hidden="true" style="color:#ff0000; font-size:20px;" ></i>
<i class="fa fa-star-o" aria-hidden="true" style="color:#ff0000; font-size:20px;" ></i>
<i class="fa fa-star-o" aria-hidden="true" style="color:#ff0000; font-size:20px;" ></i>
';}
elseif ($view['wr_1'] == '1.5') {echo '
<i class="fa fa-star" aria-hidden="true" style="color:#ff0000; font-size:20px;" ></i>
<i class="fa fa-star-half-o" aria-hidden="true" style="color:#ff0000; font-size:20px;" ></i>
<i class="fa fa-star-o" aria-hidden="true" style="color:#ff0000; font-size:20px;" ></i>
<i class="fa fa-star-o" aria-hidden="true" style="color:#ff0000; font-size:20px;" ></i>
<i class="fa fa-star-o" aria-hidden="true" style="color:#ff0000; font-size:20px;" ></i>
';}
elseif ($view['wr_1'] == '2') {echo '
<i class="fa fa-star" aria-hidden="true" style="color:#ff0000; font-size:20px;" ></i>
<i class="fa fa-star" aria-hidden="true" style="color:#ff0000; font-size:20px;" ></i>
<i class="fa fa-star-o" aria-hidden="true" style="color:#ff0000; font-size:20px;" ></i>
<i class="fa fa-star-o" aria-hidden="true" style="color:#ff0000; font-size:20px;" ></i>
<i class="fa fa-star-o" aria-hidden="true" style="color:#ff0000; font-size:20px;" ></i>
';}
elseif ($view['wr_1'] == '2.5') {echo '
<i class="fa fa-star" aria-hidden="true" style="color:#ff0000; font-size:20px;" ></i>
<i class="fa fa-star" aria-hidden="true" style="color:#ff0000; font-size:20px;" ></i>
<i class="fa fa-star-half-o" aria-hidden="true" style="color:#ff0000; font-size:20px;" ></i>
<i class="fa fa-star-o" aria-hidden="true" style="color:#ff0000; font-size:20px;" ></i>
<i class="fa fa-star-o" aria-hidden="true" style="color:#ff0000; font-size:20px;" ></i>
';}
elseif ($view['wr_1'] == '3') {echo '
<i class="fa fa-star" aria-hidden="true" style="color:#ff0000; font-size:20px;" ></i>
<i class="fa fa-star" aria-hidden="true" style="color:#ff0000; font-size:20px;" ></i>
<i class="fa fa-star" aria-hidden="true" style="color:#ff0000; font-size:20px;" ></i>
<i class="fa fa-star-o" aria-hidden="true" style="color:#ff0000; font-size:20px;" ></i>
<i class="fa fa-star-o" aria-hidden="true" style="color:#ff0000; font-size:20px;" ></i>
';}
elseif ($view['wr_1'] == '3.5') {echo '
<i class="fa fa-star" aria-hidden="true" style="color:#ff0000; font-size:20px;" ></i>
<i class="fa fa-star" aria-hidden="true" style="color:#ff0000; font-size:20px;" ></i>
<i class="fa fa-star" aria-hidden="true" style="color:#ff0000; font-size:20px;" ></i>
<i class="fa fa-star-half-o" aria-hidden="true" style="color:#ff0000; font-size:20px;" ></i>
<i class="fa fa-star-o" aria-hidden="true" style="color:#ff0000; font-size:20px;" ></i>
';}
elseif ($view['wr_1'] == '4') {echo '
<i class="fa fa-star-o" aria-hidden="true" style="color:#ff0000; font-size:20px;" ></i>
<i class="fa fa-star" aria-hidden="true" style="color:#ff0000; font-size:20px;" ></i>
<i class="fa fa-star" aria-hidden="true" style="color:#ff0000; font-size:20px;" ></i>
<i class="fa fa-star" aria-hidden="true" style="color:#ff0000; font-size:20px;" ></i>
<i class="fa fa-star" aria-hidden="true" style="color:#ff0000; font-size:20px;" ></i>
';}
elseif ($view['wr_1'] == '4.5') {echo '
<i class="fa fa-star" aria-hidden="true" style="color:#ff0000; font-size:20px;" ></i>
<i class="fa fa-star" aria-hidden="true" style="color:#ff0000; font-size:20px;" ></i>
<i class="fa fa-star" aria-hidden="true" style="color:#ff0000; font-size:20px;" ></i>
<i class="fa fa-star" aria-hidden="true" style="color:#ff0000; font-size:20px;" ></i>
<i class="fa fa-star-half-o" aria-hidden="true" style="color:#ff0000; font-size:20px;" ></i>
';}
elseif ($view['wr_1'] == '5') {echo '
<i class="fa fa-star" aria-hidden="true" style="color:#ff0000; font-size:20px;" ></i>
<i class="fa fa-star" aria-hidden="true" style="color:#ff0000; font-size:20px;" ></i>
<i class="fa fa-star" aria-hidden="true" style="color:#ff0000; font-size:20px;" ></i>
<i class="fa fa-star" aria-hidden="true" style="color:#ff0000; font-size:20px;" ></i>
<i class="fa fa-star" aria-hidden="true" style="color:#ff0000; font-size:20px;" ></i>
';}
?>
<br>
위 코드를 최신글 스킨에 그대로 복붙해봤는데 별점 표시가 안되더군요..ㅠ
!-->!-->
답변을 작성하시기 전에 로그인 해주세요.