Discuz!官方免费开源建站系统

 找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索

[修改] 右下角的博客推荐广告!(任何一个版本都可以!)

[复制链接]
xiaobo520 发表于 2010-11-13 19:22:27 | 显示全部楼层 |阅读模式
插件发布
插件名称: 右下角的博客推荐广告!
插件来源:
适用版本: Discuz! X1.5
语言编码: GBK简体 UTF8简体 BIG5繁体 UTF8繁体 
最后更新时间:
插件作者: 小波
插件简介: 右下角的博客推荐广告!


在后台-----全局------网站第三方统计代码:加入此代码
  1. <script language="javascript">
  2. {//
  3. var ua = navigator.userAgent;
  4. var $IE = (navigator.appName == "Microsoft Internet Explorer");
  5. var $IE5 = $IE && (ua.indexOf('MSIE 5') != -1);
  6. var $IE5_0 = $IE && (ua.indexOf('MSIE 5.0') != -1);
  7. var $Gecko = ua.indexOf('Gecko') != -1;
  8. var $Safari = ua.indexOf('Safari') != -1;
  9. var $Opera = ua.indexOf('Opera') != -1;
  10. var $Mac = ua.indexOf('Mac') != -1;
  11. var $NS7 = ua.indexOf('Netscape/7') != -1;
  12. var $NS71 = ua.indexOf('Netscape/7.1') != -1;
  13. if ($Opera) {
  14. $IE = true;
  15. $Gecko = false;
  16. $Safari = false;
  17. }//
  18. if ($IE5) {
  19. $IE = true;
  20. $Gecko = false;
  21. $Safari = false;
  22. }
  23. }//
  24. function $_t(root,tag,id){
  25. var ar=root.getElementsByTagName(tag);
  26. for (var i=0;i<ar.length;i++){
  27. if (ar[i].id==id) return ar[i];
  28. }
  29. return null;
  30. }//
  31. function _(root){
  32. var ids=arguments;
  33. var i0=0;
  34. if (typeof(root) == 'string') root = document;
  35. else i0=1;
  36. for (var i=i0;i<ids.length;i++){
  37. var s=root.getElementsByTagName("*");
  38. var has=false;
  39. for (var j=0;j<s.length;j++){
  40. if (s[j].id==ids[i]){
  41. root=s[j];
  42. has=true;
  43. break;
  44. }
  45. }
  46. if (!has) return null;
  47. }
  48. return root;
  49. }//
  50. //util
  51. function $dele(o,fn,rv){
  52. var r = function (){
  53. var s=arguments.callee;
  54. var args = [];
  55. for (var i=0;i<s.length;i++) args[i]=s[i];
  56. var argStr = args.join(",");
  57. if (argStr.length > 0) argStr=","+argStr;
  58. var callStr="s.thiz[s.fn]("+argStr+")";
  59. var v=eval(callStr);
  60. if (s.rv!=null) {
  61. return s.rv;
  62. } else {
  63. return v;
  64. }
  65. }//
  66. r.thiz=o;
  67. r.fn=fn;
  68. r.rv=rv;
  69. return r;
  70. }
  71. function $ge(e){
  72. if (e!=null) return e;
  73. if ($IE) {
  74. return window.event;
  75. } else return e;
  76. }
  77. /*
  78. * get event for a element;
  79. */
  80. function $gte(e,ev){
  81. if (!e.getElementById) e=e.ownerDocument;
  82. if ($IE) {
  83. return ev!=null ? ev : e.parentWindow.event;
  84. } else {
  85. return ev;
  86. throw new Error("this method can only execute in IE");
  87. }
  88. }//
  89. function $addEL(n,e,l,b){
  90. if ($IE){
  91. if (n["$__listener_"+e]==null){
  92. var lst=function (e){
  93. var f=arguments.callee;
  94. var ar=f.fList;
  95. e=$ge(e);
  96. for (var i=0;i<ar.length;i++){
  97. ar[i](e);
  98. }
  99. }
  100. lst.fList=[];
  101. n["$__listener_"+e]=lst;
  102. n["on"+e]=n["$__listener_"+e];
  103. }
  104. var fList=n["$__listener_"+e].fList;
  105. fList[fList.length]=l;
  106. } else {
  107. n.addEventListener(e,l,b);
  108. }
  109. }//
  110. function $cancelEvent (e) {
  111. if ($IE) {
  112. e.returnValue = false;
  113. e.cancelBubble = true;
  114. } else
  115. e.preventDefault();
  116. };
  117. function $cpAttr(o,p){
  118. for (var i in p){
  119. var s=p[i];
  120. o[i]=s;
  121. }
  122. return o;
  123. }
  124. function $getValue(v,d){
  125. return v==null ? d : v;
  126. }//
  127. var $gv=$getValue;
  128. var $dom={
  129. parseInt : function(s) {
  130. if (s == null || s == '' || typeof(s)=='undefined')
  131. return 0;
  132. return parseInt(s);
  133. },
  134. getClientSize : function(n){
  135. if ($IE){
  136. //ts("this is ie");
  137. var s= {x:n.clientLeft,y:n.clientTop};
  138. s.l=s.x;
  139. s.t=s.y;
  140. s.r=n.clientRight;
  141. s.b=n.clientBottom;
  142. s.w=n.clientWidth;
  143. s.h=n.clientHeight;
  144. //tr("calculated client size");
  145. return s;
  146. } else {
  147. var t=n.style;
  148. if (t.borderLeftWidth.length==0 || t.borderTopWidth.length==0 || t.borderRightWidth.length==0 || t.borderBottomWidth.length==0){
  149. var l=n.offsetWidth;
  150. t.borderLeftWidth="0px";
  151. l-=n.offsetWidth;
  152. var r=n.offsetWidth;
  153. t.borderRightWidth="0px";
  154. r-=n.offsetWidth;
  155. var o=n.offsetHeight;
  156. t.borderTopWidth="0px";
  157. o-=n.offsetHeight;
  158. var b=n.offsetHeight;
  159. t.borderBottomWidth="0px";
  160. b-=n.offsetHeight;
  161. t.borderLeftWidth=l+"px";
  162. t.borderTopWidth=o+"px";
  163. t.borderRightWidth=r+"px";
  164. t.borderBottomWidth=b+"px";
  165. var s={l:l,r:r,t:o,b:b,x:l,y:o};
  166. return s;
  167. } else {
  168. var s= {
  169. x: this.parseInt(n.style.borderLeftWidth),
  170. y: this.parseInt(n.style.borderTopWidth),
  171. r: this.parseInt(n.style.borderRightWidth),
  172. b: this.parseInt(n.style.borderBottomWidth)
  173. };
  174. s.l=s.x;
  175. s.t=s.y;
  176. return s;
  177. }
  178. }
  179. },
  180. getSize : function (n,withMargin){
  181. var c={
  182. x : n.offsetWidth != null ? n.offsetWidth : 0,
  183. y : n.offsetHeight != null ? n.offsetHeight : 0
  184. };
  185. //c.x=this.parseInt(c.x);
  186. //c.y=this.parseInt(c.y);
  187. //tr("get size for : "+n.id);
  188. //tra(c);
  189. if (withMargin) {
  190. var m=this.getMargin(n);
  191. c.x+=m.l+m.r;
  192. c.y+=m.t+m.b;
  193. }
  194. //tra(m);
  195. //tr("get size for : "+n.id);
  196. //tra(c);
  197. return c;
  198. },
  199. setSize : function(elmt,x,y,withMargin){
  200. //tf("$dom::setSize");
  201. //if (elmt==undefined || elmt.style.display=="none") return;
  202. if ($IE){
  203. if (withMargin){
  204. var m=this.getMargin(elmt);
  205. x-=m.l+m.r;
  206. y-=m.t+m.b;
  207. }
  208. elmt.style.width=x;
  209. elmt.style.height=y;
  210. } else {
  211. var clientSize=this.getClientSize(elmt);
  212. var dx=clientSize.l+clientSize.r;
  213. var dy=clientSize.t+clientSize.b;
  214. elmt.style.width=x-dx+"px";
  215. elmt.style.height=y-dy+"px";
  216. }
  217. },
  218. /*
  219. * get the context position relative to its parent.
  220. */
  221. getPosition : function (elmt,withMargin){
  222. var c;
  223. c={
  224. x:elmt.offsetLeft,
  225. y:elmt.offsetTop
  226. };
  227. //c.x=this.parseInt(c.x);
  228. //c.y=this.parseInt(c.y);
  229. if (withMargin){
  230. var m=this.getMargin(elmt);
  231. c.x-=m.l;
  232. c.y-=m.t;
  233. }
  234. return c;
  235. },
  236. setPosition : function (elmt,x,y,withMargin){
  237. //tf("$dom::setPosition");
  238. if (withMargin){
  239. //var m=this.getMargin(elmt);
  240. //x-=m.l;
  241. //y-=m.t;
  242. }
  243. elmt.style.left=x+"px";
  244. elmt.style.top=y+"px";
  245. },
  246. setAlpha : function (n,a){
  247. return;
  248. n.style.filter = "progid:DXImageTransform.Microsoft.Alpha(opacity="+a*100+");";
  249. n.style.opacity = a;
  250. n.style.MozOpacity = a;
  251. }
  252. }//
  253. var $motion={
  254. smooth : function (s, e, t){
  255. if (t>1) t=1;
  256. return (e - s) * t + s;
  257. }
  258. }//
  259. function PopUp(id, config){
  260. this.id=id;
  261. var c = this.config = config;
  262. c.width = $gv(c.width,300);
  263. c.height = $gv(c.height,200);
  264. c.bottom = $gv(c.bottom,0);
  265. c.right = $gv(c.right,20);
  266. c.display = $gv(c.display,true);
  267. c.contentUrl= $gv(c.contentUrl,"");
  268. c.motionFunc= $gv(c.motionFunc,$motion.smooth);
  269. c.position = {x:0,y:0};
  270. var t=c.time;
  271. t.slideIn = $gv(t.slideIn,10);
  272. t.hold = $gv(t.hold,10);
  273. t.slideOut = $gv(t.slideOut,10);
  274. t.slideIn *= 1000;
  275. t.hold *= 1000;
  276. t.slideOut *= 1000;
  277. this.container = document.body;
  278. this.popup = null;
  279. this.content = null;
  280. this.switchButton = null;
  281. this.moveTargetPosition = 0;
  282. this.startMoveTime = null;
  283. this.startPosition = null;
  284. this.status = PopUp.STOP;
  285. this.intervalHandle = null;
  286. this.mm = "max";
  287. this.imgMin = "";
  288. this.imgMax = "";
  289. }//
  290. //static members
  291. PopUp.STOP = 0;
  292. PopUp.MOVE_DOWN = 1;
  293. PopUp.MOVE_UP = 2;
  294. PopUp.SWITCH_TO_MIN = PopUp.MOVE_DOWN | 4;
  295. PopUp.SWITCH_TO_MAX = PopUp.MOVE_UP | 8;
  296. var __o={
  297. create : function (){
  298. var doc=document;
  299. var c=this.config;
  300. //create popup holder & config it.
  301. var p = this.popup = doc.createElement("div");
  302. this.container.appendChild(p);
  303. p.id=this.id;
  304. p.style.cssText="position:absolute; z-index:9000; overflow:hidden; border:0px solid #f00; ";
  305. $dom.setSize(p, c.width, c.height);
  306. //create popup content holder & config it.
  307. var t = this.content = doc.createElement("div");
  308. p.appendChild(t);
  309. t.id = this.id+"_content";
  310. t.style.cssText="position:absolute; z-index:1; overflow:hidden;";
  311. $dom.setSize(t, c.width, c.height);
  312. $dom.setPosition(t,0,0);//add
  313. c.position.y = c.height;//add
  314. this.onresize();//add
  315. //$dom.setPosition(t, 0, c.height);//hide it at first
  316. // create content holder's content.
  317. // a close button & an iframe for loading external content.
  318. t.innerHTML = "<a id='closeButton' href='#'></a>"+
  319. "<a id='switchButton' href='#'></a>"+
  320. "<iframe id='"+this.id+"_content_iframe' src="+c.contentUrl+" frameborder=0 scrolling=no width='100%' height='100%' style='height:100%'></iframe>";
  321. var sBtn = this.switchButton = $_t(t,'a',"switchButton");
  322. sBtn.style.cssText='position:absolute; z-index:2; font-size:0px; line-height:0px; left:220px; top:6px; width:15px; height:15px; background-image:url("http://blog.zzxb.tk/img/U814P346T1D1076F6DT20070725145920.gif");';
  323. $addEL(sBtn,"click",$dele(this,"switchMode"),true);
  324. $addEL(sBtn,"click",$cancelEvent,true);
  325. var btn = $_t(t,'a',"closeButton");
  326. btn.style.cssText='position:absolute; z-index:2; font-size:0px; line-height:0px; left:240px; top:6px; width:15px; height:15px; background-image:url("http://blog.zzxb.tk/img/U814P346T1D1076F354DT20070725152720.gif");';
  327. $addEL(btn,"mouseover",function (e){
  328. $dom.setAlpha(this,0.4);
  329. },true);
  330. $addEL(btn,"mouseout",function (e){
  331. $dom.setAlpha(this,1);
  332. },true);
  333. $addEL(btn,"click",$dele(this,"hide"),true);
  334. $addEL(btn,"click",$cancelEvent,true);
  335. var container=$IE ? document.body : document.documentElement;
  336. $addEL(document.body,"resize",$dele(this,"onresize"),true);
  337. this.__hackTimer=window.setInterval("__popup.onresize()",50);
  338. $addEL(container,"scroll",$dele(this,"onresize"),true);
  339. //initialize position at once.
  340. this.onresize();
  341. },
  342. show : function (){
  343. if (!this.config.display) return;
  344. this.moveTargetPosition = 0;
  345. this.status = PopUp.MOVE_UP;
  346. this.startMove();
  347. },
  348. hide : function (){
  349. this.moveTargetPosition = this.config.height;
  350. this.status = PopUp.MOVE_DOWN;
  351. this.startMove();
  352. },
  353. minimize : function (){
  354. //alert("minimize");
  355. this.mm = "min";
  356. this.moveTargetPosition = this.config.height - 28;
  357. this.status = PopUp.SWITCH_TO_MIN;
  358. this.startMove();
  359. var s = this.switchButton.style;
  360. var bg = s.backgroundImage;
  361. if (bg.indexOf(this.imgMin) > -1) {
  362. bg = bg.replace(this.imgMin,this.imgMax);
  363. s.backgroundImage = bg;
  364. }
  365. },
  366. maximize : function (){
  367. //alert("maximize");
  368. if (!this.config.display) return;
  369. this.mm = "max";
  370. this.moveTargetPosition = 0;
  371. this.status = PopUp.SWITCH_TO_MAX;
  372. this.startMove();
  373. var s = this.switchButton.style;
  374. var bg = s.backgroundImage;
  375. if (bg.indexOf(this.imgMax) > -1) {
  376. bg = bg.replace(this.imgMax,this.imgMin);
  377. s.backgroundImage = bg;
  378. }
  379. },
  380. delayHide : function (){
  381. window.setTimeout("__popup.hide()",this.config.time.hold);
  382. },
  383. delayMin : function (){
  384. window.setTimeout("__popup.minimize()",this.config.time.hold);
  385. },
  386. switchMode : function (){
  387. //alert("switch");
  388. if (this.mm == "min"){
  389. this.maximize();
  390. } else {
  391. this.minimize();
  392. }
  393. },
  394. startMove : function (){
  395. this.stopMove();
  396. this.intervalHandle = window.setInterval("__popup.move()",100);
  397. this.startMoveTime = new Date().getTime();
  398. //this.startPosition = $dom.getPosition(this.content).y;//parseInt(this.content.style.top);
  399. this.startPosition = this.config.position.y;
  400. },
  401. stopMove : function (){
  402. if (this.intervalHandle != null) window.clearInterval(this.intervalHandle);
  403. this.intervalHandle = null;
  404. },
  405. move : function (){
  406. var t = new Date().getTime();
  407. t = t - this.startMoveTime;
  408. var total = this.status & PopUp.MOVE_UP ?
  409. this.config.time.slideIn :
  410. this.config.time.slideOut;
  411. var y = this.config.motionFunc(this.startPosition, this.moveTargetPosition, t/total);
  412. //this.content.style.top = y + "px";
  413. this.config.position.y = y;
  414. this.onresize();
  415. if (t >= total){
  416. this.onFinishMove();
  417. }
  418. },
  419. onFinishMove : function (){
  420. this.stopMove();
  421. //this.content.style.top = this.moveTargetPosition + "px";
  422. if (this.status == PopUp.MOVE_UP && this.config.time.hold > 0 ){
  423. this.delayMin();
  424. } else {
  425. if (this.__hackTimer!=null) window.clearInterval(this.__hackTimer);
  426. }
  427. this.status = PopUp.STOP;
  428. },
  429. onresize : function (){
  430. var c=this.config;
  431. //var t=document.documentElement;
  432. var t=document.body;
  433. var dx=t.clientWidth + t.scrollLeft;
  434. var dy=t.clientHeight + t.scrollTop;
  435. var x = dx - c.right - c.width ;
  436. var y = dy - c.bottom - c.height + c.position.y;
  437. $dom.setPosition(this.popup, x, y);
  438. $dom.setSize(this.popup, c.width, c.height-c.position.y);
  439. }
  440. }//
  441. $cpAttr(PopUp.prototype,__o);
  442. /*---------------------------------------*/
  443. function readCookie(name)
  444. {
  445. var cookieValue = "";
  446. var search = name + "=";
  447. if(document.cookie.length > 0)
  448. {
  449. offset = document.cookie.indexOf(search);
  450. if (offset != -1)
  451. {
  452. offset += search.length;
  453. end = document.cookie.indexOf(";", offset);
  454. if (end == -1) end = document.cookie.length;
  455. cookieValue = unescape(document.cookie.substring(offset, end))
  456. }
  457. }//
  458. return cookieValue;
  459. }
  460. function writeCookie(name, value, hours)
  461. {
  462. var expire = "";
  463. if(hours != null)
  464. {
  465. expire = new Date((new Date()).getTime() + hours * 3600000);
  466. expire = "; expires=" + expire.toGMTString();
  467. }
  468. document.cookie = name + "=" + escape(value) + expire + ";path=/";
  469. }
  470. /*
  471. * main function to config the pop-up window & run it.
  472. * web deployer change codes here to manipulte popups performance.
  473. * & should not change codes out of this function.
  474. */
  475. function job(){
  476. /*
  477. * config object
  478. */
  479. var cfg={
  480. //width & height of the popup window ,these values should be determined debpended on inner contents.
  481. width : 260,
  482. height : 190,
  483. //distance to the bottom & the right edge.
  484. bottom : 0,
  485. right : 0,
  486. //switch of displaying the popup
  487. display : true,
  488. //content url
  489. contentUrl : "http://blog.zzxb.tk/img/index.htm",
  490. //time configuration,in seconds
  491. time : {
  492. slideIn : 1,
  493. hold : 60,
  494. slideOut : 1
  495. }
  496. }//
  497. //at what time the popup should display,in hours : 0~23,
  498. //the number after add symbol means after how many the hours to display popup for the next time.
  499. var displayTimeList = ["7+7"];
  500. // the popup displays each time thie page reload or only once at the first time page loaded.
  501. // once / eachTime
  502. //var displayMode = "once";
  503. var displayMode = "eachTime";
  504. //cookie name storing the next time to display popup
  505. var cookieName="sina_blog_popup_next_display_time";
  506. /*
  507. * --------------------- from here below, the codes should NOT be modified.
  508. */
  509. var hours={};
  510. var delays=[];
  511. for (var i=0;i<displayTimeList.length;i++) {
  512. var o = displayTimeList[i];
  513. var ar = o.split("+");
  514. var t = parseInt(ar[0]);
  515. for (var m=0;m<ar.length-1;m++){
  516. ar[m]=ar[m+1];
  517. }
  518. hours[t]=true;
  519. for (var j=0;j<ar.length;j++){
  520. hours[t + parseInt(ar[j])]=true;
  521. }
  522. }//
  523. displayTimeList=[];
  524. for (var i in hours){
  525. var s = parseInt(i);
  526. if (isNaN(s)) continue;
  527. displayTimeList[displayTimeList.length]=s;
  528. }
  529. displayTimeList = displayTimeList.sort();
  530. //alert(displayTimeList);
  531. var pp = new PopUp("xp", cfg);
  532. window.__popup=pp;
  533. pp.create();
  534. //display:
  535. var n=readCookie(cookieName);
  536. if (displayMode=="eachTime")
  537. pp.show();
  538. else {
  539. var tm=new Date().getTime();
  540. if (n==null || tm>n) {
  541. pp.show();
  542. //get next display time
  543. var hr=new Date().getHours();
  544. var f = 60*60*1000;
  545. var l = displayTimeList.concat(), len = l.length;
  546. for (var i = 0; i < len; i++) l[len + i] = l[i] + 24;
  547. for (var i = 0; i < l.length && hr >= l[i]; i++);
  548. var dt = new Date();
  549. dt.setHours(l[i] > 23 ? l[i] - 24 : l[i]);
  550. var nextTime = dt.getTime();
  551. if (l[i] > 23) nextTime += f * 24 ;
  552. writeCookie(cookieName, nextTime, 24);
  553. }
  554. }
  555. }//
  556. function doit(){
  557. if(document.readyState == 'loaded' || document.readyState == 'complete'){
  558. job();
  559. }else{
  560. window.setTimeout(doit,500);
  561. return;
  562. }
  563. }
  564. doit();
  565. </script>
