【许愿墙V2.0】需要JQ库,需要静态化。
http://你的论坛地址/admincp.php?action=settings&operation=seo
打开全部勾上静态化。
1、新建模板lovewall_2,将模板链接放入数据调用中。- $("nav").innerHTML="<strong>许愿墙V2.0</strong>";
- document.write("<style>.sbtimage{border:0px;margin:0px;height:26px;width:72px;}.sbtinput{height:26px;PADDING-RIGHT:3px;PADDING-LEFT:3px;PADDING-BOTTOM:3px;WIDTH:120px;COLOR:#999999;PADDING-TOP:4px;}.Message{WIDTH:240px;CURSOR:move;COLOR:#333333;LINE-HEIGHT:18px;POSITION:absolute;HEIGHT:190px}.Message H2{FONT-WEIGHT:normal;FONT-SIZE:12px;MARGIN:4px 0px}.Style0{PADDING-RIGHT:10px;PADDING-LEFT:22px;BACKGROUND:url("+lovepic[0]+") no-repeat 0px 4px;PADDING-BOTTOM:0px;PADDING-TOP:11px;HEIGHT:192px}.Style1{PADDING-RIGHT:10px;PADDING-LEFT:22px;BACKGROUND:url("+lovepic[1]+") no-repeat 0px 4px;PADDING-BOTTOM:0px;PADDING-TOP:11px;HEIGHT:192px}.Style2{PADDING-RIGHT:10px;PADDING-LEFT:22px;BACKGROUND:url("+lovepic[2]+") no-repeat 0px 4px;PADDING-BOTTOM:0px;PADDING-TOP:11px;HEIGHT:192px}.Style3{PADDING-RIGHT:10px;PADDING-LEFT:22px;BACKGROUND:url("+lovepic[3]+") no-repeat 0px 4px;PADDING-BOTTOM:0px;PADDING-TOP:11px;HEIGHT:192px}.Style4{PADDING-RIGHT:10px;PADDING-LEFT:22px;BACKGROUND:url("+lovepic[4]+") no-repeat 0px 4px;PADDING-BOTTOM:0px;PADDING-TOP:11px;HEIGHT:192px}.Style5{PADDING-RIGHT:10px;PADDING-LEFT:22px;BACKGROUND:url("+lovepic[5]+") no-repeat 0px 4px;PADDING-BOTTOM:0px;PADDING-TOP:11px;HEIGHT:192px}.Style0 .Head{COLOR:#ff3992}.Style0 .Sign{MARGIN:0px;COLOR:#ff3992;margin-right:7px;TEXT-ALIGN:right}.Style0 .Sign A{COLOR:#ff3992;TEXT-DECORATION:underline}.Style0 .Sign A:hover{TEXT-DECORATION:none}.Style1 .Head{COLOR:#cc0000}.Style1 .Sign{MARGIN:0px;margin-right:7px;COLOR:#cc0000;TEXT-ALIGN:right}.Style1 .Sign A{COLOR:#cc0000;TEXT-DECORATION:underline}.Style1 .Sign A:hover{TEXT-DECORATION:none}.Style2 .Head{COLOR:#0096eb}.Style2 .Sign{MARGIN:0px;margin-right:7px;COLOR:#0096eb;TEXT-ALIGN:right}.Style2 .Sign A{COLOR:#0096eb;TEXT-DECORATION:underline}.Style2 .Sign A:hover{TEXT-DECORATION:none}.Style3 .Head{COLOR:#00b115}.Style3 .Sign{MARGIN:0px;margin-right:7px;COLOR:#00b115;TEXT-ALIGN:right}.Style3 .Sign A{COLOR:#00b115;TEXT-DECORATION:underline}.Style3 .Sign A:hover{TEXT-DECORATION:none}.Style4 .Head{COLOR:#a800d8}.Style4 .Sign{MARGIN:0px;margin-right:7px;COLOR:#a800d8;TEXT-ALIGN:right}.Style4 .Sign A{COLOR:#a800d8;TEXT-DECORATION:underline}.Style4 .Sign A:hover{TEXT-DECORATION:none}.Style5 .Head{COLOR:#ff6600}.Style5 .Sign{MARGIN:0px;margin-right:7px;COLOR:#ff6600;TEXT-ALIGN:right}.Style5 .Sign A{COLOR:#ff6600;TEXT-DECORATION:underline}.Style5 .Sign A:hover{TEXT-DECORATION:none}.Num{PADDING-LEFT:13px;CURSOR:move}.Num IMG{MARGIN-TOP:-15px;margin-right:7px;FLOAT:right;CURSOR:pointer}.Detail{MARGIN:3px -1px 0px 0px;OVERFLOW:hidden;LINE-HEIGHT:17px;HEIGHT:114px;WORD-WRAP:break-word}.Date{FONT-SIZE:10px;MARGIN:-1px 7px 0px;TEXT-ALIGN:right}.Paste{TEXT-ALIGN:center}.Paste IMG{FILTER:alpha(opacity=70);moz-opacity:0.7;opacity:0.7}.Heart{FLOAT:left;MARGIN:0px 4px -10px 0px}.MMessage{WIDTH:145px;COLOR:#333333;LINE-HEIGHT:18px;HEIGHT:99px}.MMessage H2{FONT-WEIGHT:normal;FONT-SIZE:12px;MARGIN:4px 0px}.console{DISPLAY:none;Z-INDEX:100;FILTER:alpha(Opacity=35);LEFT:0px;WIDTH:100%;POSITION:absolute;TOP:-121px;HEIGHT:600px;BACKGROUND-COLOR:#000000;opacity:0.35}#Tips TD H5{FONT-SIZE:12px;MARGIN:5px 0px;COLOR:#ff3992}#Tips TD OL{PADDING-RIGHT:0px;PADDING-LEFT:0px;PADDING-BOTTOM:0px;MARGIN:0px;PADDING-TOP:0px}#Tips TD OL LI{PADDING-RIGHT:0px;PADDING-LEFT:0px;PADDING-BOTTOM:0px;MARGIN:3px;WORD-BREAK:keep-all;PADDING-TOP:0px;WHITE-SPACE:nowrap;LIST-STYLE-TYPE:none}BODY{FONT-SIZE:12px;MARGIN:0px;COLOR:#333333;WORD-BREAK:break-all;FONT-FAMILY:Verdana,Arial,Helvetica,sans-serif}#Feast IMG{FLOAT:right;MARGIN:7px 20px 0px 0px}#Search{PADDING-RIGHT:0px;BORDER-TOP:#3d9a13 2px solid;PADDING-LEFT:5px;BACKGROUND:url(./bg_search.gif) repeat-x;PADDING-BOTTOM:0px;PADDING-TOP:5px;BORDER-BOTTOM:#3d9a13 2px solid;HEIGHT:30px}#Search IMG{FLOAT:left;MARGIN-RIGHT:6px}#Search FORM{FLOAT:left;MARGIN:0px 0px 0px 34px}#ContOuter{BACKGROUND:url(./bg.jpg)}#Foot{MARGIN-TOP:-3px}A.a_black{COLOR:#000000;TEXT-DECORATION:underline}A.a_black:hover{TEXT-DECORATION:none}A.a_white{COLOR:#ffffff;TEXT-DECORATION:underline}A.a_white:hover{TEXT-DECORATION:none}A.a_green{COLOR:#70b817;TEXT-DECORATION:underline}A.a_green:hover{TEXT-DECORATION:none}A.a_pink{COLOR:#ff3992;TEXT-DECORATION:underline}A.a_pink:hover{TEXT-DECORATION:none}A.a_gray9{COLOR:#999999;TEXT-DECORATION:underline}A.a_gray9:hover{TEXT-DECORATION:none}.t_orab{FONT-WEIGHT:bold;COLOR:#ff6600}.t_green{COLOR:#70b817}.AC{TEXT-ALIGN:center}.copyrightfont{COLOR:#333333}.popupmenu_popup{z-index:999999999999999999;}.Detail{padding-right:15px!important;}</style>");
- var loveinner='<div id="lovewall" style="display:block;">';
- loveinner+='<table cellspacing="0" cellpadding="0" border="0" width="100%" height="100%" style="position:relative">';
- loveinner+='<tr><td valign="top" background="'+lovepic[6]+'" height="820">';
- lovewidth=$("wrap").offsetWidth;
- for (i=0;i<loveshuzu.length-1;i++){
- lovetem=loveshuzu[i];
- str=lovetem[6];
- lovetem[6]=/\d+/.exec(str);
- left=(lovewidth-233)*lovetem[3]/100;
- loveinner+='<div id="d'+i+'"><div id="scrip'+i+'" class="Message" style="position:absolute; left:'+left+'px;top:'+lovetem[4]+'px;z-index:'+(60-i)+'"><div class="Style'+lovetem[5]+'"><div class="Num">字条编号:'+lovetem[7]+' <img src="'+lovepic[7]+'" alt="关闭" onclick="delMessage('+i+')"></div><p class="Detail"><img src="/uc_server/avatar.php?uid='+lovetem[6]+'&size=small" class="Heart" /><span class="Head">'+lovetem[0]+'</span><br />'+lovetem[1]+'</p><p class="Sign">'+lovetem[0]+'</p><P class="Date">'+lovetem[2]+'</p></div></div>';
- };
- loveinner+='<img src="'+lovepic[8]+'" onclick="lovetie()" style="position:absolute;left:0px;bottom:0px;cursor:pointer;" />';
- loveinner+='</td></tr>';
- loveinner+='</table>';
- loveinner+='<table width="98%" cellspacing="0" cellpadding="0" align="center">';
- loveinner+='<tr><td valign="top"></td></tr></table></div><div id="loveadd" style="display:none;"><h3> 选择一种纸条样式</h3><br />';
- loveinner+='<style>#loveadd .current{border:5px #cacaca solid;margin:5px!important;};#loveadd h3{font-size:30px!important;font-weight:bold;}</style>';
- lovech=0;
- for (i=0;i<6;i++){
- loveinner+='<img src='+lovepic[i]+' class="" id="lovezt'+i+'" onclick="lovechoosepic('+i+')" style="margin:10px;"/>';
- };
- loveinner+='<br /> 纸条内容:(<span id="lovetxtnum">还可以输入'+lovemaxzishu+'个字</span>)<br /> <text'+'area id="lovetext" onkeydown="checkEnter(event)" onkeyup="lovetongji();" style="width:400px;height:100px;"></text'+'area>';
- loveinner+='<br /> <button id="lovesubmit" onclick="lovetijiao()">发表你的愿望</button></div>';
- if (location.href.indexOf("admincp")==-1){
- document.write(loveinner);
- }
- function checkEnter(e){
- var zzzzz=zyplugurl;
- var et=e||window.event;
- var keycode=et.charCode||et.keyCode;
- if(keycode==13){
- if(window.event){
- window.event.returnValue = false;
- }else{
- e.preventDefault();
- }//for firefox
- };
- };
- function lovetongji(){
- var zzzzz=zyplugurl;
- a=$jq("#lovetext").val().length;
- if (a<=lovemaxzishu){
- $("lovetxtnum").innerHTML='还可以输入'+(lovemaxzishu-a)+'个字';
- }else{
- $("lovetxtnum").innerHTML='字数超过限制!';
- };
- setcookie("lovewall",$("lovetext").innerHTML,999999);
- };
- function lovechoosepic(k){
- var zzzzz=zyplugurl;
- $("lovezt"+lovech).className="";
- $("lovezt"+k).className="current";
- lovech=k;
- };
- function lovetie(){
- var zzzzz=zyplugurl;
- if (discuz_uid==0){showDialog("必须登陆才能发表愿望!");return false;};
- $("lovewall").style.display="none";
- $("loveadd").style.display="block";
- };
- function lovetijiao(){
- var zzzzz=zyplugurl;
- str=$jq("#lovetext").val();
- if (str.length==0){showDialog("必须输入你的愿望!");return false;};
- if (str.indexOf('"')!=-1){showDialog("愿望内容不能包括半角双引号!可以改用全角或者单引号");return false;};
- if (str.indexOf('/')!=-1){showDialog("愿望内容不能包括斜杠!");return false;};
- if (str.indexOf('\\')!=-1){showDialog("愿望内容不能包括斜杠!");return false;};
- if (str.length>lovemaxzishu){showDialog("愿望字数最多为"+lovemaxzishu+"!");return false;};
- $("lovesubmit").disabled=true;
- insertText(str,str.length,0);
- left=fRandomBy(1,95);
- top2=fRandomBy(1,640);
- if ((left<10) && (top2>620)){left=left+10;};
- str2=left+","+top2+","+lovech;
- $("subject").value=str2;
- $("postsubmit").click();
- setcookie("lovewall","",999999);
- return false;
- };
- function fRandomBy(under, over){
- switch(arguments.length){
- case 1: return parseInt(Math.random()*under+1);
- case 2: return parseInt(Math.random()*(over-under+1) + under);
- default: return 0;
- }
- }
- function delMessage(n) {
- var $g='scrip'+n;
- document.getElementById($g).style.display='none';
- //if(n==$a) App.lock(false);
- };
- zyindex=60;
- $jq("#wrap").ready(function (){
- if (location.href.indexOf("admincp")==-1){
- $jq("#lovezt0").addClass("current");
- if (getcookie("lovewall")){
- $("lovetext").innerHTML=getcookie("lovewall");
- lovetongji();
- };
- };
- items=$jq(".Message");
- items.attr("tuo",false);
- items.mousedown.call(items,function(e){
- item2=$jq(this).css("z-index",zyindex);
- zyindex++;
- item2.tuo=true;
- start=[e.pageX-/[\d-]+/.exec(item2.css("left")),e.pageY-/[\d-]+/.exec(item2.css("top")),e.pageX,e.pageY]
- $jq("#append_parent").append("<div class='mask'><style>*{-moz-user-select: -moz-none;-khtml-user-select: none;-webkit-user-select: none;-ms-user-select: none;user-select: none;}</style></div>");
- $jq("body,html").mousemove(function(e){
- if (item2.tuo){
- item2.css("left",(e.pageX-start[0])+"px").css("top",(e.pageY-start[1])+"px");
- }
- });
- });
- $jq("body,html").mouseup(function(){
- item2.tuo=false;
- $jq(".mask").remove();
- $jq("body,html").unbind("mousemove");
- });
- });
复制代码 2、新建一个板块,进入权限,把所有用户组的(浏览板块)和(发新话题)的权限勾上(包括游客、封禁用户等)。进入积分策略,设置许愿扣除货币或者奖励货币。
3、进入工具——数据调用——添加——主题列表
名称:章鱼之家爱墙_数据调用
内容:- <style>.main{position:absolute!important;top:-999px!important;left:-999px!important;}</style>
- <script>
- var lovepic=new Array();
- lovepic[0]="http://jju.funbbs.me/attachments/month_1808/180809235400279aa939a2c199.gif"; //第一种纸条背景图
- lovepic[1]="http://jju.funbbs.me/attachments/month_1808/1808092354fbc8eef618b7c09b.gif"; //第二种纸条背景图
- lovepic[2]="http://jju.funbbs.me/attachments/month_1808/180809235424e820a80b76f882.gif"; //第三种纸条背景图
- lovepic[3]="http://jju.funbbs.me/attachments/month_1808/1808092354463cd2d4eb6c3aac.gif"; //第四种纸条背景图
- lovepic[4]="http://jju.funbbs.me/attachments/month_1808/1808092354462fb54875db6304.gif"; //第五种纸条背景图
- lovepic[5]="http://jju.funbbs.me/attachments/month_1808/180809235546c6c493015cc303.gif"; //第六种纸条背景图
- lovepic[6]="http://jju.funbbs.me/attachments/month_1808/1808092355e025138e8ee32284.jpg"; //爱墙主界面背景图
- lovepic[7]="http://jju.funbbs.me/attachments/month_1808/1808100002c2011ad1219d9164.png"; //关闭按钮
- lovepic[8]="http://jju.funbbs.me/attachments/month_1808/18080923592aea8533eaad7b98.gif"; //贴纸条按钮
- lovemaxzishu=90; //愿望最大字数,建议设置为90
- var loveshuzu=[[node]["{author_nolink}","{message}","{dateline}",{subject_nolink},"{author}",{tid}],[/node][0,0,0,0,0]];
- </script>
- <script src="http://mz.funbbs.me/templates/default/lovewall_2.htm"></script>
复制代码 图片自行替换。
数据缓存时间:1
帖子选取范围:选择许愿专区(就是刚才刚建立的),其他不要选。
显示数据条数:这里填写许愿墙显示最新愿望的个数,建议设置为30,其他的默认,然后提交。
4、进入POST模板。
找到:- <div id="wrap" class="wrap" s_clear>
复制代码 在下面添加:- <--{if ($fid==52)}-->
- {eval request('章鱼之家爱墙_数据调用');}
- <--{if}-->
复制代码 52改为自己所建许愿板块的fid。
5、广告——自定义广告——新建页头通栏广告
名称:许愿墙(或者是其他的,这个随意)
广告投放范围:只选择许愿专区
内容:- <script>location.href="http://mz.funbbs.me/post.php?action=newthread&fid=52&referer=http://mz.funbbs.me/forum-52-1.html"</script>
- <style>body{display:none;}</style>
复制代码 52和网址改为自己的。
关于JQ库
1、将新建四个模板。
2、改JQ模板最上面的三个地址。
例子:- http://mz.funbbs.me//templates/x3.1/jqa.htm
复制代码 3、将JQ模板地址放在其他头部- <!--许愿墙JQ库-->
- <script src='templates/x3.1/jq.htm'>
- </script>
- <!--JQ库结束-->
复制代码 |