![]() |
muy bueno <!--#include file="../../scripts/constantes.asp" --> <!--#include file="../../scripts/funciones.asp" --> <!--#include file="../../scripts/uploadfunction.asp" --> <% set Master = DBOpenConection() server.ScriptTimeout = 100000000 modo = request("modo") if modo = "" then modo = "agregar" tipo = request("tipo") if tipo = "" then tipo = 0 upload = request("upload") total_subido = request("total") strReporteListado = request("reporte") valores = request("valores") valores_split = split(valores, "[separar]") if valores_split(0) = 0 then multimedia_codigo = request("multimedia_codigo") if multimedia_codigo = "" then multimedia_codigo = request.Form("txtmultimedia_codigo") else multimedia_codigo = request("multimedia_codigo") if multimedia_codigo = "" then multimedia_codigo = valores_split(0) end if if multimedia_codigo = "" then multimedia_codigo = 0 else multimedia_codigo = cint(multimedia_codigo) if ubound(valores_split) > 0 then multimedia_titulo = valores_split(1) if multimedia_codigo <> 0 then modo = "edicion" end if strPaginaActual = "multimedia_contenido.asp" Const strListaSeparator1 = "#FFFFFF" Const strListaSeparator2 = "#E9E9E9" select case tipo case 1 big_icon = strMainDir & "_gui/multimedia_fotos2.jpg" imagen_preview = strMainDir & "_gui/multimedia_fotospreview2.gif" strDirectorio = strMainDir & "multimedia/fotos/" strExtensiones = Array("jpg", "gif", "png") case 2 big_icon = strMainDir & "_gui/multimedia_videos2.jpg" imagen_preview = strMainDir & "_gui/multimedia_videospreview2.gif" strDirectorio = strMainDir & "multimedia/videos/" strExtensiones = Array("mov", "avi", "mpg", "mpeg", "wmv", "asf") case 3 big_icon = strMainDir & "_gui/multimedia_musica2.jpg" imagen_preview = strMainDir & "_gui/multimedia_musicapreview2.gif" strDirectorio = strMainDir & "multimedia/musica/" strExtensiones = Array("mp3", "wav") case 4 big_icon = strMainDir & "_gui/multimedia_documentos2.jpg" imagen_preview = strMainDir & "_gui/multimedia_documentospreview2.gif" strDirectorio = strMainDir & "multimedia/documentos/" strExtensiones = Array("doc", "txt", "ppt", "csv", "xls", "pdf", "htm", "html", "rtf") end select Set oFO = New FileUpload Set oProps = oFO.GetUploadSettings with oProps .Extensions = strExtensiones .UploadDirectory = Server.Mappath(strDirectorio) .AllowOverWrite = true .MininumFileSize = 0 .MaximumFileSize = 512000 .UploadDisabled = false '.MaximumWidth = 550 '.MaximumHeight = 10000 End with set oProps = nothing oFO.ProcessUpload sSQL = "select * from multimedia where codigo=" & multimedia_codigo set RSMultimedia = Master.Execute(sSQL) if RSMultimedia.bof=false and RSMultimedia.eof=false then multimedia_titulo = Apostrofe(RSMultimedia("titulo"),0) multimedia_descripcion = RSMultimedia("descripcion") multimedia_descripcion = Apostrofe(multimedia_descripcion,0) end if sSQL = "select * from multimedia where tipo=" & tipo & " and privado=0" set RSMultimedia = Master.Execute(sSQL) %> <html> <head> <title>Multimedia Galería</title> <script language="javascript" src="<%=(strMainDir)%>_css/acciones.js"></script> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <style type="text/css"> BODY { color: #000000; font-size:11px; font-family:Tahoma, Verdana, Arial, Helvetica, sans-serif; scrollbar-face-color:#CCCCCC; scrollbar-highlight-color:#000000; scrollbar-shadow-color: #000000; scrollbar-3dligh-color: #DCDCDC; scrollbar-arrow-color: #000000; scrollbar-track-color: #FFFFFF; scrollbar-darkshadow-color: #DCDCDC; scrollbar-base-color: #DCDCDC; background-color:#FFFFFF; } .DivScroll { width:100%; overflow:auto; height:233px; scrollbar-face-color:#CCCCCC; scrollbar-highlight-color:#000000; scrollbar-shadow-color: #000000; scrollbar-3dligh-color: #DCDCDC; scrollbar-arrow-color: #000000; scrollbar-track-color: #FFFFFF; scrollbar-darkshadow-color: #DCDCDC; scrollbar-base-color: #DCDCDC; background:background-color; } .Tablas { color: #000000; font-size:11px; font-family:Tahoma, Verdana, Arial, Helvetica, sans-serif; border:1px solid #525722; background-color:#FFFFFF; } .TablasTitulo { color: #333333; font-size:11px; font-family:Tahoma, Verdana, Arial, Helvetica, sans-serif; font-weight: bold; border-left:1px solid #ECEED5; border-top:1px solid #ECEED5; border-right:1px solid #525722; border-bottom:1px solid #525722; height:26px; background-color:#BEC86F; } .TablaSimple { color: #000000; font-size:11px; font-family:Tahoma, Verdana, Arial, Helvetica, sans-serif; text-decoration:none; } .Botones { color: #FFFFFF; font-size:11px; font-family:Tahoma, Verdana, Arial, Helvetica, sans-serif; font-weight: bold; height: 18px; width: 110px; border-left:1px solid #5C5754; border-top:1px solid #5C5754; border-right:1px solid #000000; border-bottom:1px solid #000000; background-color:#616264; cursor:hand; } INPUT,SELECT,TEXTAREA { color: #000000; font-size:11px; font-family:Tahoma, Verdana, Arial, Helvetica, sans-serif; border:1px solid #000000; background-color:#FFFFFF; } </style> |
continuacion <script language="JavaScript" type="text/JavaScript"> parent.eperar(false) function MM_jumpMenu(targ,selObj,restore){ //v3.0 eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'"); if (restore) selObj.selectedIndex=0; } function preview_multimedia(i,j,tipo) { var file = i.value var sw = false var imagen_actual = "<%=(imagen_preview)%>"; if (file.length <=0 ) return; var ipreview = document.all('ipreview' + j); if (isImage(file,tipo)) { if (tipo == 1) { ipreview.src = 'file://' + file } else { ipreview.src = imagen_actual } } else { ipreview.src = imagen_actual } } function validar(f) { var total = <%=(strMaxFiles)%> var vacio = true; for (i=1; i<=total; i++) { file = eval("f.file" + i); if (file.value != "") { vacio = false } } if (vacio == true) { alert("No ha seleccionado ningún Archivo para Subir."); return false } parent.eperar(true) parent.compute(calculate_size()) f.boton_subir.disabled = true; document.body.style.cursor="wait"; return true } function calculate_size() { var total = <%=(strMaxFiles)%> var imagen_actual = "<%=(imagen_preview)%>"; var filesize = 0 var page_actual = "http://" + document.location.hostname + imagen_actual for (i=1; i<=total; i++) { img = document.all('ipreview' + i); if (img.src != page_actual) { filesize += parseInt(img.fileSize); } } return filesize; } </script> </head> <body> <form name="form1" method="post" action="<%=(strPaginaActual)%>?valores=<%=(valores )%>&tipo=<%=(tipo)%>&modo=<%=(modo)%>&multimedia_c odigo=<%=(multimedia_codigo)%>" enctype="multipart/form-data" onSubmit="return validar(this)"> <fieldset><legend><strong>Datos Generales</strong></legend> <table width="100%" align="center" border="0" cellspacing="2" cellpadding="2" class="TablaSimple"> <tr> <td width="128" rowspan="3" align="center" valign="top"><img src="<%=(big_icon)%>" border="0"></td> <td width="10%">Galerías:</td> <td> <select name="galerias" onChange="MM_jumpMenu('self',this,0)"> <% if multimedia_codigo = 0 then response.Write("<option value=""" & strPaginaActual & """>Seleccione una Galería</option>") while not RSMultimedia.eof if RSMultimedia("codigo") = multimedia_codigo then response.Write("<option value=""" & strPaginaActual & "?modo=edicion&multimedia_codigo=" & RSMultimedia("codigo") & "&tipo=" & tipo & "&valores=" _ & valores & """ selected>" & Apostrofe(RSMultimedia("titulo"),0) & "</option>" & vbcrlf) else response.Write("<option value=""" & strPaginaActual & "?modo=edicion&multimedia_codigo=" & RSMultimedia("codigo") & "&tipo=" & tipo & "&valores=" _ & valores & """>" & Apostrofe(RSMultimedia("titulo"),0) & "</option>" & vbcrlf) end if RSMultimedia.movenext wend %> </select> </td> </tr> <tr> <td>Título:</td> <td><input name="txttitulo" type="text" maxlength="50" style="width:100%;" value="<%=(multimedia_titulo)%>"></td> </tr> <tr> <td>Descripción:</td> <td><textarea name="txtdescripcion" rows="5" style="width:100%;"><%=(multimedia_descripcion)%></textarea></td> </tr> </table> </fieldset> <br> <fieldset><legend><strong>Subir Archvios</strong></legend> <div class="DivScroll"> <% if upload <> "ok" then strReporte = "" strTotalOk = 0 strErrorDefault = "El Archivo posee un mal nombre o no existe o simplemente ud. no seleccionó el archivo." if oFO.TotalFormCount > 0 then if oFO.FileCount > 0 then multimedia_titulo = oFO.Form("txttitulo") multimedia_descripcion = oFO.form("txtdescripcion") if modo = "agregar" then if multimedia_titulo = "" then multimedia_titulo = "Galería del " & now() sSQL = "insert into multimedia(titulo,descripcion,tipo) values ('" & Apostrofe(multimedia_titulo,1) & "', '" & Apostrofe(multimedia_descripcion,1) & "', " _ & tipo & ")" Master.Execute(sSQL) sSQL = "select * from multimedia where titulo='" & Apostrofe(multimedia_titulo,1) & "' and tipo=" & tipo & " order by codigo desc" set RSMultimedia = Master.Execute(sSQL) if RSMultimedia.bof=false and RSMultimedia.eof=false then multimedia_codigo = RSMultimedia("codigo") else multimedia_codigo = 0 end if end if for I = 1 to oFO.FileCount set oFile = oFO.File(I) if oFile.ErrorMessage <> "" then if strErrorDefault <> oFile.ErrorMessage then strReporte = strReporte & oFile.ErrorMessage & " (Archivo <strong>" & I & "</strong>)[separar]" else descripcion = oFO.Form("txtdescripcion" & I) archname = oFile.FileName if modo = "agregar" then sSQL = "insert into multimediagaleria (multimedia,fullname,descripcion,sw) values (" & multimedia_codigo & ", '" & Apostrofe(archname,1) & "', " _ & "'" & Apostrofe(descripcion,1) & "', " & 1 & ")" Master.Execute(sSQL) sSQL = "select * from multimediagaleria where sw=true order by codigo desc" set RSGaleria = Master.Execute(sSQL) newarchname = RSGaleria("codigo") & "." & oFile.FileExtension end if oFile.FileName = newarchname oFile.SaveAsFile if modo = "agregar" then sSQL = "update multimediagaleria set archivo='" & newarchname & "', sw=" & 0 & " where codigo=" & RSGaleria("codigo") Master.Execute(sSQL) end if if oFile.UploadSuccessful then strTotalOk = strTotalOk + 1 strReporte = strReporte & "<ok>El Archivo <strong>" & archname & "</strong> se subió correctamente (Archivo " & I & ").[separar]" else if strErrorDefault <> oFile.ErrorMessage then strReporte = strReporte & oFile.ErrorMessage & " (Archivo <strong>" & I & "</strong>)[separar]" end if end if set oFile = Nothing next if strTotalOk = 0 and modo = "agregar" then sSQL = "delete from multimedia where codigo=" & multimedia_codigo Master.Execute(sSQL) multimedia_codigo = 0 set Master = DBOpenConection() end if response.redirect(strPaginaActual & "?upload=ok&modo=agregar&tipo=" & tipo & "&valores=" & multimedia_codigo & "[separar]&reporte=" & strReporte _ & "&total=" & strTotalOk) end if else bgcolor = strListaSeparator2 for I = 1 to strMaxFiles if I < 10 then num_foto = "0" & I else num_foto = I if bgcolor = strListaSeparator1 then bgcolor = strListaSeparator2 else bgcolor = strListaSeparator1 %> <table width="100%" align="center" border="0" cellspacing="2" cellpadding="2" class="TablaSimple" bgcolor="<%=(bgcolor)%>"> <tr> <td rowspan="2" width="2%"><%=(num_foto)%></td> <td width="128" rowspan="2" align="center"><img src="<%=(imagen_preview)%>" border="0" id="ipreview<%=(I)%>" width="100" height="100"></td> <td width="10%">Archivo:</td> <td><input type="file" name="file<%=(I)%>" style="width:100%;" onchange="preview_multimedia(this,<%=(I)%>,<%=(tip o)%>)"></td> </tr> <tr> <td>Descripción:</td> <td><textarea name="txtdescripcion<%=(I)%>" rows="5" style="width:100%;"></textarea></td> </tr> </table> <% if I < strMaxFiles then %> <hr> <% end if next end if set oFO = Nothing else %> |
sigue <table width="100%" align="center" border="0" cellspacing="2" cellpadding="2" class="TablaSimple"> <tr> <td width="70"><img src="<%=(strMainDir)%>_gui/multimedia_informe.jpg" border="0"></td> <td><strong><span style="color:#FF0000; font-size:14px;">Informe de los Archivos Subidos al Servidor</span><br><br>Total:</strong> <%=(total_subido)%> de <%=(strMaxFiles)%></td> </tr> <tr> <td colspan="2"><hr></td> </tr> <tr> <td colspan="2"> <% strReporteListado_split = split(strReporteListado, "[separar]") %> <table width="100%" align="center" border="0" cellspacing="2" cellpadding="2" class="TablaSimple"> <% for I = 0 to ubound(strReporteListado_split)-1 if left(strReporteListado_split(I), 4) = "<ok>" then icon_reporte = strMainDir & "_gui/mini_icon_multimedia_ok.gif" descripcion_reporte = strReporteListado_split(I) else icon_reporte = strMainDir & "_gui/mini_icon_multimedia_error.gif" descripcion_reporte = "<span style=""color:#FF0000;"">" & strReporteListado_split(I) & "</span>" end if %> <tr> <td width="16"><img src="<%=(icon_reporte)%>" border="0"></td> <td><%=(descripcion_reporte)%></td> </tr> <% next %> </table> </td> </tr> </table> <% end if %> </div> </fieldset> <table width="100%" align="center" border="0" cellspacing="2" cellpadding="2" class="TablaSimple"> <tr> <td align="center" height="40"> <input name="boton_nuevo" type="button" class="Botones" value="Nueva Galería" onClick="document.location.href='<%=(strPaginaActu al & "?modo=agregar&tipo=" & tipo & "&valores=0")%>'"> <% if strReporteListado = "" then %> <input name="boton_subir" type="submit" value="Subir Archivos" class="Botones"> <% else %> <input name="boton_seguirsubiendo" type="button" value="Seguir Subiendo" class="Botones" onClick="document.location.href='<%=(strPaginaActu al & "?valores=" & valores & "&tipo=" & tipo & "&modo=edicion&multimedia_codigo=" & multimedia_codigo)%>'; this.disabled=true;"> <% end if %> <input name="boton_cancelar" type="button" value="Cancelar" class="Botones" onClick="window.close()"> <input type="hidden" name="txtmultimedia_codigo" value="<%=(multimedia_codigo)%>"></td> </tr> <% if multimedia_codigo <> 0 then %> <tr> <td align="center"><input name="boton_insertar" type="button" class="Botones" value="Insertar la Galería" onClick="parent.insertargaleria(<%=(multimedia_cod igo)%>,'<%=(multimedia_titulo)%>')" style="width:150px;"></td> </tr> <% end if %> </table> </form> </body> </html> |
ok esta bien al parecer |
que es esto? |
Repito la pregunta, qué es esto ? Este es el subforo de Cold Fusion, no de ASP !! Además que se supone que debemos hacer con todo este código ?? |
| La zona horaria es GMT -6. Ahora son las 01:35. |
Desarrollado por vBulletin® Versión 3.8.7
Derechos de Autor ©2000 - 2026, Jelsoft Enterprises Ltd.