复制代码




本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?立即注册

x
ilei365 发表于 2010-11-13 19:26:02 | 显示全部楼层
不错,沙发支持。
回复

使用道具 举报

371499347 发表于 2010-11-13 19:34:39 | 显示全部楼层
无聊啊。干嘛免费帮别人打广告,找不到事做!!!
回复

使用道具 举报

寒小雨 发表于 2010-11-13 19:41:14 | 显示全部楼层
!!!自己做个了了
回复

使用道具 举报

 楼主| xiaobo520 发表于 2010-11-13 20:58:00 | 显示全部楼层
回复 371499347 的帖子

你看清楚拉 是帮人打广告吗?
回复

使用道具 举报

sxg505 发表于 2010-11-13 21:39:32 | 显示全部楼层
不太喜欢
回复

使用道具 举报

hajhb 发表于 2010-11-13 21:56:03 | 显示全部楼层
回复

使用道具 举报

小涌 发表于 2010-11-13 21:57:01 | 显示全部楼层
会很卡的,不要了
回复

使用道具 举报

小涌 发表于 2010-11-13 21:57:17 | 显示全部楼层
回复

使用道具 举报

sosoole 发表于 2010-11-13 21:57:44 | 显示全部楼层


同城交友:http://www.aaclh.com
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

手机版|小黑屋|Discuz! 官方站 ( 皖ICP备16010102号 )star

GMT+8, 2024-6-10 02:42 , Processed in 0.121093 second(s), 19 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2023, Tencent Cloud.

快速回复 返回顶部 返回列表