【替换匿名头像】头像便换转成不同的图片
[i=s] 本帖最後由 jiapinshuizu 於 2020-4-16 19:27 編輯 [/i]原创:无界
更新页面,头像就会变换
[attach]80592[/attach]
1.打开viewthread_node模板
搜索[code]<div class="avatar">[/code]viewthread_node模板里有两处<div class="avatar">代码,在第二个<div class="avatar">代码底下添加[code]<script language="JavaScript">
var how_many_ads = 5
var now = new Date()
var sec = now.getSeconds()
var ad = sec % how_many_ads;
ad +=1;
if (ad==1){
banner="图片地址";
width="100";
}
if (ad==2) {
banner="图片地址";
width="100";
}
if (ad==3) {
banner="图片地址";
width="100";
}
if (ad==4) {
banner="图片地址";
width="100";
}
if (ad==5) {
banner="图片地址";
width="100";
}
document.write('<img style=\"padding: 5px 5px 8px;background: #FFF url() 0 100% repeat-x;\" src=\"' + banner + '\" >')
</script>
[/code]注:图片大小为120*120
**** Hidden Message *****
测试地址:[url=http://jiapinshuizu.imotor.com/thread-1437-1-1.html]http://jiapinshuizu.imotor.com/thread-1437-1-1.html[/url] :handshake 來支持學習 點解會員名稱
會變成:匿名 [i=s] 本帖最後由 繽紛色彩 於 2020-4-18 23:10 編輯 [/i]
原來是管理員自行修改
那麼會員變得很混亂
[quote]
[size=2][color=#999999]无界 發表於 2020-4-17 15:23[/color] [url=http://www.sclub.com.tw/discuz/redirect.php?goto=findpost&pid=303832&ptid=37729][img]http://www.sclub.com.tw/discuz/images/common/back.gif[/img][/url][/size][/quote]
如果唔改動這段代碼[code]space.php?uid=$post[authorid]" target="_blank[/code]原有會員名是否仍然保留? :D不懂,先试试看 免費論壇申請官網 [url]http://www.ykforum.com[/url]
頁:
[1]