修改DEDECMS信息提示效果

点击查看原图

具体操作方法:

第一步:设计自己所需要的信息提示效果.

第二步:找到 include/inc_functions.php 文件.

    修改 以下为引用的内容:

function JumpUrl(){

if(pgo==0){ location=’$gourl’; pgo=1; }

}
“;

$rmsg = $func;

$rmsg .= “document.write(“<br/><div style=’width:400px;padding-top:4px;height:24;font-size:10pt;border-left:1px solid #b9df92;border-top:1px solid #b9df92;border-right:1px solid #b9df92;background-color:#def5c2;’>DEDECMS 提示信息!</div>”);
“;

$rmsg .= “document.write(“<div style=’width:400px;height:100;font-size:10pt;border:1px solid #b9df92;background-color:#f9fcf3’><br/><br/>”);
“;

$rmsg .= “document.write(“”.str_replace(“””,”“”,$msg).””);
“;

$rmsg .= “document.write(“”;

if($onlymsg==0){

if($gourl!=”javascript:;” && $gourl!=””){ $rmsg .= “<br/><br/><a href=’”.$gourl.”’>如果你的浏览器没反应,请点击这里…</a>”; }

$rmsg .= “<br/><br/></div>”);
“;

if($gourl!=”javascript:;” && $gourl!=””){ $rmsg .= “setTimeout(’JumpUrl()’,$litime);”; }

}else{ $rmsg .= “<br/><br/></div>”);
“; }

$msg = $htmlhead.$rmsg.$htmlfoot;

}

echo $msg;

}

为自己所设计的信息提示代码.

下面的是我自己的信息提示代码如下:

以下为引用的内容:

function JumpUrl(){

if(pgo==0){ location=’$gourl’; pgo=1; }

}
“;

$rmsg = $func;

