<?php if ($val['is_recommend']) { ?> <span class="sw-recommend-que">荐</span> <?php } ?> <?php if ($val['view_count'] > 2500) { ?> <span class="sw-hot-que">热</span><?php } ?> <?php if ($val['lock']) { ?> <span style="color:#ccc;">[锁定]</span> <?php } ?>修改完成部分代码:
<h4> <?php if ($val['is_recommend']) { ?> <span class="sw-recommend-que">荐</span> <?php } ?> <?php if ($val['view_count'] > 2500) { ?> <span class="sw-hot-que">热</span><?php } ?> <?php if ($val['lock']) { ?> <span style="color:#ccc;">[锁定]</span> <?php } ?> <?php if ($val['question_id']) { ?> <a href="question/<?php echo $val['question_id']; ?>"><?php echo $val['question_content']; ?></a> <?php } else { ?> <a href="article/<?php echo $val['id']; ?>"><?php echo $val['title']; ?></a> <?php } ?> </h4>2. 在static/css/default/common.css最后一行添加:
.sw-hot-que{color: #fff;background-color: #FF669E;padding: 0px 1px;border: 1px solid #FF367E;border-radius: 2px;font-weight: 300;} .sw-recommend-que{color: #fff;background-color: #FF9E66;padding: 0px 1px;border: 1px solid #FF8E50;border-radius: 2px;font-weight: 300;} .sw-nore-que{color: #fff;background-color: #FF9E66;padding: 1px 2px;border-radius: 2px;font-weight: 300;}效果图:
AI智能回复搜索中,请稍后...