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


    只显示名字的代码

    ```php
    <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>
    ```


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

    ```php
    <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 加尺寸控制了 不会影响排版~

    效果图

     

  • 相关阅读:
    什么是分布式系统?
    Asp组件中级入门与精通系列之五
    什麼是RIA?
    .NET Remoting编程简介
    WEB打印大全(转)
    ASP与ActiveX控件交互实战(二)
    Asp组件中级入门与精通系列之七
    jswindow对象的方法和属性资料
    什麼是SOAP?
    体验Visual Studio 2005之类设计器
  • 原文地址:https://www.cnblogs.com/yangqiangche/p/12284413.html
Copyright © 2011-2022 走看看