$rmsg .= “document.write(“<div style=’width:477px; margin:0 auto; height:27px; background-image:url(https://www.yzmn.com.cn/images/xx_01.gif); margin-top:20px;’><div style=’font-size:14px; margin-top:8px; color:#FF0099’><strong>扬州美女信息提示</strong></div></div>”);
“;

$rmsg .= “document.write(“<div style=’width:477px; margin:0 auto; height:127px; background-image:url(https://www.yzmn.com.cn/images/xx_02.gif)’><div style=’width:340px; margin:0 auto; margin-top:30px; font-size:12px;’>”);
“;

$rmsg .= “document.write(“”.str_replace(“””,”“”,$msg).””);
“;

$rmsg .= “document.write(“”;

if($onlymsg==0){

if($gourl!=”javascript:;” && $gourl!=””){ $rmsg .= “<br/><br/><a href=’”.$gourl.”’>如果你的浏览器没反应,请点击这里…</a>”; }

$rmsg .= “<br/><br/></div></div><div style=’width:477px; margin:0 auto; height:9px; background-image:url(https://www.yzmn.com.cn/images/xx_03.gif)’><img src=’/upimg/allimg/071231/1502090.gif’ height=’9’ /></div>”);
“;

if($gourl!=”javascript:;” && $gourl!=””){ $rmsg .= “setTimeout(’JumpUrl()’,$litime);”; }

}else{ $rmsg .= “<br/><br/></div></div><div style=’width:477px; margin:0 auto; height:9px; background-image:url(https://www.yzmn.com.cn/images/xx_03.gif)’><img src=’/upimg/allimg/071231/1502090.gif’ height=’9’ /></div>”);
“; }

$msg = $htmlhead.$rmsg.$htmlfoot;

}

echo $msg;

}

完成效果转换.

信息翻滚效果

生成以后的代码显示:

以下为引用的内容:

<SCRIPT language=JavaScript>

<!–

var marqueeContent=new Array();

marqueeContent[0]=’<a href=”http://www.yzmn.com.cn/Photo/1230642007.shtml” target=”_blank”>婚纱摄影-扬州美女</a>’;

marqueeContent[1]=’<a href=”http://www.yzmn.com.cn/Photo/1230632007.shtml” target=”_blank”>扬州出美女!夏日中的清凉风景?扬州美女</a>’;

marqueeContent[2]=’<a href=”http://www.yzmn.com.cn/Photo/1230622007.shtml” target=”_blank”>身穿旗袍的扬州美女??不一样的公交MM</a>’;

marqueeContent[3]=’<a href=”http://www.yzmn.com.cn/Photo/1230612007.shtml” target=”_blank”>扬州美女,真正的美丽-公交mm</a>’;

marqueeContent[4]=’<a href=”http://www.yzmn.com.cn/News/1230602007.shtml” target=”_blank”>扬州美女全息图-自古扬州出美女</a>’;

var marqueeInterval=new Array();

var marqueeId=0;

var marqueeDelay=4000;

var marqueeHeight=20;

function initMarquee() {

var str=marqueeContent[0];

document.write(’<div id=marqueeBox style=”overflow:hidden;height:’+marqueeHeight+’px” onmouseover=”clearInterval(marqueeInterval[0])” onmouseout=”marqueeInterval[0]=setInterval(’startMarquee()’,marqueeDelay)”><div>’+str+’</div></div>’);

marqueeId++;

marqueeInterval[0]=setInterval(“startMarquee()”,marqueeDelay);

}

function startMarquee() {

var str=marqueeContent[marqueeId];

marqueeId++;

if(marqueeId>=marqueeContent.length) marqueeId=0;

if(marqueeBox.childNodes.length==1) {

var nextLine=document.createElement(’DIV’);

nextLine.innerHTML=str;

marqueeBox.appendChild(nextLine);

}

else {

marqueeBox.childNodes[0].innerHTML=str;

marqueeBox.appendChild(marqueeBox.childNodes[0]);

marqueeBox.scrollTop=0;

}

clearInterval(marqueeInterval[1]);

marqueeInterval[1]=setInterval(“scrollMarquee()”,10);

}

function scrollMarquee() {

marqueeBox.scrollTop++;

if(marqueeBox.scrollTop%marqueeHeight==marqueeHeight){

clearInterval(marqueeInterval[1]);

}

}

initMarquee();

// –>

</SCRIPT>

dedecms标签代码: 以下为引用的内容:

<SCRIPT language=JavaScript>

<!–

var marqueeContent=new Array(); //滚动主题

marqueeContent[0]=’{dede:arclist row=’1’ titlelength=’40’}<a href=”[field:filename/]” target=”_blank”>[field:title/]</a>{/dede:arclist}’;

marqueeContent[1]=’{dede:arclist limit=’1,1’ titlelength=’40’}<a href=”[field:filename/]” target=”_blank”>[field:title/]</a>{/dede:arclist}’;

marqueeContent[2]=’{dede:arclist limit=’2,1’ titlelength=’40’}<a href=”[field:filename/]” target=”_blank”>[field:title/]</a>{/dede:arclist}’;

marqueeContent[3]=’{dede:arclist limit=’3,1’ titlelength=’40’}<a href=”[field:filename/]” target=”_blank”>[field:title/]</a>{/dede:arclist}’;

marqueeContent[4]=’{dede:arclist limit=’4,1’ titlelength=’40’}<a href=”[field:filename/]” target=”_blank”>[field:title/]</a>{/dede:arclist}’;

var marqueeInterval=new Array(); //定义一些常用而且要经常用到的变量

var marqueeId=0;

var marqueeDelay=4000;

var marqueeHeight=20;

function initMarquee() {

var str=marqueeContent[0];

document.write(’<div id=marqueeBox style=”overflow:hidden;height:’+marqueeHeight+’px” onmouseover=”clearInterval(marqueeInterval[0])” onmouseout=”marqueeInterval[0]=setInterval(’startMarquee()’,marqueeDelay)”><div>’+str+’</div></div>’);

marqueeId++;

marqueeInterval[0]=setInterval(“startMarquee()”,marqueeDelay);

}

function startMarquee() {

var str=marqueeContent[marqueeId];

marqueeId++;

if(marqueeId>=marqueeContent.length) marqueeId=0;

if(marqueeBox.childNodes.length==1) {

var nextLine=document.createElement(’DIV’);

nextLine.innerHTML=str;

marqueeBox.appendChild(nextLine);

}

else {

marqueeBox.childNodes[0].innerHTML=str;

marqueeBox.appendChild(marqueeBox.childNodes[0]);

marqueeBox.scrollTop=0;

}

clearInterval(marqueeInterval[1]);

marqueeInterval[1]=setInterval(“scrollMarquee()”,10);

}

function scrollMarquee() {

marqueeBox.scrollTop++;

if(marqueeBox.scrollTop%marqueeHeight==marqueeHeight){

clearInterval(marqueeInterval[1]);

}

}

initMarquee();

// –>

</SCRIPT>

发表评论

电子邮件地址不会被公开。 必填项已用*标注

您必须启用javascript在这里看到验证码!