Bạn chèn code bên dưới vào phần Footer nhé:
Quote
<script>
// user online today 15t6.com
function TableTodayOnline(){
$$('div.thin').each(function(div){
if(div.parentNode.className=="row4"){
var obj=div.parentNode.parentNode.parentNode;
var imgm=obj.rows[1].cells[0].innerHTML;
var nR1=obj.insertRow(2);
var nD11=nR1.insertCell(0);
nD11.colSpan='2';
nD11.className="pformstrip";
nD11.innerHTML="User(s) Online Today";
var nR2=obj.insertRow(3);
var nD12=nR2.insertCell(0);
var nD22=nR2.insertCell(1);
nD12.innerHTML=imgm;
nD12.className="row2";
nD22.className="row4";
nD22.id='showonlinetoday';
}
});
LoadOnlineToday();
}
function LogoBorowser(title)
{
if(title.match(/Internet Explorer/i)) return "<img src='http://209.85.48.10/12841/196/emo/ie.gif' style='margin-right:2px'/>";
if(title.match(/Netscape/i)) return "<img src='http://209.85.48.10/12841/196/emo/firefox.gif' style='margin-right:2px'/>";
if(title.match(/opera/i)) return "<img src='http://209.85.48.10/12841/196/emo/opera.gif' style='margin-right:2px'/>";
return "";
}
function LoadOnlineToday(){
var time=ShowTime();
time.y=time.y-5;
var url=URLfull+"?act=calendar&code=showday&y="+time.y+"&m="+time.n+"&d="+time.j;
new Ajax.Request(url, {
onCreate:function(){Load('showonlinetoday') },
onFailure:function(){LoadOnlineToday(); },
onComplete:function(request){
var UserToday=[], Name=[];
var txt=request.responseText;
var regOnline=new RegExp("<tr\>\n.*td class='row4' width='1%' valign='middle' nowrap='nowrap'><span class='normalname'>(.*)<\/span><\/td\>\n.*td class='row4' width='99%'>(.*)<\/td\>\n.*\/tr\>\n.*tr\>\n.*td valign='top' class='row1' nowrap='nowrap'>(.*)<\/td\>\n.*td valign='top' class='row1'><span class='postcolor'>(.*)<\/span><\/td\>\n.*\/tr>", "i");
txt.gsub(regOnline, function(match){
var user=match[1].stripTags();
var title=match[4];
var newuser="<span title='"+title.split("......")[0]+"'>"+LogoBorowser(title)+match[1]+"</span>";
if(Name.indexOf(user)==-1){
Name.push(user);
UserToday.push(newuser);
}
return ' ';
});
if($('showonlinetoday'))
$('showonlinetoday').update("<br>"+UserToday.sort()+"<br>");
if(Name.indexOf(UserName())==-1&&UserName()!='Guest'){
var borw=navigator.appName + '---'+navigator.appVersion;
var params="act=calendar&code=addnewevent&event_title=Online&eventtype=single&e_day="+time.j+"&e_month="+time.n+"&e_year="+time.y+"&e_type=public&Post=loggined at :"+new Date().toUTCString()+"......\n\n"+borw;
new Ajax.Request(URLfull,{
method:'post',
parameters:params,
onComplete:function(){LoadOnlineToday();}
});
}
}});
}
</script>