%
'-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#
' Loja Exemplo Locaweb
' Versão: 6.2
' Data: 12/09/06
' Arquivo: default.asp
' Versão do arquivo: 0.0
' Data da ultima atualização: 12/09/06
'
'-----------------------------------------------------------------------------
' Licença Código Livre: http://comercio.Locaweb.com.br/gpl/gpl.txt
'-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-
rodape = "no"
page = "videos"
%>
<%
Set myRequest = CreateObject("Scripting.Dictionary")
Set myRequestFiles = CreateObject("Scripting.Dictionary")
if ParseMultiPartForm()=true then parse=1
autorizo_newsletter = Pega_DadoBanco("Newsletter","autorizo_newsletter","email","'"&session("user_id")&"'")
pode_enviar_videos = False
If autorizo_newsletter = "1" then
pode_enviar_videos = True
End if
If getRequestForm("value_comentario") <> "" And getRequestForm("file_arquivo_video") <> "" And pode_enviar_videos = True Then
If VerificaExistenciaDado("arquivo_video","_videos_user","arquivo_video","'"&getRequestForm("value_arquivo_video")&"'") Then
message = "Esse vídeo já foi enviado."
Else
Set InsertVideo = Server.CreateObject("adodb.recordset")
InsertVideo.Open "_videos_user",conexao,3,3
InsertVideo.AddNew
InsertVideo("user_id") = session("user_id")
InsertVideo("comentario") = getRequestForm("value_comentario")
InsertVideo("arquivo_video") = getRequestForm("value_arquivo_video")
InsertVideo("status") = "I"
InsertVideo("data_envio") = date
InsertVideo.Update
Set InsertVideo = Nothing
value = postvalue("file_arquivo_video")
ttype="upload0"
toadd=true
if vartype(value)=11 then
if value=false then toadd=false
end if
if toadd then
'thumb = CreateThumbnail(GetRequestForm("arquivo"),150,"")
'if lenb(thumb)>0 then _
'WriteToFile "C:\\Inetpub\\wwwroot\\teste\\" & getRequestForm("nome_arquivo"), thumb
WriteToFile "e:\\home\\electronskateboards\\Web\\loja\\sources\\videos\\" & getRequestForm("value_arquivo_video"), value
end If
' response.write ""
message = "1"
End If
end if
'Cria o objeto RS_Videos de recordset
Set RS_Videos = CreateObject("ADODB.Recordset")
Set RS_Videos.ActiveConnection = Conexao
RS_Videos.CursorLocation = 3
RS_Videos.CursorType = 0
RS_Videos.LockType = 1
'Executa da Query de consulta
RS_Videos.Open "select cod_video, user_id, tit_video, comentario, img_th, arquivo_video From _videos_user where status = 'A' ORDER BY data_envio DESC"
If Not RS_Videos.EOF then
Do Until RS_Videos.EOF
response.write "
<% If getRequestForm("video") = "" Then %>; background-image:url(../imagens/bg_televisao_sintonia_ani.gif); background-position:center; height:308px; background-repeat:no-repeat;<% End If %>">
<%
If message <> "" Then
If message = "1" Then
response.write "
Obrigado por mandar seu video. Em breve estará no ar.
"
Else
response.write "
" & message & "
"
End If
End if
%>
<%
If getRequestForm("video") <> "" then
'Cria o objeto RS_Ver de recordset
Set RS_Ver = CreateObject("ADODB.Recordset")
Set RS_Ver.ActiveConnection = Conexao
RS_Ver.CursorLocation = 3
RS_Ver.CursorType = 0
RS_Ver.LockType = 1
'Executa da Query de consulta
RS_Ver.Open "select cod_video, user_id, tit_video, comentario, img_th, arquivo_video From _videos_user where cod_video = " & getRequestForm("video") & " AND status = 'A'"
If Not RS_Ver.EOF Then
%>
<%
response.write "