急~~~~~~~~~~~求ubb码问题,大家快请看看

bluebaby718 2003-10-09 10:37:08
请问大家,在用ubb码做新闻发布,发图片时,这个实现是在后台中的ubb码,一点插入图片时,选择路径然后点确定,在文本框里就写出来了。怎么才能使图片发布后,一点后能放大,就是做一个链接,谢谢各位了,N次鞠躬~~

randomize
ranNum=int(90000*rnd)+10000
filename=formPath&year(now)&month(now)&day(now)&ranNum&fileExt

' filename=formPath&year(now)&month(now)&day(now)&hour(now)&minute(now)&second(now)&file.FileName

if file.FileSize>0 then ''如果 FileSize > 0 说明有文件数据
file.SaveAs Server.mappath(FileName) ''保存文件
' response.write file.FilePath&file.FileName&" ("&file.FileSize&") => "&formPath&File.FileName&" 成功!<br>"
if fileEXT=".gif" then
weizhi=FileName
elseif fileEXT=".jpg" then
weizhi=FileName
end if
iCount=iCount+1
end if
set file=nothing
next
set upload=nothing ''删除此对象
response.write "<br>"
dim image
if session("image")="" then
session("image")=weizhi
end if
%>

<%
dm = right(request("weizhi"),len(request("weizhi"))-instr(request("weizhi"),"/"))
dm="[IMG]"&dm&"[/IMG]"
%>

就是在dm中的,怎么加一个<a href>呀?求求大家了~~~
有人说加upload可以实现发表图片后,一点图片后,能够放大,请问怎么实现?
...全文
104 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
yangsm 2003-10-10
  • 打赏
  • 举报
回复
看来我是来晚了吗?分都被楼上的给拿去了。不过,学习一下!
BainStudio 2003-10-10
  • 打赏
  • 举报
回复
不好意思.少写了两句话.
在end function前加上.
set re=Nothing
Ubbcode=strContent
这两句


BainStudio 2003-10-10
  • 打赏
  • 举报
回复
呵呵.楼上的应该没有问题了.但是你如果不知道怎么调用也还是问题.

<%
function Ubbcode(strContent)
dim re
dim reContent
Set re=new RegExp
re.IgnoreCase =True
re.Global=True

re.Pattern="\[IMG\](.[^\[]*)(gif|jpg|jpeg|bmp|png)\[\/IMG\]"
strContent= re.Replace(strContent,"<br><A HREF=""$1$2"" TARGET=_blank><IMG SRC=""$1$2"" border=0></A>")
end function

Response.write Ubbcode("[IMG]test/gogog.gif[/IMG]")
%>
yllaji 2003-10-09
  • 打赏
  • 举报
回复
为了 这 100分 全部代码都给你好了!

<%
dim re
dim reContent
Set re=new RegExp
re.IgnoreCase =True
re.Global=True
strContent="[IMG]test/gogog.gif[/IMG]"


re.Pattern="\[IMG\](.[^\[]*)(gif|jpg|jpeg|bmp|png)\[\/IMG\]"
strContent= re.Replace(strContent,"<br><A HREF=""$1$2"" TARGET=_blank><IMG SRC=""$1$2"" border=0></A>")

Response.write strContent
%>

我测试过 绝对可以用!
yllaji 2003-10-09
  • 打赏
  • 举报
回复
这段代码 应该可以适合你

re.Pattern="\[IMG\](.[^\[]*)(gif|jpg|jpeg|bmp|png)\[\/IMG\]"
strContent= re.Replace(strContent,"<br><A HREF=""$2$1"" TARGET=_blank><IMG SRC=""$2$1"" border=0></A>")
yllaji 2003-10-09
  • 打赏
  • 举报
回复
仅供参考

re.Pattern="\[IMG\](http|https|ftp):\/\/(.[^\[]*)\[\/IMG\]"
strContent=re.Replace(strContent,"<a href=""$1://$2"" target=_blank><IMG SRC=""$1://$2"" border=0></a>")


re.Pattern="\[IMG\](http|https|ftp):\/\/(.[^\[]*)\[\/IMG\]"
strContent=re.Replace(strContent,"<IMG SRC=""images/files/gif.gif"" border=0><a onfocus=this.blur() href=""$1://$2"" target=_blank>$1://$2</a>")

上面是 动网的 ubbcode 的一些代码 希望对你有用

28,391

社区成员

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

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