香蕉成人伊视频在线观看|学生小视频国产区|yy女主播啪啪啪视频|麻豆传播媒体APP大全免费版官网|瑜伽牲交AV|国产欧美日韩在线天堂区|白浆精品国产91

Discuz! 官方交流社區

標題: 請教:想在版塊列表頁直接顯示每個發帖用戶的信息 [打印本頁]

作者: 潘樂樂    時間: 2024-4-10 18:26
標題: 請教:想在版塊列表頁直接顯示每個發帖用戶的信息
想在版塊列表頁直接顯示每個發帖用戶的信息,如用戶組、積分等。
就是想把列表頁鼠標滑過用戶名顯示的卡片信息直接顯示出來,請教該如何實現!
想實現類似微博這樣的效果

謝謝!
(, 下載次數: 41)


作者: luolongwei    時間: 2024-4-10 21:10
(, 下載次數: 42)

大概是這樣吧

  1. <div class="thread-card">
  2.         <style>
  3.                 .thread-card{margin-bottom: 15px;}
  4.                 .thread-card img{float:left; width:42px; height:42px; border-radius:50%;}
  5.                 .thread-card h2{margin-left:52px; margin-bottom:2px; font-size:16px; font-weight:500; color:#222;}
  6.                 .thread-card h2 em{margin-left:2px; padding:1px 5px; background:#9dda61; font-size:10px; color:#fff; border-radius:2px;}
  7.                 .thread-card p{margin-left:52px; font-size:12px; color:#8d8d8d;}
  8.         </style>
  9.         <img src="uc_server/avatar.php?uid={$thread['authorid']}&size=middle" alt="<!--{if $thread['authorid'] && $thread['author']}-->{$thread[author]}<!--{else}-->{$_G[setting][anonymoustext]}<!--{/if}-->">
  10.         <h2>
  11.                 <!--{if $thread['authorid'] && $thread['author']}-->{$thread[author]}<!--{else}-->{$_G[setting][anonymoustext]}<!--{/if}-->
  12.                 <em>Lv.{$_G[group][stars]} {$_G[group][grouptitle]}</em>
  13.         </h2>
  14.         <p>發布于$thread[dateline]</p>
  15. </div>
復制代碼





作者: 潘樂樂    時間: 2024-4-10 22:25
luolongwei 發表于 2024-4-10 21:10
大概是這樣吧

Lv.{$_G[group][stars]} {$_G[group][grouptitle]}是調用自己的信息,不是主題發布者的信息
作者: luolongwei    時間: 2024-4-11 01:20
潘樂樂 發表于 2024-4-10 22:25
Lv.{$_G[group][stars]} {$_G[group][grouptitle]}是調用自己的信息,不是主題發布者的信息 ...

如果是帖子內容頁可以使用$post[authortitle]顯示用戶組,帖子列表頁不知道怎么直接調用,$thread[authortitle]這樣不行,只能查數據了
  1. <div class="thread-card">
  2.         <style>
  3.                 .thread-card{margin-bottom: 15px;}
  4.                 .thread-card img{float:left; width:42px; height:42px; border-radius:50%;}
  5.                 .thread-card h2{margin-left:52px; margin-bottom:2px; font-size:16px; font-weight:500; color:#222;}
  6.                 .thread-card h2 em{margin-left:2px; padding:1px 5px; background:#9dda61; font-size:10px; color:#fff; border-radius:2px;}
  7.                 .thread-card p{margin-left:52px; font-size:12px; color:#8d8d8d;}
  8.         </style>
  9.         <img src="uc_server/avatar.php?uid={$thread['authorid']}&size=middle" alt="<!--{if $thread['authorid'] && $thread['author']}-->{$thread[author]}<!--{else}-->{$_G[setting][anonymoustext]}<!--{/if}-->">
  10.         <h2>
  11.                 <!--{if $thread['authorid'] && $thread['author']}-->{$thread[author]}<!--{else}-->{$_G[setting][anonymoustext]}<!--{/if}-->
  12.                 {eval $authorId = $thread['authorid'];}
  13.         {eval $authorInfo = C::t('common_member')->fetch($authorId);}
  14.         {eval $groupId = $authorInfo['groupid'];}
  15.         {eval $groupInfo = C::t('common_usergroup')->fetch($groupId);}
  16.         {eval $groupName = $groupInfo['grouptitle'];}
  17.         {eval $stars = $groupInfo['stars'];}
  18.                 <em>Lv.{$stars} {$groupName}</em>
  19.         </h2>
  20.         <p>發布于$thread[dateline]</p>
  21. </div>
復制代碼

(, 下載次數: 44)

效果如圖,我在3.4測試的好像沒什么問題,然后有需要的話再調其它信息,比如用戶積分這些



作者: 天外飄仙    時間: 2024-4-11 09:04
可以定制這個插件實現呢!

直接改模板的話 不方便 日后維護;  如果能接受有償的話 可以加我QQ
作者: 潘樂樂    時間: 2024-4-11 21:53
luolongwei 發表于 2024-4-11 01:20
如果是帖子內容頁可以使用$post[authortitle]顯示用戶組,帖子列表頁不知道怎么直接調用,$thread[author ...

感謝,調數據庫的我也會,本來就已經調用內容和附件的數據,不大想再調數據庫了!
這個功能也不是必須




歡迎光臨 Discuz! 官方交流社區 (http://m.yu-jie.cn/) Powered by Discuz! X5.0