官方首页 | 无图版 | BBS首页
PJBlog3 2.8.5.157 新版发布 下载|升级(2008.8.26) 来给PJ3提提发展建议 2008版 PJHOME 珍藏/纪念版官方T恤 正式发布! PJ3内测团队主创人员身份,性格,特点吐血大曝光
PJBlog技术支持论坛使用问题总索引 PJ-Blog 3 斑竹日志 【独家】我使用过的三种空间,与客服的精彩故事 Z-Blog,Wordpress,Bo-Blog转换到PJBlog
发新话题
打印

这两个功能你们是怎么做到的,帮忙答一下,官方?

这两个功能你们是怎么做到的,帮忙答一下,官方?

1、远程存图:不是链人家的图片,是把人家的图片直接保存在你的Blog中,并且图片地址变成你的Blog地址了,看上去就和你原创的图片一样,盗只别人的图片链接,如果人家把图片删除,你的Blog中就无法显示了。

2、添加日志时,在文章中插入图片时,不能直接上传本地图片

特别是第二个使用起来太不方便了!如果有实现方法请指点!谢谢!

TOP

引用:
原帖由 fcnh2008 于 2006-6-27 18:20 发表
1、远程存图:不是链人家的图片,是把人家的图片直接保存在你的Blog中,并且图片地址变成你的Blog地址了,看上去就和你原创的图片一样,盗只别人的图片链接,如果人家把图片删除,你的Blog中就无法显示了。

2、 ...
第2个在发表文章的时候,上传附件
[quote]≡=-隐博-=≡[/quote]

TOP

远程图片上传的代码如下
复制内容到剪贴板
代码:
<html>
<head>
<meta http-equiv="content-Type" content="text/html; charset=gb2312">
<title>远程图片上传</title>
<style type=text/css>
a                        { text-decoration: none; color: blue }
a:hover                        { text-decoration: underline }
body                        { scrollbar-base-color: #F8F8F8; scrollbar-arrow-color: #698CC3; font-size: 12pt; background-color: #ffffff }
</style>
<body topmargin="0" bgcolor="#F9F9F9">
<%
Server.ScriptTimeOut=99999
savepath="tianzi-org"
imgpath=request("imgpath")
if imgpath="" then
response.write "<form name=mofeiform method=post action=''><input type=text name=imgpath size=35> <input type=submit name=Submit001 value=远程上传>输入远程图片地址</form>"
else
filepath02=mofeifoldfso(savepath)
savepath=savepath&"\"&year(now())&"-"&month(now())
filepath02=mofeifoldfso(savepath)
urname01=myreplace(imgpath)
end if

function myreplace(str)
newstr=str
set objregEx = new RegExp
objregEx.IgnoreCase = true
objregEx.Global = true
objregEx.Pattern = "http://(.+?)\.(jpg|gif|png|bmp|jpeg)" '定义文件后缀.
set matches = objregEx.execute(str)
for each match in matches
newstr=replace(newstr,match.value,saveimg(match.value))
next
myreplace=newstr
end function

function saveimg(url)
temp=split(url,".")
filename="tz-"&year(now)&month(now)&day(now)&hour(now)&minute(now)&second(now)&"."&temp(ubound(temp))
'重命名文件名结束
set xmlhttp=server.createobject("Microsoft.XMLHTTP")
xmlhttp.open "get",url,false
xmlhttp.send
img=xmlhttp.ResponseBody
set xmlhttp=nothing
set objAdostream=server.createobject("ADODB.Stream")
objAdostream.Open()
objAdostream.type=1
objAdostream.Write(img)
if objAdostream.size<200 then
response.write "<font color=red>没找到内容!</font>[<a href=# onclick=history.go(-1)>返回</a>]"
response.end
end if
objAdostream.SaveToFile(server.mappath(savepath&"\"&filename))
objAdostream.SetEOS
set objAdostream=nothing
imgpath01=savepath&"\"&filename '返回图片路径
imgpath01=replace(imgpath01,"\","/")
response.write ("图片地址:"&imgpath01&"[<a href=# onclick=history.go(-1)>继续上传</a>]")
end function

Function mofeifoldfso(mpath)
Set fso = Server.CreateObject("Scripting.FileSystemObject")
if not fso.FolderExists(server.Mappath(mpath)) then fso.Createfolder(server.mappath(mpath))
set fso=nothing
End Function
%>

</body>
</html>

TOP

发新话题