刚刚闲来无事,根据右下角弹出广告的形式应用到了论坛的短消息提示。不知道有人发过没~
因为我的论坛是DZ4.10的已经应用成功~其他版本的就不知道了~还望测试成功的人回个帖~
7月26日更新!
应要求添加了标题,来自于,内容。重新覆盖原来的就可以了!还望测试成功的人回个帖!
步骤如下:
1。修改模板 index.htm (首页提示短消息)
查找
- <!--{if !empty($newpmexists)}-->
复制代码
后面加
- <Script language="JavaScript">
- <!--
- window.onload = getMsg;
- window.onresize = resizeDiv;
- window.onerror = function(){}
- //短信提示使用
- var divTop,divLeft,divWidth,divHeight,docHeight,docWidth,objTimer,i = 0;
- function getMsg()
- {
- try{
- divTop = parseInt(document.getElementById("eMeng").style.top,10)
- divLeft = parseInt(document.getElementById("eMeng").style.left,10)
- divHeight = parseInt(document.getElementById("eMeng").offsetHeight,10)
- divWidth = parseInt(document.getElementById("eMeng").offsetWidth,10)
- docWidth = document.body.clientWidth;
- docHeight = document.body.clientHeight;
- document.getElementById("eMeng").style.top = parseInt(document.body.scrollTop,10) + docHeight + 10;// divHeight
- document.getElementById("eMeng").style.left = parseInt(document.body.scrollLeft,10) + docWidth - divWidth
- document.getElementById("eMeng").style.visibility="visible"
- objTimer = window.setInterval("moveDiv()",10)
- }
- catch(e){}
- }
- function resizeDiv()
- {
- i+=1
- if(i>1000) closeDiv() //想不用自动消失由用户来自己关闭,可以屏蔽这句,也可以调整数字来实现停留时间,目前是10秒
- try{
- divHeight = parseInt(document.getElementById("eMeng").offsetHeight,10)
- divWidth = parseInt(document.getElementById("eMeng").offsetWidth,10)
- docWidth = document.body.clientWidth;
- docHeight = document.body.clientHeight;
- document.getElementById("eMeng").style.top = docHeight - divHeight + parseInt(document.body.scrollTop,10)
- document.getElementById("eMeng").style.left = docWidth - divWidth + parseInt(document.body.scrollLeft,10)
- }
- catch(e){}
- }
- function moveDiv()
- {
- try
- {
- if(parseInt(document.getElementById("eMeng").style.top,10) <= (docHeight - divHeight + parseInt(document.body.scrollTop,10)))
- {
- window.clearInterval(objTimer)
- objTimer = window.setInterval("resizeDiv()",1)
- }
- divTop = parseInt(document.getElementById("eMeng").style.top,10)
- document.getElementById("eMeng").style.top = divTop - 1
- }
- catch(e){}
- }
- function closeDiv()
- {
- document.getElementById('eMeng').style.visibility='hidden';
- if(objTimer) window.clearInterval(objTimer)
- }
- -->
- </Script>
- <!--温馨提示代码开始-->
- <DIV id=eMeng style="BORDER-RIGHT: 1px solid #455690; BORDER-TOP: 1px solid #a6b4cf; Z-INDEX:99999; LEFT: 0px; VISIBILITY: hidden; BORDER-LEFT: 1px solid #a6b4cf; WIDTH: 261px; BORDER-BOTTOM: 1px solid #455690; POSITION: absolute; TOP: 0px; HEIGHT: 150px; BACKGROUND-COLOR: #c9d3f3">
- <TABLE style="BORDER-TOP: #ffffff 1px solid; BORDER-LEFT: #ffffff 1px solid" cellSpacing=0 cellPadding=0 width="100%" bgColor=#AFDCF3 border=0 height="140">
- <TBODY>
- <TR bgColor=#6699cc>
- <TD style="font-size: 12px; color: #0f2c8c" width=30 height=24></TD>
- <TD style="font-weight: normal; font-size: 12px; color: #ffffff; padding-left: 4px; padding-top: 4px" vAlign=center width="100%">
- 本站温馨提示:</TD>
- <TD style="padding-right: 2px; padding-top: 2px" vAlign=center align=right width=19>
- <font color="#FFFFFF">
- <span title=关闭 style="CURSOR: hand;font-size:12px;font-weight:bold;margin-right:4px" onclick=closeDiv() >×</span><!--<IMG title=关闭 style="CURSOR: hand" onclick=closeDiv() hspace=3 src="msgClose.jpg">--></font></TD>
- </TR>
- <TR>
- <TD style="background-image: url('images/windty_bg.jpg'); padding-right: 1px; padding-bottom: 1px" colSpan=3 height=115>
- <DIV style="BORDER-RIGHT: #b9c9ef 1px solid; PADDING-RIGHT: 13px; BORDER-TOP: #728eb8 1px solid; PADDING-LEFT: 13px; FONT-SIZE: 12px; PADDING-BOTTOM: 13px; BORDER-LEFT: #728eb8 1px solid; WIDTH: 100%; COLOR: #1f336b; PADDING-TOP: 18px; BORDER-BOTTOM: #b9c9ef 1px solid; HEIGHT: 100%">
- <!--{loop $pmlist $pm}-->
- <table width="102%" cellSpacing=0 cellPadding=0 width="100%" style="font-weight: normal; font-size: 12px; color:#000000;">
- <tr>
- <td colspan="2">
- <p align="center">
- <span class="bold">您有新短消息,请注意查收!</span></td>
- </tr>
- <tr>
- <td colspan="2">
- </td>
- </tr>
- <tr>
- <td width="34%" nowrap>
- <p><b>{lang from}:</b></p>
- </td>
- <td width="66%" nowrap>
- <a href="viewpro.php?uid=$pm[msgfromid]">$pm[msgfrom]</a>
- </td>
- </tr>
- <tr>
- <td width="34%" nowrap>
- <p><b>{lang subject}:</b></p>
- </td>
- <td width="66%" nowrap>
- <a href="pm.php?action=view&pmid=$pm[pmid]" target="_blank">$pm[subject]</a>
- </td>
- </tr>
- <tr>
- <td width="34%" nowrap >
- <p><b>{lang content}:</b></p>
- </td>
- <td width="66%" nowrap>
- $pm[message]
- </td>
- </tr>
- </table>
- <!--{/loop}-->
- <p align="center">
- <a href="pm.php" target="_blank"><font color=#FF0000>{lang pm_new_detail}</font></a>
- <a href="$ignorelink"><font color=#FF0000>{lang pm_new_ignore}</font></a></DIV>
- </TD>
- </TR>
- </TBODY>
- </TABLE>
- </DIV>
- <!--温馨提示代码结束-->
复制代码
2。编辑模板 - forumdisplay.htm (版块内提示短消息)
查找
- <!--{if !empty($newpmexists)}-->
复制代码
后面加
- <Script language="JavaScript">
- <!--
- window.onload = getMsg;
- window.onresize = resizeDiv;
- window.onerror = function(){}
- //短信提示使用
- var divTop,divLeft,divWidth,divHeight,docHeight,docWidth,objTimer,i = 0;
- function getMsg()
- {
- try{
- divTop = parseInt(document.getElementById("eMeng").style.top,10)
- divLeft = parseInt(document.getElementById("eMeng").style.left,10)
- divHeight = parseInt(document.getElementById("eMeng").offsetHeight,10)
- divWidth = parseInt(document.getElementById("eMeng").offsetWidth,10)
- docWidth = document.body.clientWidth;
- docHeight = document.body.clientHeight;
- document.getElementById("eMeng").style.top = parseInt(document.body.scrollTop,10) + docHeight + 10;// divHeight
- document.getElementById("eMeng").style.left = parseInt(document.body.scrollLeft,10) + docWidth - divWidth
- document.getElementById("eMeng").style.visibility="visible"
- objTimer = window.setInterval("moveDiv()",10)
- }
- catch(e){}
- }
- function resizeDiv()
- {
- i+=1
- if(i>1000) closeDiv() //想不用自动消失由用户来自己关闭,可以屏蔽这句,也可以调整数字来实现停留时间,目前是10秒
- try{
- divHeight = parseInt(document.getElementById("eMeng").offsetHeight,10)
- divWidth = parseInt(document.getElementById("eMeng").offsetWidth,10)
- docWidth = document.body.clientWidth;
- docHeight = document.body.clientHeight;
- document.getElementById("eMeng").style.top = docHeight - divHeight + parseInt(document.body.scrollTop,10)
- document.getElementById("eMeng").style.left = docWidth - divWidth + parseInt(document.body.scrollLeft,10)
- }
- catch(e){}
- }
- function moveDiv()
- {
- try
- {
- if(parseInt(document.getElementById("eMeng").style.top,10) <= (docHeight - divHeight + parseInt(document.body.scrollTop,10)))
- {
- window.clearInterval(objTimer)
- objTimer = window.setInterval("resizeDiv()",1)
- }
- divTop = parseInt(document.getElementById("eMeng").style.top,10)
- document.getElementById("eMeng").style.top = divTop - 1
- }
- catch(e){}
- }
- function closeDiv()
- {
- document.getElementById('eMeng').style.visibility='hidden';
- if(objTimer) window.clearInterval(objTimer)
- }
- -->
- </Script>
- <!--温馨提示代码开始-->
- <DIV id=eMeng style="BORDER-RIGHT: 1px solid #455690; BORDER-TOP: 1px solid #a6b4cf; Z-INDEX:99999; LEFT: 0px; VISIBILITY: hidden; BORDER-LEFT: 1px solid #a6b4cf; WIDTH: 261px; BORDER-BOTTOM: 1px solid #455690; POSITION: absolute; TOP: 0px; HEIGHT: 150px; BACKGROUND-COLOR: #c9d3f3">
- <TABLE style="BORDER-TOP: #ffffff 1px solid; BORDER-LEFT: #ffffff 1px solid" cellSpacing=0 cellPadding=0 width="100%" bgColor=#AFDCF3 border=0 height="140">
- <TBODY>
- <TR bgColor=#6699cc>
- <TD style="font-size: 12px; color: #0f2c8c" width=30 height=24></TD>
- <TD style="font-weight: normal; font-size: 12px; color: #ffffff; padding-left: 4px; padding-top: 4px" vAlign=center width="100%">
- 本站温馨提示:</TD>
- <TD style="padding-right: 2px; padding-top: 2px" vAlign=center align=right width=19>
- <font color="#FFFFFF">
- <span title=关闭 style="CURSOR: hand;font-size:12px;font-weight:bold;margin-right:4px" onclick=closeDiv() >×</span><!--<IMG title=关闭 style="CURSOR: hand" onclick=closeDiv() hspace=3 src="msgClose.jpg">--></font></TD>
- </TR>
- <TR>
- <TD style="background-image: url('images/windty_bg.jpg'); padding-right: 1px; padding-bottom: 1px" colSpan=3 height=115>
- <DIV style="BORDER-RIGHT: #b9c9ef 1px solid; PADDING-RIGHT: 13px; BORDER-TOP: #728eb8 1px solid; PADDING-LEFT: 13px; FONT-SIZE: 12px; PADDING-BOTTOM: 13px; BORDER-LEFT: #728eb8 1px solid; WIDTH: 100%; COLOR: #1f336b; PADDING-TOP: 18px; BORDER-BOTTOM: #b9c9ef 1px solid; HEIGHT: 100%">
- <!--{loop $pmlist $pm}-->
- <table width="102%" cellSpacing=0 cellPadding=0 width="100%" style="font-weight: normal; font-size: 12px; color:#000000;">
- <tr>
- <td colspan="2">
- <p align="center">
- <span class="bold">您有新短消息,请注意查收!</span></td>
- </tr>
- <tr>
- <td colspan="2">
- </td>
- </tr>
- <tr>
- <td width="34%" nowrap>
- <p><b>{lang from}:</b></p>
- </td>
- <td width="66%" nowrap>
- <a href="viewpro.php?uid=$pm[msgfromid]">$pm[msgfrom]</a>
- </td>
- </tr>
- <tr>
- <td width="34%" nowrap>
- <p><b>{lang subject}:</b></p>
- </td>
- <td width="66%" nowrap>
- <a href="pm.php?action=view&pmid=$pm[pmid]" target="_blank">$pm[subject]</a>
- </td>
- </tr>
- <tr>
- <td width="34%" nowrap >
- <p><b>{lang content}:</b></p>
- </td>
- <td width="66%" nowrap>
- $pm[message]
- </td>
- </tr>
- </table>
- <!--{/loop}-->
- <p align="center">
- <a href="pm.php" target="_blank"><font color=#FF0000>{lang pm_new_detail}</font></a>
- <a href="$ignorelink"><font color=#FF0000>{lang pm_new_ignore}</font></a></DIV>
- </TD>
- </TR>
- </TBODY>
- </TABLE>
- </DIV>
- <!--温馨提示代码结束-->
复制代码
3。编辑模板 - viewthread.htm (帖子内提示短消息)
查找
后面加
- <Script language="JavaScript">
- <!--
- window.onload = getMsg;
- window.onresize = resizeDiv;
- window.onerror = function(){}
- //短信提示使用
- var divTop,divLeft,divWidth,divHeight,docHeight,docWidth,objTimer,i = 0;
- function getMsg()
- {
- try{
- divTop = parseInt(document.getElementById("eMeng").style.top,10)
- divLeft = parseInt(document.getElementById("eMeng").style.left,10)
- divHeight = parseInt(document.getElementById("eMeng").offsetHeight,10)
- divWidth = parseInt(document.getElementById("eMeng").offsetWidth,10)
- docWidth = document.body.clientWidth;
- docHeight = document.body.clientHeight;
- document.getElementById("eMeng").style.top = parseInt(document.body.scrollTop,10) + docHeight + 10;// divHeight
- document.getElementById("eMeng").style.left = parseInt(document.body.scrollLeft,10) + docWidth - divWidth
- document.getElementById("eMeng").style.visibility="visible"
- objTimer = window.setInterval("moveDiv()",10)
- }
- catch(e){}
- }
- function resizeDiv()
- {
- i+=1
- if(i>1000) closeDiv() //想不用自动消失由用户来自己关闭,可以屏蔽这句,也可以调整数字来实现停留时间,目前是10秒
- try{
- divHeight = parseInt(document.getElementById("eMeng").offsetHeight,10)
- divWidth = parseInt(document.getElementById("eMeng").offsetWidth,10)
- docWidth = document.body.clientWidth;
- docHeight = document.body.clientHeight;
- document.getElementById("eMeng").style.top = docHeight - divHeight + parseInt(document.body.scrollTop,10)
- document.getElementById("eMeng").style.left = docWidth - divWidth + parseInt(document.body.scrollLeft,10)
- }
- catch(e){}
- }
- function moveDiv()
- {
- try
- {
- if(parseInt(document.getElementById("eMeng").style.top,10) <= (docHeight - divHeight + parseInt(document.body.scrollTop,10)))
- {
- window.clearInterval(objTimer)
- objTimer = window.setInterval("resizeDiv()",1)
- }
- divTop = parseInt(document.getElementById("eMeng").style.top,10)
- document.getElementById("eMeng").style.top = divTop - 1
- }
- catch(e){}
- }
- function closeDiv()
- {
- document.getElementById('eMeng').style.visibility='hidden';
- if(objTimer) window.clearInterval(objTimer)
- }
- -->
- </Script>
- <!--温馨提示代码开始-->
- <DIV id=eMeng style="BORDER-RIGHT: 1px solid #455690; BORDER-TOP: 1px solid #a6b4cf; Z-INDEX:99999; LEFT: 0px; VISIBILITY: hidden; BORDER-LEFT: 1px solid #a6b4cf; WIDTH: 261px; BORDER-BOTTOM: 1px solid #455690; POSITION: absolute; TOP: 0px; HEIGHT: 150px; BACKGROUND-COLOR: #c9d3f3">
- <TABLE style="BORDER-TOP: #ffffff 1px solid; BORDER-LEFT: #ffffff 1px solid" cellSpacing=0 cellPadding=0 width="100%" bgColor=#AFDCF3 border=0 height="140">
- <TBODY>
- <TR bgColor=#6699cc>
- <TD style="font-size: 12px; color: #0f2c8c" width=30 height=24></TD>
- <TD style="font-weight: normal; font-size: 12px; color: #ffffff; padding-left: 4px; padding-top: 4px" vAlign=center width="100%">
- 本站温馨提示:</TD>
- <TD style="padding-right: 2px; padding-top: 2px" vAlign=center align=right width=19>
- <font color="#FFFFFF">
- <span title=关闭 style="CURSOR: hand;font-size:12px;font-weight:bold;margin-right:4px" onclick=closeDiv() >×</span><!--<IMG title=关闭 style="CURSOR: hand" onclick=closeDiv() hspace=3 src="msgClose.jpg">--></font></TD>
- </TR>
- <TR>
- <TD style="background-image: url('images/windty_bg.jpg'); padding-right: 1px; padding-bottom: 1px" colSpan=3 height=115>
- <DIV style="BORDER-RIGHT: #b9c9ef 1px solid; PADDING-RIGHT: 13px; BORDER-TOP: #728eb8 1px solid; PADDING-LEFT: 13px; FONT-SIZE: 12px; PADDING-BOTTOM: 13px; BORDER-LEFT: #728eb8 1px solid; WIDTH: 100%; COLOR: #1f336b; PADDING-TOP: 18px; BORDER-BOTTOM: #b9c9ef 1px solid; HEIGHT: 100%">
- <!--{loop $pmlist $pm}-->
- <table width="102%" cellSpacing=0 cellPadding=0 width="100%" style="font-weight: normal; font-size: 12px; color:#000000;">
- <tr>
- <td colspan="2">
- <p align="center">
- <span class="bold">您有新短消息,请注意查收!</span></td>
- </tr>
- <tr>
- <td colspan="2">
- </td>
- </tr>
- <tr>
- <td width="34%" nowrap>
- <p><b>{lang from}:</b></p>
- </td>
- <td width="66%" nowrap>
- <a href="viewpro.php?uid=$pm[msgfromid]">$pm[msgfrom]</a>
- </td>
- </tr>
- <tr>
- <td width="34%" nowrap>
- <p><b>{lang subject}:</b></p>
- </td>
- <td width="66%" nowrap>
- <a href="pm.php?action=view&pmid=$pm[pmid]" target="_blank">$pm[subject]</a>
- </td>
- </tr>
- <tr>
- <td width="34%" nowrap >
- <p><b>{lang content}:</b></p>
- </td>
- <td width="66%" nowrap>
- $pm[message]
- </td>
- </tr>
- </table>
- <!--{/loop}-->
- <p align="center">
- <a href="pm.php" target="_blank"><font color=#FF0000>{lang pm_new_detail}</font></a>
- <a href="$ignorelink"><font color=#FF0000>{lang pm_new_ignore}</font></a></DIV>
- </TD>
- </TR>
- </TBODY>
- </TABLE>
- </DIV>
- <!--温馨提示代码结束-->
复制代码
下载此图放到论坛images目录,记得把名字改成windty_bg.jpg的哦~不然看不到~
[ 本帖最后由 龍雲翔 于 2006-7-26 15:48 编辑 ] |