久久久久av_欧美日韩一区二区在线_国产精品三区四区_日韩中字在线

Discuz! 官方交流社區(qū)

標(biāo)題: 請(qǐng)教:想在版塊列表頁直接顯示每個(gè)發(fā)帖用戶的信息 [打印本頁]

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

謝謝!
(, 下載次數(shù): 15)


作者: luolongwei    時(shí)間: 2024-4-10 21:10
(, 下載次數(shù): 16)

大概是這樣吧

  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>發(fā)布于$thread[dateline]</p>
  15. </div>
復(fù)制代碼





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

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

如果是帖子內(nèi)容頁可以使用$post[authortitle]顯示用戶組,帖子列表頁不知道怎么直接調(diào)用,$thread[authortitle]這樣不行,只能查數(shù)據(jù)了
  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>發(fā)布于$thread[dateline]</p>
  21. </div>
復(fù)制代碼

(, 下載次數(shù): 17)

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



作者: 天外飄仙    時(shí)間: 2024-4-11 09:04
可以定制這個(gè)插件實(shí)現(xiàn)呢!

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

感謝,調(diào)數(shù)據(jù)庫的我也會(huì),本來就已經(jīng)調(diào)用內(nèi)容和附件的數(shù)據(jù),不大想再調(diào)數(shù)據(jù)庫了!
這個(gè)功能也不是必須




歡迎光臨 Discuz! 官方交流社區(qū) (http://www.9999xn.com/) Powered by Discuz! W1.0