<?php
if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가

//설정값 세팅
@include_once($list_skin_path.'/set/set.load.php');

$set = amina_set_list($amina['list_set']);

//출력여부
$is_date = ($set['list_date'] && $set['list_date_type']) ? true : false;
$is_good = ($is_good && $set['list_good']) ? true : false;
$is_nogood = ($is_nogood && $set['list_nogood']) ? true : false;
$is_star = ($amina['star'] && $set['list_star']) ? true : false;
$bl_thumb = $set['list_thumb_right'] ? 'bl-thumb-right' : 'bl-thumb-left';

//목록수
$list_num = count($list);

//헤드스킨
include($head_skin_path.'/head.skin.php');

?>

<link rel="stylesheet" href="<?php echo $list_skin_url.'/'.$amina['list_css']; ?>.css">

<ul>
<?php for ($i=0; $i < $list_num; $i++) { 

	//첫페이지만 공지사항 나오도록
	if($list[$i]['is_notice'] && $page > 1) continue;

	//링크 재설정
	$list[$i]['href'] = $list[$i]['href'].$frame_opt;

	//xp 및 모바일 아이콘
	$wr_post = amina_array_write($list[$i]['wr_10']);
	$wr_icon = amina_array_icon($list[$i]['wr_5']);

	//글제목
	if($list[$i]['wr_9'] == "lock" || $list[$i]['wr_9'] == "shingo") {
		$list[$i]['subject'] = '블라인드 처리된 글입니다.';
	} else {
		if(!$list[$i]['is_notice'] && $set['list_subj_cate'] && $list[$i]['ca_name']) $list[$i]['wr_subject'] = '['.$list[$i]['ca_name'].'] '.$list[$i]['wr_subject'];
		$list[$i]['subject'] = $list[$i]['wr_subject'];
		if($wr_post['subj_s']) $list[$i]['subject'] = '<del>'.$list[$i]['subject'].'</del>';
		if($wr_post['subj_b']) $list[$i]['subject'] = '<b>'.$list[$i]['subject'].'</b>';
		if($wr_post['subj_i']) $list[$i]['subject'] = '<i>'.$list[$i]['subject'].'</i>';
		if($wr_post['subj_color']) $list[$i]['subject'] = '<span style="color:'.$wr_post['subj_color'].';">'.$list[$i]['subject'].'</span>';
	}

	$thumb = $set['list_thumb'] ? amina_thumb($list[$i], 70, 50, $set['list_thumb_cut'], $set['list_thumb_no'], $set['list_thumb_icon'], $set['linked_img']) : '';
?>
	<li<?php if($list[$i]['is_notice']) echo ' class="notice"';?>>
		<?php if($thumb) { ?>
			<span class="<?php echo $bl_thumb;?>"><?php echo $thumb; ?></span>
		<?php } ?>

		<strong><a href="<?php echo $list[$i]['href']; ?>">
		<?php 
			if($list[$i]['is_notice']) echo '<i class="fa fa-bell"></i> ';
			if($list[$i]['icon_new']) echo '<i class="fa fa-chevron-circle-right c-crimson"></i> ';
			if($list[$i]['icon_hot']) echo '<i class="fa fa-thumbs-up c-crimson"></i> ';
			if($list[$i]['icon_secret']) echo '<i class="fa fa-lock"></i> ';
			if($wr_post['video'] == "video") {
				echo '<i class="fa fa-youtube-play"></i> ';
			} else if($wr_post['photo'] == 'photo') {
				echo '<i class="fa fa-picture-o"></i> ';
			} else if($wr_post['file'] == "file") {
				echo '<i class="fa fa-download"></i> ';
			}
			if($wr_icon['mobile']) echo '<i class="fa fa-tablet"></i> ';

			echo $list[$i]['subject'];
		?>
		</a></strong>
		<p>
			<?php if ($is_checkbox) { ?>
				<input type="checkbox" name="chk_wr_id[]" value="<?php echo $list[$i]['wr_id']; ?>">
			<?php  } ?>

			<i class="fa fa-comment"></i>
			<?php if($list[$i]['wr_comment'] > 0) { ?>
				<span class="c-orangered"><?php echo $list[$i]['wr_comment']; ?></span>
			<?php } else { ?>
				<?php echo $list[$i]['wr_comment']; ?>
			<?php } ?>
			&nbsp; &nbsp;

			<?php if ($is_star) { ?>
				<?php echo amina_star_mark($amina['star_color'], $list[$i]['wr_7'], 's'); ?>
				&nbsp; &nbsp;
			<?php } ?>

			<?php if ($set['list_name']) { ?>
				<i class="fa fa-user"></i>
				<?php echo xp_icon($list[$i]['mb_id'], $wr_icon['level']).' '.$list[$i]['name']; ?>
				&nbsp; &nbsp;
			<?php } ?>

			<?php if ($set['list_cate'] && $list[$i]['ca_name']) { ?>
				<i class="fa fa-tag"></i>
				<?php echo $list[$i]['ca_name']; ?>
				&nbsp; &nbsp;
			<?php } ?>

			<?php if ($set['list_hit']) { ?>
				<i class="fa fa-eye"></i>
				<?php echo $list[$i]['wr_hit']; ?>
				&nbsp; &nbsp;
			<?php } ?>
			<?php if ($is_good) { ?>
				<i class="fa fa-thumbs-up"></i>
				<?php echo $list[$i]['wr_good']; ?>
				&nbsp; &nbsp;
			<?php } ?>
			<?php if ($is_nogood) { ?>
				<i class="fa fa-thumbs-down"></i>
				<?php echo $list[$i]['wr_nogood']; ?>
				&nbsp; &nbsp;
			<?php } ?>

			<?php if($is_date) { 
				switch($set['list_date']) {
					case '1'		: $date_class = 'list-date1'; break;
					case '2'		: $list[$i]['datetime2'] = amina_date($list[$i]['wr_datetime']); $date_class = 'list-date2'; break;
					default			: $list[$i]['datetime2'] = date($set['list_date'], strtotime($list[$i]['wr_datetime'])); $date_class = 'list-date3'; break;
				}
			?>
				<i class="fa fa-clock-o"></i>
				<?php echo $list[$i]['datetime2']; ?>
				&nbsp; &nbsp;
			<?php } ?>
		</p>
	</li>
<?php } // end for ?>
<?php if (!$list_num) { ?>
	<li class="list-none"><?php echo $no_list; ?></li>
<?php } ?>
</ul>
