pbootcms模板排序列表切换-无需二开,通过php代码进行判断即可
点击不同选项实现不同的排序效果,切换上下页依旧是当前排序效果
目前测试可以实现时间/浏览量/点赞量/随机排序带缩略图/无缩略图
下面是html代码:
<style>
.order {
font-size: 18px;
color: #000;
padding: 10px 20px;
background: #fff;
border-bottom: 1px solid #f1f1f1;
}
.order a {
height: 30px;
line-height: 30px;
font-size: 14px;
color: #333;
margin-right: 10px;
padding: 0 15px;
display: inline-block;
text-align: center;
border-radius: 15px;
background: #f1f1f1;
border: 1px solid #e3e3e3;
}
.order a:hover {
background: #e1e1e1;
}
.order a.active {
color: #fff;
background: red;
}
</style>
<h3 class="order">
排序:<a href="?id=date" rel="external nofollow" <?php $id=$_GET['id']; if($id === "date") {echo 'class=active';} else {}?>>时间</a>
<a href="?id=visits" rel="external nofollow" <?php $id=$_GET['id']; if($id === "visits") {echo 'class=active';} else {}?>>浏览量</a>
<a href="?id=likes" rel="external nofollow" <?php $id=$_GET['id']; if($id === "likes") {echo 'class=active';} else {}?>>点赞量</a>
<a href="?id=random" rel="external nofollow" <?php $id=$_GET['id']; if($id === "random") {echo 'class=active';} else {}?>>随机</a>
<a href="?id=ico" rel="external nofollow" <?php $id=$_GET['id']; if($id === "ico") {echo 'class=active';} else {}?>>带图</a>
<a href="?id=noico" rel="external nofollow" <?php $id=$_GET['id']; if($id === "noico") {echo 'class=active';} else {}?>>无图</a>
</h3>