28,391
社区成员
发帖
与我相关
我的任务
分享
<%
'在这里要判断是否登录
user_id=1
user_name="test"
dim action,id,mode1,panelcolor,panelalpha,fontcolor,fontsize,frameid,effectid,imagenum,song,imgurl,imginf,imgdid,imgeffect
dim MusicDateArea,ImgDateArea,imgSize,imgUrl1,rs,sql,i,s_images
MusicDateArea=request("MusicDateArea")
ImgDateArea=request("ImgDateArea")
MusicDateArea=split(MusicDateArea,"&")
mode1=replace(MusicDateArea(1),"mode=","")
id = request("id")
if id=0 then'================
if mode1="create" then
panelColor=replace(MusicDateArea(4),"panelColor=","")
panelAlpha=replace(MusicDateArea(5),"panelAlpha=","")
fontColor=replace(MusicDateArea(6),"fontColor=","")
fontSize=replace(MusicDateArea(7),"fontSize=","")
song=replace(MusicDateArea(8),"song=","")
frameID=replace(MusicDateArea(12),"frameID=","")
effectID=replace(MusicDateArea(13),"effectID=","")
ImgDateArea=split(ImgDateArea,"|")
imageNum=ubound(ImgDateArea)
redim pic_info(imageNum-1)
set rs=server.createobject("adodb.recordset")
for i = 0 to imageNum-1
pic_info(i)=split(ImgDateArea(i),"&")
imgUrl=replace(pic_info(i)(1),"imgUrl=","")
imgInf=replace(pic_info(i)(2),"imgInf=","")
imgDid=replace(pic_info(i)(3),"imgDid=","")
imgEffect=replace(pic_info(i)(4),"imgEffect=","")
imgSize=replace(pic_info(i)(5),"imgSize=","")
if i=0 then
s_images=replace(imgUrl,"mtvPhoto_temp","mtvPhoto_pic")
song1=replace(song,"mtvPhoto_temp","mtv_Mp3")
sql="insert into mtv_Photo (userid,username,panelcolor,panelalpha,fontcolor,fontsize,frameid,effectid,imagenum,song,s_images,addtime) values("&user_id&",'"&user_name&"','"&panelColor&"',"&panelAlpha&",'"&fontColor&"',"&fontSize&","&frameID&","&effectID&","&imageNum&",'"&song1&"','"&s_images&"',getdate())"
conn.execute(sql)
'打开读取插入的ID
sql="select top 1 id from mtv_Photo order by id desc"
rs.open sql,conn,1,1
id=rs("id")
rs.close
set rs=nothing
end if
imgUrl1=replace(imgUrl,"mtvPhoto_temp","mtvPhoto_pic")
sql="insert into mtv_img_list (userid,imgpath,i_text,types,mtv_id,imgsize) values("&user_id&",'"&imgUrl1&"','"&imgInf&"',"&imgEffect&","&id&","&imgSize&")"
conn.execute(sql)
'将图片转出临时文件夹
move_pic imgUrl,imgUrl1
if instr(song1,"mtv_Mp3")>0 then
move_mp3 song,song1
end if
next
response.redirect "mtv_show_pic.asp?a=saveimg&id=" & id
else
openmsg "你能告诉我打开这个页面准备干什么吗?"
end if
else'================
if mode1="create" then
panelColor=replace(MusicDateArea(4),"panelColor=","")
panelAlpha=replace(MusicDateArea(5),"panelAlpha=","")
fontColor=replace(MusicDateArea(6),"fontColor=","")
fontSize=replace(MusicDateArea(7),"fontSize=","")
song=replace(MusicDateArea(8),"song=","")
frameID=replace(MusicDateArea(12),"frameID=","")
effectID=replace(MusicDateArea(13),"effectID=","")
ImgDateArea=split(ImgDateArea,"|")
imageNum=ubound(ImgDateArea)
redim pic_info(imageNum-1)
set rs=server.createobject("adodb.recordset")
'先删除以前的数据
conn.execute("delete from mtv_img_list where mtv_id=" & id & " and userid=" & user_id)
for i = 0 to imageNum-1
pic_info(i)=split(ImgDateArea(i),"&")
imgUrl=replace(pic_info(i)(1),"imgUrl=","")
imgInf=replace(pic_info(i)(2),"imgInf=","")
imgDid=replace(pic_info(i)(3),"imgDid=","")
imgEffect=replace(pic_info(i)(4),"imgEffect=","")
imgSize=replace(pic_info(i)(5),"imgSize=","")
if i=0 then
s_images=replace(imgUrl,"mtvPhoto_temp","mtvPhoto_pic")
song1=replace(song,"mtvPhoto_temp","mtv_Mp3")
sql="update mtv_Photo set panelcolor= '"&panelColor&"',panelalpha='"&panelAlpha&"',fontcolor='"&fontColor&"',fontsize="&fontSize&",frameid="&frameID&",effectid="&effectID&",imagenum="&imageNum&",song='"&song1&"',s_images='"&s_images&"' where id=" & id & " and userid=" & user_id
conn.execute(sql)
end if
imgUrl1=replace(imgUrl,"mtvPhoto_temp","mtvPhoto_pic")
sql="insert into mtv_img_list (userid,imgpath,i_text,types,mtv_id,imgsize) values("&user_id&",'"&imgUrl1&"','"&imgInf&"',"&imgEffect&","&id&","&imgSize&")"
conn.execute(sql)
'将图片转出临时文件夹
move_pic imgUrl,imgUrl1
if instr(song1,"mtv_Mp3")>0 then
move_mp3 song,song1
end if
next
response.redirect "mtv_show_pic.asp?a=saveimg&id=" & id
else
openmsg "你能告诉我打开这个页面准备干什么吗?"
end if
end if
function move_pic(url,url1)
dim fso,f2
Set fso = CreateObject("Scripting.FileSystemObject")
url1=replace(url1,weburl & "/","")
url=replace(url,weburl & "/","")
'CreateDir(Server.mappath(url1))
if fso.FileExists(server.MapPath(url)) then
Set f2 = fso.GetFile(Server.mappath(url))
f2.Move(Server.mappath(url1))
set f2=nothing
end if
set fso=nothing
end function
function move_mp3(url,url1)
dim fso,f2
if url1="" then
exit function
end if
Set fso = CreateObject("Scripting.FileSystemObject")
url1=replace(url1,weburl & "/","")
url=replace(url,weburl & "/","")
'CreateDir(Server.mappath(url1))
if fso.FileExists(server.MapPath(url)) then
Set f2 = fso.GetFile(Server.mappath(url))
f2.Move(Server.mappath(url1))
set f2=nothing
end if
set fso=nothing
end function
%>
sql="update mtv_Photo set panelcolor= '"&panelColor&"',panelalpha='"&panelAlpha&"',fontcolor='"&fontColor&"',fontsize="&fontSize&",frameid="&frameID&",effectid="&effectID&",imagenum="&imageNum&",song='"&song1&"',s_images='"&s_images&"' where id=" & id & " and userid=" & user_id
conn.execute(sql)
end if
imgUrl1=replace(imgUrl,"mtvPhoto_temp","mtvPhoto_pic")
sql="insert into mtv_img_list (userid,imgpath,i_text,types,mtv_id,imgsize) values("&user_id&",'"&imgUrl1&"','"&imgInf&"',"&imgEffect&","&id&","&imgSize&")"
conn.execute(sql)