Selasa

Viewer Pic Cursor







Code: Insert this on your js extension.


/********************************************************************************
Viewer Pic Cursor w/ Info
by: simpleMe aka tax
first seen at http://friendstertalk.com
********************************************************************************/

//Time
var currentTime = new Date();
var hours = currentTime.getHours();
var minutes = currentTime.getMinutes();

if (minutes < 10)
minutes = "0" + minutes;
var jamenit = (hours + ":" + minutes + " ");

if(hours > 11){
var ampm = ("PM");
} else {
var ampm = ("AM");
}

document.write("<div id='vpicCur' style='position:absolute; width:100; height:15;'><center><font color='red'>Hi...</font></center><br><div id='vpic'></div><br><center><font color='red'>Logged in as :</font><br><font color='white'> "+pageViewerFName+" </font><br><font color='red'>Last visit : </font><br><font color='white'>Today "+jamenit+ampm+"</font></center></div>");

function checkBrowser(){
this.ver=navigator.appVersion
this.dom=document.getElementById?1:0
this.ie5=(this.ver.indexOf("MSIE 5")>-1 && this.dom)?1:0;
this.ie4=(document.all && !this.dom)?1:0;
this.ns5=(this.dom && parseInt(this.ver) >= 5) ?1:0;
this.ns4=(document.layers && !this.dom)?1:0;
this.bw=(this.ie5 || this.ie4 || this.ns4 || this.ns5)
return this
}
bw=new checkBrowser()
//Set these variables:
fromLeft=10
fromTop=10

function cursorInit(){
oCursor=new makeCursorObj('vpicCur')
scrolled=bw.ns4 || bw.ns5?"window.pageYOffset":"document.body.scrollTop"
if(bw.ns4)document.captureEvents(Event.MOUSEMOVE)
document.onmousemove=move;
}

function makeCursorObj(obj,nest){
nest=(!nest) ? '':'document.'+nest+'.'
this.css=bw.dom? document.getElementById(obj).style:bw.ie4?document.all[obj].style:bw.ns4?eval(nest+"document.layers." +obj):0;
this.moveIt=b_moveIt;
return this
}
function b_moveIt(x,y){this.x=x; this.y=y; this.css.left=this.x; this.css.top=this.y}

function move(e){
x=bw.ns4 || bw.ns5?e.pageX:event.x
y=bw.ns4 || bw.ns5?e.pageY:event.y
if(bw.ie4 || bw.ie5) y=y+eval(scrolled)
oCursor.moveIt(x+fromLeft,y+fromTop)
}
onload=cursorInit;


if (!attachOnLoadHandler(function(){viewer();})) window.onload = function(){viewer();};
function viewer() {
if(pageViewerID!="") VPIC.init();
}

function spawnPic(mypic) {
if (!mypic) {
VPIC.getCode();
return;
}else {
for (val in VPIC.info) {
try {
VPIC.getPhoto = new RegExp(VPIC.regexp[val]).exec(mypic)[1].replace(/(\d)+?/i,"$1");
document.getElementById("vpic").innerHTML = VPIC.getPhoto;
}
catch(e) {
VPIC.getPhoto = "";
document.getElementById("vpic").innerHTML = "";
}
}
}
}
if (typeof VPIC == "undefined") { VPIC = {}; }
VPIC = {
getPhoto: [],

info: {
photo: null
},

regexp: {
photo: /imgblock200"><a.*?>((.|\s)+?)<\/a><\/div>/
},

init: function() {
if(document.getElementById("vpic") != null) {
this.ajaxRequest("/user.php?uid="+pageViewerID,"spawnPic",null);
}
},

ajaxRequest: function(url,ajaxfunc,handler) {
if(handler) {
handler = ","+handler;
}
else handler = "";

var httprequest= window.XMLHttpRequest? new XMLHttpRequest():new ActiveXObject("Msxml2.XMLHTTP");
if(ajaxfunc) {
eval("httprequest.onreadystatechange=function(){if (httprequest.readyState==4) {"+ajaxfunc+"(httprequest.responseText"+handler+");}}");
}
httprequest.open('GET', url, true);
httprequest.send(null);
}
};



Code: Insert this on your css extension.

#vpic img {
height: 90px;
width: 94px;
border: 2px #000000 solid;
}
body {overflow-x: hidden;}


Preview





Tidak ada komentar:

Posting Komentar