进入后台—广告—添加“页尾通栏广告”
广告标题(必填):随意
广告投放范围(必选):全部
广告投放位置:下
广告 HTML 代码如下:
[CSS] 纯文本查看 复制代码 <script language="javascript">
function usernophoto() {
showDialog('<font color=red>您尚未更新头像,无法发帖、回复及下载资料!</font></br>请立即点此<a href="/memcp.php?action=profile&typeid=3"><font color=green><b>更新头像</b></font></a>', 'notice', '友情提醒', null, 1);
}
var userid = discuz_uid.toString();
var imgurl = "";
var ucenterurl = "uc_server/data/avatar";
var isinspace = -1;
if (document.getElementById("ct")) {
isinspace = document.getElementById("ct").innerHTML.indexOf("设置我的新头像");
}
if (parseInt(userid) > 0 && isinspace == -1) {
if (userid.length <= 2) {
if (userid.length == 1) {
userid = "0" + userid;
}
imgurl = "/000/00/00/" + userid + "_avatar_small.jpg";
} else if (userid.length > 2 && userid.length <= 4) {
var strend = userid.slice(-2);
var strstar = userid.slice(0, userid.length - 2);
if (strstar.length == 1) {
strstar = "0" + strstar;
}
imgurl = "/000/00/" + strstar + "/" + strend + "_avatar_small.jpg";
} else if (userid.length > 4 && userid.length <= 6) {
var strend = userid.slice(-2);
var strmid = userid.slice(-4).slice(0, 2);
var strstar = userid.slice(0, userid.length - 4);
if (strstar.length == 1) {
strstar = "0" + strstar;
}
imgurl = "/000/" + strstar + "/" + strmid + "/" + strend + "_avatar_small.jpg";
} else if (userid.length > 6 && userid.length <= 9) {
var strend = userid.slice(-2);
var strmid = userid.slice(-4).slice(0, 2);
var strstar = userid.slice(-6).slice(0, 2);
var strtop = userid.slice(0, userid.length - 6);
if (strtop.length == 1) {
strtop = "00" + strtop;
} else if (strtop.length == 2) {
strtop = "0" + strtop;
}
imgurl = "/" + strtop + "/" + strstar + "/" + strmid + "/" + strend + "_avatar_small.jpg";
}
imgurl = ucenterurl + imgurl;
document.write('<div style="display:none;height:0;"><img src="' + imgurl + '" width="0" height="0" onerror="usernophoto()" /></div>');
}
</script>
|