首页板块名称背景颜色修改教程
2021年01月17日 4456

xiuno

image.webp

本教程以XIUNOBBS官方版基础上修改:

1、安装帖子增强插件

2、找到 /plugin/haya_post_info/hook/thread_list_inc_username_before.htm

把 

<a href="<?php echo url("forum-$_thread       [fid]");?>" target="_blank" title="<?php echo $_thread       ['forumname'];?>" class="badge  small mr-2 haya-post-info-home-thread-forum-username-before">

改为

 

<a href="<?php echo url("forum-$_thread       [fid]");?>" target="_blank" title="<?php echo $_thread       ['forumname'];?>" class="badge 
<?php if ($_thread       ['fid'] == 1) { ?>
badge-primary
<?php } ?>
<?php if ($_thread       ['fid'] == 2) { ?>
badge-secondary
<?php } ?>
<?php if ($_thread       ['fid'] == 3) { ?>
badge-success
<?php } ?>
<?php if ($_thread       ['fid'] == 4) { ?>
badge-info
<?php } ?>
<?php if ($_thread       ['fid'] == 5) { ?>
badge-warning
<?php } ?>
<?php if ($_thread       ['fid'] == 6) { ?>
badge-danger
<?php } ?>
<?php if ($_thread       ['fid'] == 7) { ?>
badge-secondary
<?php } ?>
<?php if ($_thread       ['fid'] == 8) { ?>
badge-dark
<?php } ?>
<?php if ($_thread       ['fid'] == 9) { ?>
badge-primary
<?php } ?>
<?php if ($_thread       ['fid'] == 10) { ?>
badge-warning
<?php } ?> small mr-2 haya-post-info-home-thread-forum-username-before">

 

3、后台帖子增强插件设置 - 首页帖子列表显示板块2

 

image.webp

提示:本站以10个版块为例。

附上颜色对照表:

image.webp

比如红色就按照这样子格式:badge-danger

<?php if ($_thread       ['fid'] == 5) { ?>
badge-danger
<?php } ?>

板块ID为5的颜色为红色。

懒人版请下载附件覆盖,覆盖前请备份,出现问题不负责。

来自


- End -




0 条评论
  • 表情
  • 游客你好,回复内容需要 登录 查看!