zoukankan      html  css  js  c++  java
  • DISCUZ 如何为主题帖列表页添加头像,显示发帖者头像

    只显示名字的代码

    <em style=" font-size:14px;">
                                                                            <!--{if $thread['authorid'] && $thread['author']}-->
                                                                                    <a href="home.php?mod=space&uid=$thread[authorid]" c="1"{if $groupcolor[$thread[authorid]]} style="color: $groupcolor[$thread[authorid]];"{/if}> $thread[author]</a><!--{if !empty($verify[$thread['authorid']])}--> $verify[$thread[authorid]]<!--{/if}-->
                                                                            <!--{else}-->
                                                                                    $_G[setting][anonymoustext]
                                                                            <!--{/if}-->
                                                                            </em>
    

    修改后可显示头像的代码,(我把头像加上后把显示名字注释掉了)

    <em style=" font-size:14px;">
    									<!--{if $thread['authorid'] && $thread['author']}-->
    										<a href="home.php?mod=space&uid=$thread[authorid]" c="1"{if $groupcolor[$thread[authorid]]} style="color: $groupcolor[$thread[authorid]];"{/if}> <img src="/uc_server/avatar.php?uid=$thread[authorid]&size=small"><!--$thread[author]--> </a><!--{if !empty($verify[$thread['authorid']])}--> $verify[$thread[authorid]]<!--{/if}-->
    									<!--{else}-->
    										$_G[setting][anonymoustext]
    									<!--{/if}-->
    									</em>
    

    DZ获取头像的 是/uc_server/avatar.php?uid=$thread[authorid]&size=small
    其中size=small 就是获取最小尺寸的那个头像 所以不用在给img 加尺寸控制了 不会影响排版~
    演示地址编程探讨/源码分享限 - 优雅草技术支持论坛-PHP/源码/技术问题以及交流 专注PHP技术以及源码!
    效果图

    在这里插入图片描述

  • 相关阅读:
    【转】 Ubuntu安装jdk报错:-bash /usr/.../java:No such file or directroy
    sudo 出现unable to resolve host 解决方法
    C99 布尔
    面向对象?
    高斯消元
    白皮 Chapter 2
    白皮 Chapter 1
    开启暑假新生活( •̀ ω •́ )
    [vijos P1040] 高精度乘法
    [SCOI2007] 修车
  • 原文地址:https://www.cnblogs.com/yangqiangche/p/12441287.html
Copyright © 2011-2022 走看看