男的舔女的下面视频在线播放-少妇愉情理仑片高潮日本-久久久久久国产一区二区三区-麻豆精品一区二区综合-国产精品超碰在线观看-网红极品女神精品视频在线-国产亚洲综合777-高清性视频一区二区播放-中文字幕第一页亚洲天堂

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

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

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

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


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

大概是這樣吧

  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ù)制代碼





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

Lv.{$_G[group][stars]} {$_G[group][grouptitle]}是調(diào)用自己的信息,不是主題發(fā)布者的信息
作者: luolongwei    時間: 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ù): 29)

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



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

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

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




歡迎光臨 Discuz! 官方交流社區(qū) (http://m.sdtechgong.com.cn/) Powered by Discuz! X5.0