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技术以及源码!
    效果图

    在这里插入图片描述

  • 相关阅读:
    Rust 常见集合
    Rust模块
    Rust包和crate以及模块
    Rust枚举和模式匹配
    React Native滚动到指定位置
    三行代码让你的React/RN应用动起来
    React Native添加自定义全局组件
    MAC下网易MuMu模拟器调试ReactNative
    解决React Navigation goBack()无效
    “Mac应用”已损坏,打不开解决办法
  • 原文地址:https://www.cnblogs.com/yangqiangche/p/12441287.html
Copyright © 2011-2022 走看看