本帖最后由 pocketdragon 于 2009-1-13 09:18 编辑
附录一:论坛首页调用滚动会员头像
调用新注册会员
SELECT * FROM uchome_space where avatar = 1 ORDER BY uid DESC
调用排行榜会员
SELECT * FROM uchome_show ORDER BY credit DESC
循环部分代码
<!--{loop $_SBLOCK['block1'] $value}-->
<td style=" border-top:none;"><A title=$value[username] href="space.php?uid=$value[uid]" target=_blank>
<IMG style="BORDER-RIGHT: #000 1px solid; BORDER-TOP: #000 1px solid; BORDER-LEFT: #000 1px solid; BORDER-BOTTOM: #000 1px solid" hspace=10
src="<!--{avatar($value[uid],small)}-->"></A><BR>
<CENTER>
<A href="space.php?uid=$value[uid]" target=_blank">
<DIV class=ellipsis><SPAN>$value[username]</SPAN></DIV></CENTER></A></td>
<!--{/loop}-->
注意:SBLOCK['block1'] 修改成对应的(如:如果这是你创建的第18个调用,那么就应该是block18了!)
缓存时间可以600秒,调用30个
论坛对应的模板文件,discuz.htm
<!-- 滚动头像开始 -->
<DIV class=box>
<SPAN class=headactions><A
style="FONT-WEIGHT: bold; TEXT-DECORATION: underline"
href="http://www.网站域名.com/" target=_blank>想和我成为好友吗?快快加入吧!</A><IMG
id=homelinks_img alt=""
src="{IMGDIR}/collapsed_no.gif"></SPAN>
<H4>新加入的会员</H4>
<TABLE id=homelinks style="TABLE-LAYOUT: fixed" cellSpacing=0 cellPadding=0
width="90%" summary=新会员>
<TBODY>
<TR>
<TD>
<DIV id='demo'
style="OVERFLOW: hidden; WIDTH: 100%; COLOR: #ffffff; HEIGHT: 75px">
<TABLE cellPadding=0 align=left border=0 cellspace="0">
<TBODY>
<TR>
<TD id='demo1' vAlign=top>
<TABLE cellSpacing=0 cellPadding=0 border=0>
<TBODY>
<TR>
<script language="javascript" type="text/javascript" src="http://www.网站域名.com/js.php?id=1"></script>
</TR></TBODY></TABLE></TD>
<TD id='demo2' vAlign=top>
<TABLE cellSpacing=0 cellPadding=0 border=0>
<TBODY>
<TR>
<script language="javascript" type="text/javascript" src="http://www.网站域名.com/js.php?id=1"></script>
</TR></TBODY></TABLE></TD></TR></TBODY></TABLE></DIV>
<SCRIPT>
try{
var speed=5;//速度数值越大速度越慢
document.getElementById('demo2').innerHTML=document.getElementById('demo1').innerHTML;
function Marquee(){
if(document.getElementById('demo2').offsetWidth-document.getElementById('demo').scrollLeft<=0)
document.getElementById('demo').scrollLeft-=document.getElementById('demo1').offsetWidth;
else{
document.getElementById('demo').scrollLeft++;
}
}
var MyMar=setInterval(Marquee,speed);
document.getElementById('demo').onmouseover=function() {
clearInterval(MyMar);
}
document.getElementById('demo').onmouseout=function() {
MyMar=setInterval(Marquee,speed);
}
}catch(e){
}
</SCRIPT>
</TD></TR></TBODY></TABLE></DIV>
<!-- 滚动头像结束 -->
附录二: 将"论坛加好友链接"改为加UCH的好友链接。 将论坛帖子页面的“加为好友”,修改为UCH里的加好友链接: 打开templates\default\viewthread.htm,找到: <ahref="my.php?item=buddylist&newbuddyid=$post[authorid]&buddysubmit=yes"target="_blank" id="ajax_buddy_$post['count']"onclick="ajaxmenu(event, this.id, 3000, 0)"> <ahref="{$uchomeurl}/cp.php?ac=friend&op=add&uid=$post[authorid]"target="_blank">
即可
注意:本代码仅适用于 Discuz!6系列 |