Discuz! X1.5贴内用户名根据性别显示不同颜色,并小图标标识
演示图片:方法步骤:
1、下载附件,将解压出来的两个图片文件上传至论坛static\image目录;
2、打开template\default\forum\viewthread_node.htm文件,
查找:
<a href="home.php?mod=space&uid=$post['authorid']" target="_blank" class="xw1">$post</a>$authorverifys
替换成:
<!--{if $post['gender'] == 1}--><a target="_blank" href="home.php?uid=$post['authorid']" style="margin-left: 20px; font-weight: 800"><font color="#24A8EB">$post</font></a> <img src="static/image/m.gif" alt="男性">
<!--{elseif $post['gender'] == 2}--><a target="_blank" href="home.php?uid=$post['authorid']" style="margin-left: 20px; font-weight: 800"><font color="#E60383">$post</font></a> <img src="static/image/w.gif" alt="女性">
<!--{else}--><a target="_blank" href="home.php?uid=$post['authorid']" style="margin-left: 20px; font-weight: 800"><font color="#000000">$post</font></a> (未知性别);<img src="static/image/n.gif" alt="未知性别"><!--{/if}-->
注:里面颜色、图片都可以自己定义,修改成自己想要的!
楼主太给力了!顶一下!
我想我是一天也不能离开酷家QQ空间社区。
3个沙发 哈哈抢个沙发
页:
[1]