自定义"最近访客"和"我的好友"模块
a:hover img,.gbook img,.serial .comm,.photo img{filter:none}
a img,.serial .pic,table.usr_info img{filter:alpha(opacity=100,style=2)}
/*自定义访客和我的好友等处图片的滤镜效果*/
.send_msg {background:transparent;}
/*透明“发送纸条”的图片另:还可定义隐藏或者加滤镜效果*/
bodybg,.links .mid,.label .mid,
.callboard .mid{background:#transparent;}
/*自定义相应部分透明*/
.links .desc{color:#ff0000;}
/*自定义访客处日期字体颜色*/
.links a{color:#ff0000;}
/*自定义访客和我的好友处姓名字体颜色*/
二、将上述代码粘贴到记事本,对相应的颜色代码做修改之后,再“另存为”名称诸如“xxxx.css”的CSS文件,然后上传到自己注册的网络空间(推荐:http://www.ik8.com ),取得CSS文件的网络地址后放入下列调用代码中:
<LINK media=all href=CSS文件的网址 type=text/css rel=Stylesheet>
--------------------文章分割线--------------------
“最近访客”的个性化设置
<html>
<head>
<title>访客记录</title>
<meta name="Generator" content="EditPlus">
<meta name="Author" content="FlashSoft">
<meta name="Keywords" content="FlashSoft">
<meta name="Description" content="">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<META HTTP-EQUIV="CACHE-CONTROL" CONTENT="NO-CACHE">
<style type="text/css">
body { background:transparent;
background-color: transparent;
margin: 0px;
border: 0px;
padding: 0px;
}
body, td, div, span, {
font-size: 12px;
font-family: "Courier New", "宋体";
color: #71b4fe;/*修改除访客名字以外字体颜色*/
}
a {
text-decoration:alpha;FILTER: Glow(color=#71b4fe,strength=1); COLOR: #ffc975; HEIGHT: 9pt;
}/*修改名字样式为发光字体*/
a:hover {background:#fe436d}/*修改超链接处鼠标放上去时背景颜色*/
.name{
font-family: "Courier New", "宋体";height: 12px; font-size: 12px;padding:0px:0;
}
.links{
width:100%;
}
.links .wd{
width:100%;
}
a:hover img{filter:none;}
a img{filter:alpha(opacity=100,style=2);}/*个性相片朦胧效果*/
</style>
<script language="JavaScript" id="scriptBox"></script>
<script language="JavaScript">
<!--
function getLocTime(nS) {
return new Date(parseInt(nS) * 1000).toLocaleString().replace(/年|月/g, " - ").replace(/日/g, " ");
}
function getFlower(d1, d2) {
if(d2 >= d1) {
if((d2 - d1)/60/60 < 24) {
return "";
}
else {
return "none";
}
}
return "";
}
function getURL(sURL) {
return "http://blog.sina.com.cn/" + sURL;
}
function getPhoto(sURL) {
if(sURL.length > 1) {
return "http://www.chinage.net/getpic5.asp?url=http://album.sina.com.cn/pic_4/" + sURL;
}
return "http://image2.sina.com.cn/blog/tmpl/v3/images/fl_defualt.jpg";
}
function writeData() {
var rr_time = "1177572863";
var Head_Data = '<table border="0" width="100%" cellspacing="0" cellpadding="0">';
var Body_Data = '';
var Foot_Data = '</table>';
rr_data.reverse();
for(var i = 0; i < rr_data.length; i ++ ) {
Body_Data += '<tr><td valign="middle" style="height: 41px;background-image: url();background-position: left bottom;background-repeat:repeat-x;">\
<table cellspacing="0" width="100%" cellpadding="0" border="0" class="wd">\
<tbody><tr>\
<td width="2" align="left" class="ico"></td>\
<td class="dashed">\
<table cellspacing="0" cellpadding="0" border="0">\
<tbody>\
<tr>\
<td rowspan="2" width=16 align=left><img src="http://xtmb.xinwen365.com/S1.gif" style="display:' + getFlower(rr_data[i].newupdate, rr_time) + '"\></td>\
<td width="31" rowspan="2"><a target="_blank" href="' + getURL(rr_data[i].url) + '"><img src="' + getPhoto(rr_data[i].photo) + '" style="border:2px solid #fff000" height="60" width="60" onerror="this.src=\'http://image2.sina.com.cn/blog/tmpl/v3/images/fl_defualt.jpg\'"></a></td>\
<td class="name"><a style="padding: 0px; font-size: 12px; font-weight: normal;" target="_blank" href="' + getURL(rr_data[i].url) + '">' + rr_data[i].nick + '</a></td>\
</tr>\
<tr>\
<td style="text-align:left;padding: 0px; font-family: Arial; font-size: 10px; height: 10px;" class="desc">' + getLocTime(rr_data[i].time) + '</td>\
</tr>\
</tbody>\
</table>\
</td>\
</tr></tbody></table></td>\
</tr>';
}
if(rr_data == 0)
{
Body_Data += '<tr><td valign="middle" class="tdLine"><table border="0" cellpadding="0" cellspacing="0" width="100%">\
<tr><td class="tdCHS" align="center">暂时还没有访客记录,<br>赶快邀请您的朋友来访问吧。</td>\
</tr>\
</table></td>\
</tr>';
}
document.getElementById("DataBox").innerHTML = Head_Data + Body_Data + Foot_Data;
parent.iframeResize(window.frameElement.id,document.body.scrollHeight);
}
var timeoutNum = 4; // 单位秒
var t = 0;
var timer;
window.onload = function () {
document.getElementById("scriptBox").src = "http://util.blog.sina.com.cn/rr?1147187011";
timer = setInterval(function ()
{
if(typeof(rr_data) != "undefined")
{
writeData();
clearInterval(timer);
}
if(t == timeoutNum)
{
rr_data = [];
writeData();
clearInterval(timer);
}
t ++;
}, 1000);
}
//-->
</script>
<body>
<div class="links">
<div id="DataBox" class="mid" style="text-align:left">
<table border="0" cellspacing="0" cellpadding="0" height="100%" width="100%">
<tr><td valign="middle" height="100%">
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr><td align="center" height="100%">最近访客记录加载中...</td></tr>
</table>
</td></tr>
</table>
</div>
</div>
</body>
</html>
代码说明:代码中橙色部分是修改访客相片前小星星图片地址及图片宽度,图片不要太大以20*20以内为好。绿色部分是修改访客相片显示的大小和边框宽度及边框颜色。红色部分是你的博客没有升级前的id号也就是你的新浪通行证号。
具体制作方法:
1.将修改后完整代码保存为txt文件,上传到网络空间『推荐空间http://www.xinwen365.com/index.asp』获得文件在网络空间的地址后用下面框架代码调用:
<P align=center> <iframe SRC="文件上传后获得的网络空间地址" FRAMEBORDER="0" WIDTH="190" SCROLLING="no" HEIGHT="650" ALLOWTRANSPARENCY=""></IFRAME></P>
<style type=text/css>
.sysBr180{width:190px;}
</style>
注意:框架代码中宽度和高度随你修改的代码中绿色部分(就是修改了访客相片显示大小及边框宽度的)做相应调整,修改了模板宽度的朋友把自定义模板代码中上面蓝色部分代码中宽度值改为和框架代码中宽度值相符。否则会显示不全。用系统模板的就直接把上面代码添加。
2.把原来添加的访客记录隐藏,重新建立一个新空白模块,把上面完整框架代码加入即可。
文章转自闲庭漫步