<?php if (isset($light_config['thread_list_style']) && $light_config['thread_list_style'] == 1) { ?>
<!--{hook thread_list_inc_start.htm}-->

					<?php 
					if($threadlist) { 
						$have_allowtop = 0;
						foreach($threadlist as &$_thread) {
							$_thread['allowtop'] = forum_access_mod($_thread['fid'], $gid, 'allowtop');
							if($_thread['allowtop']) $have_allowtop = 1;
						}
					}
					?>

					<?php if($threadlist) { foreach($threadlist as &$_thread) { 
						$post = post_read($_thread['firstpid']);
			$content =($post['message']);
			$message = strip_tags($content);
			$message_num = mb_strlen($message);
			$message_omit = '';
			if($message_num > $light_config['thread_summary_word']){
				$message_omit = '...<span class="text-primary text-nowrap">查看更多>></span>';
			}
			$sub_content = mb_substr($message,0,$light_config['thread_summary_word'],'utf-8').$message_omit;
			$pattern="/<[img|IMG].*?src=[\'|\"](.*?(?:[\.gif|\.jpg|\.png]))[\'|\"].*?[\/]?>/";
			$imgcount=preg_match_all($pattern,$content,$match);
			$imgs=array();
			for($i=0;$i<$light_config['thread_summary_pic'];$i++){  
			    if(!empty($match[0][$i])){
			        $imgs[$i]=$match[1][$i];
			    }
			}?>
					<li class="media thread tap <?php echo $_thread['top_class'];?>"
						data-href="<?php echo url("thread-$_thread[tid]");?>" data-tid="<?php echo $_thread['tid'];?>">

						<a <?php if(isset($light_config['user_info_card']) && $light_config['user_info_card']){ ?> data-toggle="popover"  data-trigger="hover" data-html="true" data-content="
						<div class='media'>
							<img class='avatar-4 mr-3' src='<?php echo $_thread['user_avatar_url'];?>'>
							<div class='media-body'>
							  <h5><?php echo $_thread['username'];?></h5>
							  <span class='badge badge-primary mr-2'>UID:<?php echo $_thread['user']['uid'];?></span><span class='badge badge-info mr-2'><?php echo $_thread['user']['groupname'];?></span><span class='badge badge-secondary'><?php echo humandate($_thread['user']['login_date']);?></span>
							  <div class='mt-1'><span class='mr-4'><?php echo lang('threads');?>：<?php echo $_thread['user']['threads'];?></span><span><?php echo lang('posts');?>：<?php echo $_thread['user']['posts'];?></span></div>
							</div>
						  </div>
						" <?php } ?> href="<?php echo url("user-$_thread[uid]");?>" tabindex="-1" class="mt-1 mr-3 online">
							<img class="avatar-3" src="<?php echo $_thread['user_avatar_url'];?>">
						</a>
						<!--{hook thread_list_inc_avatar_after.htm}-->
						<div class="media-body">
							<div class="d-flex justify-content-between">
								<div>
							<!--{hook thread_list_inc_username_before.htm}-->
							<a href="<?php echo url("user-$_thread[uid]");?>" class="username mr-1"
								uid="<?php echo $_thread['uid'];?>"><?php echo $_thread['username'];?>
								<!--{hook thread_list_inc_username_after.htm}-->
							</a>
							
						</div>
						<div>
							<!--{hook thread_list_inc_top_badge_before.htm}-->
							<?php if($_thread['top'] == 3) { ?>
								<span class="badge jb-pink"><?= lang('thread_top') ?></span>
							<?php }else if($_thread['top'] == 1){ ?>
								<span class="badge jb-yellow"><?= lang('thread_top') ?></span>
								<?php } ?>
								<!--{hook thread_list_inc_top_badge_after.htm}-->
								<?php if($have_allowtop) { ?>
									<?php if($_thread['allowtop']) { ?>
									<input type="checkbox" name="modtid" class="thread_checkbox" value="<?php echo $_thread['tid']; ?>" />
									<?php } ?>
	
									<?php } ?>
						</div>
						</div>
						<div class="small">
							<!--{hook thread_list_inc_create_time_before.htm}-->
								<span class="date text-grey"><?php echo $_thread['create_date_fmt'];?></span>
							<!--{hook thread_list_inc_create_time_after.htm}-->
							<?php if (isset($light_config['thread_forum_name']) && $light_config['thread_forum_name'] == 1) { ?>
								<?php if ($route == 'index') { ?>
									<a href="<?php echo url("forum-$_thread[fid]");?>" title="<?php echo $_thread['forumname'];?>" class="text-black-50 ml-1"><i class="iconfont icon-huati mr-1"></i><span><?php echo $_thread['forumname'];?></span></a>
								<?php } ?>
								<?php }?>
						</div>
						<div class="style1_subject_body">
							<div class="subject font-weight-bold break-all my-2" style="font-size: <?php echo $light_config['thread_subject_size'];?>px;">
								
								<!--{hook thread_list_inc_top_icon_before.htm}-->
								<!-- <?php if($_thread['top'] > 0) { ?>
									<i class="icon-top-<?php echo $_thread['top']; ?> rounded"></i>
								<?php } ?> -->
								<!--{hook thread_list_inc_subject_top_after.htm}-->
								
								<!--{hook thread_list_inc_subject_before.htm}-->
								<a href="<?php echo url("thread-$_thread[tid]");?>"><?php echo $_thread['subject'];?></a>
								<!--{hook thread_list_inc_subject_after.htm}-->
								
							
								<!--{hook thread_list_inc_filetype_icon_before.htm}-->
								<!-- <?php if($_thread['files'] > 0) { ?><i class="icon small filetype other"></i><?php } ?> -->
								<!--{hook thread_list_inc_filetype_icon_after.htm}-->

								<!--{hook thread_list_inc_lock_icon_before.htm}-->
								<?php if($_thread['closed'] > 0) { ?><i class="icon-lock"></i><?php } ?>
								<!--{hook thread_list_inc_lock_icon_after.htm}-->

							</div>
							
							<?php if($_thread['content_buy'] > 0 && $user['uid'] != 1){ ?>
								<div class="alert alert-warning" role="alert">
									<i class="fa fa-coins" aria-hidden="true"></i> <?php echo lang('pay_read');?>
								  </div>
								<?php } else  if(strpos($post['message'],'[reply]',0)||strpos($post['message'],'[ttreply]',0)||strpos($post['message'],'[ttlogin]',0) && $user['uid'] != 1){?>
									<div class="alert alert-primary" role="alert">
										<i class="fa fa-low-vision" aria-hidden="true"></i> <?php echo lang('no_read');?>
									  </div>
								<?php } else if($_thread['VIPonly'] > 0 && $user['uid'] != 1){ ?>
									<div class="alert alert-info" role="alert">
										<i class="icon-trophy" aria-hidden="true"></i> <?php echo lang('vip_read');?>
									  </div>
									<?php } else if($_thread['OK']=='0' && $user['uid'] != 1) {?> 
										<div class="alert alert-secondary" role="alert">
											<i class="fas fa-coffee" aria-hidden="true"></i> <?php echo lang('thread_admin_optioning');?>
											</div>
									<?php } else { ?>
									<!--{hook thread_list_brief_before.htm}-->
									<?php if($light_config['thread_summary_word']){ ?>
									<div class="brief small">
											<a href="<?php echo url("thread-$_thread[tid]");?>" class="text-gray"><?php echo $sub_content ? $sub_content : '';?></a>
										</div>
										<?php }?>
										<?php if (isset($light_config['thread_summary']) && $light_config['thread_summary'] == 1) { ?>
										
											
													<?php if ($imgcount > 0) {
														echo '<div class="row px-3 my-2 left_img_box">';
														foreach($imgs as $pic){
												 	echo '<div class="subject_img_box col-4 p-1" ><a href="'.url("thread-$_thread[tid]").'"><img src="'. $pic .'" class="d-block w-100 subject_body_img rounded" style="height: 100px;" alt="点击查看详情" onerror="this.src=\'plugin/zaesky_theme_light/view/img/errpic.png\'" /></a></div>';
													}
													echo '</div>';
												 } } ?>
										
										<!--{hook thread_list_brief_after.htm}-->
									<?php } ?>
							<div class="d-flex justify-content-between small mt-1">
								<div class="text-muted text-nowrap">
									<!--{hook thread_list_inc_view_before.htm}-->
									<span data-toggle="tooltip" data-placement="top" title="浏览"><span class="iconfont icon-yanjing" ></span><span > <?php echo convert($_thread['views']);?></span></span>
									<!--{hook thread_list_inc_view_after.htm}-->

									<!--{hook thread_list_inc_posts_before.htm}-->
									<a href="<?php echo url("thread-$_thread[tid]");?>#comments" class="ml-2"><span class="text-muted" data-toggle="tooltip" data-placement="top" title="评论"><span class="iconfont  icon-xiaoxi" ></span><span> <?php echo convert($_thread['posts']);?></span></span></a>
									
									<!--{hook thread_list_inc_posts_after.htm}-->
								</div>
								<div class="mt-1">
									<!--{hook thread_list_inc_lastuid_before.htm}-->
									<?php if (isset($light_config['thread_last_reply']) && $light_config['thread_last_reply'] == 1) { ?>  
									<?php if($_thread['lastuid']) { ?>
									<span>
										<a href="<?php echo url("user-$_thread[lastuid]");?>" tabindex="-1" >
											
											<?php 
											$lastImg = './upload/avatar/000/'.$_thread['lastuid'].'.png';
											$originImg = './view/img/avatar.png';
											if(file_exists($lastImg)) { ?>
											<img class="avatar-1" src="<?php echo $lastImg;?>">
											<?php }else{ ?>
											<img class="avatar-1" src="<?php echo $originImg;?>">
												<?php } ?>
										</a>
										<span class="username text-muted mr-lg-1" uid="<?php echo $_thread['lastuid'];?>"><?php echo $_thread['lastusername'];?>
											<!--{hook thread_list_inc_lastusername_after.htm}-->
										</span>
										<span class="text-grey"><span class="hidden-sm"><?php echo lang('last_reply');?></span><span class="mx-1">·</span><?php echo $_thread['last_date_fmt'];?></span>
									</span>
									<?php } ?>
									<?php }?>
									<!--{hook thread_list_inc_lastuid_after.htm}-->

								</div>
								
							</div>
						</div>
						</div>
					</li>
					<?php }} else { ?>
					<div class="row justify-content-center">
						<div class="col-6">
							<div class="text-center my-5" style="color:gainsboro"><i
									class="fa fa-bug display-1"></i><br /><?php echo lang('none');?></div>
						</div>
					</div>
					<?php }?>
					<!--{hook thread_list_inc_end.htm}-->

				 <?php } else if(isset($light_config['thread_list_style']) && $light_config['thread_list_style'] == 2){
					include _include(APP_PATH.'plugin/zaesky_theme_light/view/htm/thread_list.inc2.htm');
					}else if(isset($light_config['thread_list_style']) && $light_config['thread_list_style'] == 3){
					include _include(APP_PATH.'plugin/zaesky_theme_light/view/htm/thread_list.inc3.htm');
					}else if(isset($light_config['thread_list_style']) && $light_config['thread_list_style'] == 4){
					include _include(APP_PATH.'plugin/zaesky_theme_light/view/htm/thread_list.inc4.htm');
					}?>