2008-2-16 10:58
exgbit
[PP插件]会员头像展示
sai没有发布这个,费了点时间,帮她补上~
打开index.php
找到[code]@shuffle($dash_commend);
/* Parasy || E:Hot Topic */[/code]在下面加上[code]//会员展示头像
$home_sql = "select cm.uid,username,nickname,avatar from cdb_members cm left join cdb_memberfields cdm on cm.uid=cdm.uid where avatar !='' order by rand() LIMIT 6";
$home_rs = mysql_query($home_sql);
$home_i = 0;
$homeimg_oo = '';
while ($User = mysql_fetch_object($home_rs)) {
$home_i++;
$img_p = $User->avatar;
if ($User->username)
$User_uname = $User->username;
$homeimg_oo .= '<a href="viewpro.php?uid=' . $User->uid . '" class="friend"><img src="' . $img_p . '" class="portrait" /><br />' . $User_uname . '<div class="tip">' . $User->nickname . '</div></a>';
}
mysql_free_result($home_rs);
//会员展示头像[/code]打开css_babel.css
找到[code]a.friend:hover div.tip, a.friend:active div.tip {
display: block;
position: relative;
top: -160px;[/code]改成[code]a.friend:hover div.tip, a.friend:active div.tip {
display: block;
position: relative;
top: -130px;[/code]打开discuz.htm
找到[code]<script type="text/javascript">initHomeTabs("latest");</script></div>
<!--{/if}-->
<!--{/if}-->[/code]在下面加上[code]<div class="maintable" align="left"><img src="{IMGDIR}/group.png" align="absmiddle" /> 会员头像展示 ...
<table width="100%" cellpadding="0" cellspacing="0" border="0" class="fav">
<tr><td>$homeimg_oo</td></tr>
</table>
</div>[/code]that's it!
2008-2-16 11:07
exgbit
我的论坛没用geo,所以v2ex里本应显示所在域,被我改成了昵称。
2008-2-16 11:13
automan
晚上测试一下
2008-2-16 11:21
exgbit
演示:
[url]http://www.csustbbs.net/bbs[/url]
2008-2-16 11:41
anson
你那张背景图是哪的啊,能分享下吗,让偶想起了救命病栋3最后集那张图片了...(ll01)
2008-2-16 11:47
exgbit
mac.6.cn 这里弄的~
http://www.csustbbs.net/bbs/images/way/bg_city.jpg
[[i] 本帖最后由 exgbit 于 2008-2-16 11:57 编辑 [/i]]
2008-2-16 11:51
anson
哈哈,谢啦..不知是哪个城市的..
偶觉得会员展示换成精选子论坛展示更好,呵呵
2008-2-16 12:04
Sai
Rand()还是少用为好,这里比较环保的方式是:
象热门主题一样多查询几个头像写缓存然后随机显示,缓存定时更新即可
2008-2-16 12:13
kinway
挺不错的:)
页:
[1]
Powered by Discuz! Archiver 5.5.0
© 2001-2006 Comsenz Inc.