多功能PageRank显示插件
作者:aw 类型:转载 来源:awblog
效果
本人的siteInfo页面调用|Example:
http://www.awflasher.com/siteinfo.html
废话不多说:
源文件下载(附带了Flash播放器版本检测)
PRforLBS.rar
使用方法:
首先把pr.js,pagerank.asp,getOCX.swf,prchecker.swf放到LBS的根目录下。
在你的global.asp中相应地方引用pr.js即可(js的目的是获取HTML页址)
<script src="pr.js" type="text/javascript" ></script>
单独引用SWF的话,格式:
prchecker.swf?referer=http://www.awflasher.com
Flash源代码,正好可以给那些不知道如何同服务器打交道的Flasher一个范例,这里既有出也有入
// Do NOT REMOVE!
//ActionScript by aw(www.awflasher.com)
//Do NOT REMOVE!
stop();
MovieClip.prototype.doFlash = function(_do) {
if (_do) {
this.up = true;
this.onEnterFrame = function() {
if (this.up) {
this._alpha += 25;
}
if (!this.up) {
this._alpha -= 25;
}
if (this._alpha>100) {
this.up = false;
}
if (this._alpha<0) {
this.up = true;
}
};
} else {
this._alpha = 100;
delete this.onEnterFrame;
}
return;
};
//
initLoad();
_load();
function _load() {
//
var result_lv:LoadVars = new LoadVars();
result_lv.onLoad = function(success:Boolean) {
if (success) {
showpr(result_lv.pr);
} else {
_root.prdot_mc.doFlash(false);
_root.prdot_mc._visible = false;
}
};
var send_lv:LoadVars = new LoadVars();
send_lv.referer = _root.referer;
send_lv.sendAndLoad("pagerank.asp", result_lv, "POST");
}
function initLoad() {
_root.pr_txt._visible = false;
_root.prdot_mc._width = 40;
_root.prdot_mc.doFlash(true);
}
function showpr(pr) {
_root.pr_txt.text = pr+"/10";
_root.prdot_mc.doFlash(false);
_root.prdot_mc._width = 4*Number(pr);
_root.pr_btn.onRelease = function ()
{
getURL("http://www.awflasher.com/","_blank");
}
_root.pr_btn.onRollOver = function() {
this._alpha = 75;
_root.pr_txt._visible = true;
};
_root.pr_btn.onRollOut = _root.pr_btn.onReleaseOutside=function () {
this._alpha = 0;
_root.pr_txt._visible = false;
};
}
//ActionScript by aw(www.awflasher.com)
//Do NOT REMOVE!
stop();
MovieClip.prototype.doFlash = function(_do) {
if (_do) {
this.up = true;
this.onEnterFrame = function() {
if (this.up) {
this._alpha += 25;
}
if (!this.up) {
this._alpha -= 25;
}
if (this._alpha>100) {
this.up = false;
}
if (this._alpha<0) {
this.up = true;
}
};
} else {
this._alpha = 100;
delete this.onEnterFrame;
}
return;
};
//
initLoad();
_load();
function _load() {
//
var result_lv:LoadVars = new LoadVars();
result_lv.onLoad = function(success:Boolean) {
if (success) {
showpr(result_lv.pr);
} else {
_root.prdot_mc.doFlash(false);
_root.prdot_mc._visible = false;
}
};
var send_lv:LoadVars = new LoadVars();
send_lv.referer = _root.referer;
send_lv.sendAndLoad("pagerank.asp", result_lv, "POST");
}
function initLoad() {
_root.pr_txt._visible = false;
_root.prdot_mc._width = 40;
_root.prdot_mc.doFlash(true);
}
function showpr(pr) {
_root.pr_txt.text = pr+"/10";
_root.prdot_mc.doFlash(false);
_root.prdot_mc._width = 4*Number(pr);
_root.pr_btn.onRelease = function ()
{
getURL("http://www.awflasher.com/","_blank");
}
_root.pr_btn.onRollOver = function() {
this._alpha = 75;
_root.pr_txt._visible = true;
};
_root.pr_btn.onRollOut = _root.pr_btn.onReleaseOutside=function () {
this._alpha = 0;
_root.pr_txt._visible = false;
};
}
FAQ:
Q&A: 什么是PageRank
Q: 为什么我的PR都是0?
A: 因为这款插件是直接获取引用页的PR,而大多数引用页是xxx.asp?id=?这样的形式,这时的PR并非您的blog' PR。如果您希望在任何情况下都显示为您blog' PR,可以直接给SWF传参数referer=http://www.myblog.com/ (看一下pr.js就知道怎么传了)
责任编辑:uufeng 时间:2006年1月9日
- 最近更新
