답변 3개 / 댓글 1개
채택된 답변
+20 포인트
* [게시판 스킨 디렉토리]/list.skin.php
1) 상단에 코드 추가 (3 Line 부근)
Copy
// 읽은 글 미리 가져오기
$read_articles = array();
if ($is_member) {
$current_list_ids = array();
for ($i=0; $i<count($list); $i++) {
$current_list_ids[] = $list[$i]['wr_id'];
}
if (count($current_list_ids) > 0) {
$sql = " SELECT po_rel_id FROM {$g5['point_table']}
WHERE mb_id = '{$member['mb_id']}'
AND po_rel_table = '{$bo_table}'
AND po_rel_action = '읽기'
AND po_rel_id IN (".implode(',', $current_list_ids).")";
$result = sql_query($sql);
while ($row = sql_fetch_array($result)) {
$read_articles[$row['po_rel_id']] = true;
}
}
}
2) 제목 출력 부분 변경
Copy
<div class="bo_tit">
<a href="<?php echo $list[$i]['href'] ?>">
<?php echo $list[$i]['icon_reply'] ?>
<?php
if (isset($list[$i]['icon_secret'])) echo rtrim($list[$i]['icon_secret']);
?>
<?php echo $list[$i]['subject'] ?>
</a>
→
Copy
<div class="bo_tit">
<?php
// 읽은 글인지 확인
$is_read = isset($read_articles[$list[$i]['wr_id']]) && $read_articles[$list[$i]['wr_id']];
// 제목에 스타일 적용
$subject = $list[$i]['subject'];
if ($is_read) {
$subject = "<span style='color:#888;'>".$subject."</span>";
}
?>
<a href="<?php echo $list[$i]['href'] ?>">
<?php echo $list[$i]['icon_reply'] ?>
<?php
if (isset($list[$i]['icon_secret'])) echo rtrim($list[$i]['icon_secret']);
?>
<?php echo $subject // 수정된 부분 ?>
<?php if ($is_read) { ?><i class="fa fa-check" style="font-size:11px;color:#8BC34A;margin-left:3px;" title="읽은 글"></i><?php } ?>
</a>
답변을 작성하려면 로그인이 필요합니다.