<!--{hook index_threadlist_before.htm}-->

<?php if (isset($light_config['site_annoucement_switch']) && $light_config['site_annoucement_switch'] == 1 && isset($light_config['site_annoucement_position']) && $light_config['site_annoucement_position'] == 1 && $light_config['site_annoucement_content']) {
    $site_annoucement_style = "";
    switch($light_config['site_annoucement_style']){
        case 0: $site_annoucement_style = "primary";break;
        case 1: $site_annoucement_style = "secondary";break;
        case 2: $site_annoucement_style = "success";break;
        case 3: $site_annoucement_style = "danger";break;
        case 4: $site_annoucement_style = "warning";break;
        case 5: $site_annoucement_style = "info";break;
    }
    ?> 
<div class="alert  alert-<?php echo $site_annoucement_style;?> alert-dismissible fade show" role="alert">
    <i class="<?php echo $light_config['site_annoucement_icon'] ;?> mr-2"></i>
    <?php echo $light_config['site_annoucement_content'] ;?>
    <button type="button" class="close" data-dismiss="alert" aria-label="Close">
      <span aria-hidden="true">&times;</span>
    </button>
  </div>
  <?php }?>

<?php 
if (isset($light_config['thread_top_ind']) && $light_config['thread_top_ind'] == 1) { 

if($active == 'default'){
if($page === 1 ) {
    $threadlist_top = $toplist3;
    thread_list_access_filter($threadlist_top, $gid); //过滤没有权限访问的帖子，必须要做
    if($threadlist_top) { 
        $have_allowtop = 0;
        foreach($threadlist_top as &$_thread) {
            $_thread['allowtop'] = forum_access_mod($_thread['fid'], $gid, 'allowtop');
            if($_thread['allowtop']) $have_allowtop = 1;
        }
    }
}?>



<?php if($page === 1 && $threadlist_top ) { ?>
<div class="card">
    <!-- <div class="card-header">
        <ul class="nav nav-tabs card-header-tabs">
            <li class="nav-item">
                <a class="nav-link active"
                    href="."><?php echo lang('all_top');?></a>
            </li>
            {hook index_thread_list_top_item_right.htm}
        </ul>
    </div> -->
    <div class="card-body px-3 py-2">
        <ul class="list-unstyled  mb-0">
           <?php if($threadlist_top ) { foreach($threadlist_top as &$_thread) { ?>
					<li class="tap <?php echo $_thread['top_class'];?>" data-href="<?php echo url("thread-$_thread[tid]");?>" data-tid="<?php echo $_thread['tid'];?>">
                        <div class="d-flex justify-content-between my-2">
							<div class="break-all text-truncate">
                                <?php if($_thread['top'] > 0) { ?>
                                    <i class="icon-top-<?php echo $_thread['top']; ?>"></i>
                                <?php } ?>
								<a href="<?php echo url("thread-$_thread[tid]");?>"><?php echo $_thread['subject'];?></a>
								<?php if($_thread['closed'] > 0) { ?><i class="icon-lock"></i><?php } ?>
							</div>
                            <div class="text-nowrap hidden-sm">
                                <span class="text-muted align-middle"><?php echo $_thread['create_date_fmt'];?></span>
                            </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 } ?>
        </ul>
        
    </div>
</div>
<?php }}} ?>