ubb问题,在本地或其它IIS5服务器上测试没问题,上传中国频道的服务器后就有问题。

ckxp 2003-03-21 10:04:35
<%
function UBBCode(strContent)
dim objRegExp
Set objRegExp=new RegExp
objRegExp.IgnoreCase =true
objRegExp.Global=True

'换行
objRegExp.Pattern="(\[br\])"
strContent=objRegExp.Replace(strContent,"<br/>")
'下划线
objRegExp.Pattern="(\[u\])(.+?)(\[\/u\])"
strContent=objRegExp.Replace(strContent,"<u>$2</u>")
'斜体
objRegExp.Pattern="(\[i\])(.+?)(\[\/i\])"
strContent=objRegExp.Replace(strContent,"<i>$2</i>")
'加粗
objRegExp.Pattern="(\[b\])(.+?)(\[\/b\])"
strContent=objRegExp.Replace(strContent,"<b>$2</b>")
'双横线
objRegExp.Pattern="(\[QUOTE\])(.+?)(\[\/QUOTE\])"
strContent=objRegExp.Replace(strContent,"<BLOCKQUOTE><font size=2 face=""Verdana, Arial"">引用:</font><HR>$2<HR></BLOCKQUOTE>")
'红色
objRegExp.Pattern="(\[red\])(.+?)(\[\/red\])"
strContent=objRegExp.Replace(strContent,"<FONT COLOR=""#ff0000"">$2</FONT>")
'灰色
objRegExp.Pattern="(\[gray\])(.+?)(\[\/gray\])"
strContent=objRegExp.Replace(strContent,"<FONT COLOR=""#77ACAC"">$2</FONT>")
'绿色
objRegExp.Pattern="(\[green\])(.+?)(\[\/green\])"
strContent=objRegExp.Replace(strContent,"<FONT COLOR=""#009933"">$2</FONT>")
'蓝色
objRegExp.Pattern="(\[blue\])(.+?)(\[\/blue\])"
strContent=objRegExp.Replace(strContent,"<FONT COLOR=""#0055ff"">$2</FONT>")
'任何颜色字
objRegExp.Pattern="(\[color\=)(.+?)(\])(.+?)(\[\/color\])"
strContent=objRegExp.Replace(strContent,"<FONT COLOR=""$2"">$4</FONT>")
'电子邮件
objRegExp.Pattern="(\[EMAIL\])(\S+\@\S+?)(\[\/EMAIL\])"
strContent= objRegExp.Replace(strContent,"<A HREF=""mailto:$2"">$2</A>")
'带链接的文字
objRegExp.Pattern="(\[URL\])(http:\/\/\S+?)(\[\/URL\])"
strContent= objRegExp.Replace(strContent,"<A HREF=""$2"" TARGET=_blank>$2</A>")
objRegExp.Pattern="(\[URL\])(\S+?)(\[\/URL\])"
strContent= objRegExp.Replace(strContent,"<A HREF=""http://$2"" TARGET=_blank>$2</A>")
'滚动
objRegExp.Pattern="(\[marquee\])(.+?)(\[\/marquee\])"
strContent=objRegExp.Replace(strContent,"<marquee scrollamount='3' id=xxskybbs onmouseover=xxskybbs.stop() onmouseout=xxskybbs.start()>$2</marquee>")
'回滚
objRegExp.Pattern="(\[marqueea\])(.+?)(\[\/marqueea\])"
strContent=objRegExp.Replace(strContent,"<marquee behavior=""alternate"" scrollamount='3' id=xxskybbs onmouseover=xxskybbs.stop() onmouseout=xxskybbs.start()>$2</marquee>")
'带链接的图片
objRegExp.Pattern="(\[IMGurl\=)(http:\/\/\S+?)(\])(http:\/\/\S+?)(\[\/IMGurl\])"
strContent=objRegExp.Replace(strContent,"<a href=""$2"" target=_blank><IMG SRC=""$4"" border=0 onload=""javascript:if(this.width>screen.width-366)this.width=screen.width-366""></a>")
objRegExp.Pattern="(\[IMGurl\=)(\S+?)(\])(\S+?)(\[\/IMGurl\])"
strContent=objRegExp.Replace(strContent,"<a href=""http://$2"" target=_blank><IMG SRC=""http://$4"" border=0 onload=""javascript:if(this.width>screen.width-366)this.width=screen.width-366""></a>")
'图片
objRegExp.Pattern="(\[IMG\])(\S+?)(\[\/IMG\])"
strContent=objRegExp.Replace(strContent,"<IMG SRC=""$2"">")


set objRegExp=Nothing
UBBCode=strContent
end function
Response.Write UBBCode(Replace(Request.Form("a"),vbCrLf,"<br/>"))
%>
...全文
117 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
mysoho 2003-07-15
  • 打赏
  • 举报
回复
请问最后如何解决的?
xhuayu 2003-03-22
  • 打赏
  • 举报
回复
看的好乱。其实何必用语言生成颜色或字体呢,增加阅读的难度。看问题应该是路径不对,估计是权限问题,不过你可以使用相对路径试试。
「已注销」 2003-03-21
  • 打赏
  • 举报
回复
“RegExp”对象不能调用,就没法使用正则表达式了。
ckxp 2003-03-21
  • 打赏
  • 举报
回复
不会吧,为了一个UBB还要联系管理员?
能不能通过修改程序解决问题呢?
「已注销」 2003-03-21
  • 打赏
  • 举报
回复
可能少了VB对象:“RegExp”或者你没有权限调用,你可以跟中国频道的管理员联系。

28,391

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