SCLUB免費論壇申請-使用者論壇's Archiver

jiapinshuizu 發表於 2020-4-16 18:40

【替换匿名头像】头像便换转成不同的图片

[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]

无界 發表於 2020-4-17 15:23

:handshake

4rphotoclub 發表於 2020-4-18 05:43

來支持學習

繽紛色彩 發表於 2020-4-18 22:37

點解會員名稱
會變成:匿名

繽紛色彩 發表於 2020-4-18 22:39

[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]原有會員名是否仍然保留?

neo5353 發表於 2023-10-6 14:09

:D不懂,先试试看

bbs01 發表於 2024-1-7 19:54

免費論壇申請官網 [url]http://www.ykforum.com[/url]

頁: [1]

Powered by Discuz! Archiver 7.2  © 2001-2009 Comsenz Inc.