'*****************************************************************
'function(公有)
'作用:格式化远程图片地址为本地位置
'参数:imgurl(远程图片地址),imgfolder(本地图片目录),fristname(加入的前缀名称)
'*****************************************************************
PublicFunctionFormatImgPath(byrefImgUrl,byrefImgFolder,byrefFristName,byrefnoimg)
strpath=""
ImgUrl=ImgUrl
ifinstr(ImgUrl,"Nophoto")orlenb(GetData(ImgUrl,0))<=0then
strpath=noimg
Response.Write""&strpath&""&vbcrlf
else
ifInstr(ImgUrl,".asp")then
strpath=FristName&"_"&Mid(ImgUrl,InStrRev(ImgUrl,"=")+1)&".jpg"
else
strpath=FristName&"_"&Mid(ImgUrl,InStrRev(ImgUrl,"/")+1)
endif
strpath=ImgFolder&"/"&strpath
strpath=Replace(strpath,"//","/")
ifleft(strpath,1)="/"thenstrpath=right(strpath,len(strpath)-1)
strpath=trim(strpath)
Response.Write""&strpath&""&vbcrlf
savedataImgUrl,strpath
endif
FormatImgPath=strpath
Endfunction
|