简单替换,实现各种功能,不过安全隐患未经证实。
原帖: http://bbs.blueidea.com/thread-2728149-1-1.html
我以前在 LeadBBS 中看到的。
修改方法:
在模板帖子展示处添加 <span id=clian.net> </span>
然后在页尾添加如下代码:
<script language="javascript">
//<!--
function code(id)
{
if (document.getElementById(id))
{
document.getElementById(id).innerHTML = convertcode(document.getElementById(id).innerHTML);
}
}
function convertcode(str)
{
str = str.replace(/\[http\:\/\/(.+?)\.gif/gi,"<img src='http://$1.gif' />");//gif
str = str.replace(/\[http\:\/\/(.+?)\.jpg/gi,"<img src='http://$1.jpg' />");//jpg
str = str.replace(/\[http\:\/\/(.+?)\.png/gi,"<img src='http://$1.png' />");//png
return str;
}
code('clian.net');
//-->
</script>
原帖: http://bbs.blueidea.com/thread-2728149-1-1.html
我以前在 LeadBBS 中看到的。
修改方法:
在模板帖子展示处添加 <span id=clian.net> </span>
然后在页尾添加如下代码:
<script language="javascript">
//<!--
function code(id)
{
if (document.getElementById(id))
{
document.getElementById(id).innerHTML = convertcode(document.getElementById(id).innerHTML);
}
}
function convertcode(str)
{
str = str.replace(/\[http\:\/\/(.+?)\.gif/gi,"<img src='http://$1.gif' />");//gif
str = str.replace(/\[http\:\/\/(.+?)\.jpg/gi,"<img src='http://$1.jpg' />");//jpg
str = str.replace(/\[http\:\/\/(.+?)\.png/gi,"<img src='http://$1.png' />");//png
return str;
}
code('clian.net');
//-->
</script>