
29/06/2005, 12:16
|
 | | | Fecha de Ingreso: julio-2002 Ubicación: Rio Gallegos - Santa Cruz
Mensajes: 893
Antigüedad: 22 años, 9 meses Puntos: 1 | |
la idea lo saque de un portal que viene prearmado como los de phpnuke, les dejo el codigo haver si con eso se dan una idea, porque la verdad yo no me la puedo dar, estube rompiendome la cabeza y no me sale ya mas nada.
CODIGO
<%
Response.Buffer = True
Private Function RedirectTo(strPage)
Response.Redirect(strPage)
End Function
Response.Expires = -1
Response.ExpiresAbsolute = Now() - 2
Response.AddHeader "pragma","no-cache"
Response.AddHeader "cache-control","private"
Response.CacheControl = "No-Store"
Dim intNumOfModules 'Holds the number of modules in the column
Dim intNumRows 'Holds the number of rows in a recordset
Dim intNumTableColumns 'Holds the number of columns in the layout
Dim intLoop 'Loop counter
Dim rsMaxOrder 'Recordset object, holds the highest positionnumber in a column
Dim intThisOrder
Dim blnForumLocked 'Holds the orderposition when a module is moved or added
intNumTableColumns = 3
Dim rsModules
Dim reqAction
Dim TrueToggle
Dim FalseToggle
If strDatabaseType = "SQLServer" Then
TrueToggle = 1
FalseToggle = 0
Else
TrueToggle = aTrue
FalseToggle = aFalse
End If
reqAction = RemoveAllTags(Trim(Request.QueryString("a")))
Set rsModules = Server.CreateObject("ADODB.Recordset")
If Not isNull(reqAction) and Len(reqAction) > 0 Then
Select Case reqAction
Case "u"
adoCon.BeginTrans
strSQL = "UPDATE " & strDBTable & "Modules"
strSQL = strSQL & " SET OrderToShow = " & CheckInt(Request.QueryString("o"))
strSQL = strSQL & " WHERE ColumnToAppearIn = " & CheckInt(Request.QueryString("c"))
strSQL = strSQL & " AND OrderToShow = " & CheckInt(Request.QueryString("o")-1)
adoCon.Execute(strSQL)
strSQL = "UPDATE " & strDBTable & "Modules"
strSQL = strSQL & " SET OrderToShow = " & CheckInt(Request.QueryString("o")-1)
strSQL = strSQL & " WHERE ColumnToAppearIn = " & CheckInt(Request.QueryString("c"))
strSQL = strSQL & " AND Module_ID = " & CheckInt(Request.QueryString("m"))
adoCon.Execute(strSQL)
If adoCon.Errors.Count = 0 Then
adoCon.CommitTrans
Else
adoCon.RollbackTrans
End If
closeRS(rsCommon)
closeDB()
response.redirect(strWebsiteUrl & "portal_mgmt_layout.asp")
Case "d"
adoCon.BeginTrans
strSQL = "UPDATE " & strDBTable & "Modules"
strSQL = strSQL & " SET OrderToShow = " & CheckInt(Request.QueryString("o"))
strSQL = strSQL & " WHERE ColumnToAppearIn = " & CheckInt(Request.QueryString("c"))
strSQL = strSQL & " AND OrderToShow = " & CheckInt(Request.QueryString("o")+1)
adoCon.Execute(strSQL)
strSQL = "UPDATE " & strDBTable & "Modules"
strSQL = strSQL & " SET OrderToShow = " & CheckInt(Request.QueryString("o")+1)
strSQL = strSQL & " WHERE ColumnToAppearIn = " & CheckInt(Request.QueryString("c"))
strSQL = strSQL & " AND Module_ID = " & CheckInt(Request.QueryString("m"))
adoCon.Execute(strSQL)
If adoCon.Errors.Count = 0 Then
adoCon.CommitTrans
Else
adoCon.RollbackTrans
End If
closeRS(rsCommon)
closeDB()
response.redirect(strWebsiteUrl & "portal_mgmt_layout.asp")
Case "l"
adoCon.BeginTrans
strSQL = "UPDATE " & strDBTable & "Modules SET OrderToShow = [OrderToShow]-1 "
strSQL = strSQL & "WHERE ColumnToAppearIn = " & CheckInt(Request.QueryString("c") )
strSQL = strSQL & " AND OrderToShow > " & CheckInt(Request.QueryString("o"))
adoCon.Execute(strSQL)
strSQL = "SELECT MAX(OrderToShow) AS MaxOrder FROM " & strDBTable & "Modules WHERE ColumnToAppearIn = " & CheckInt(Request.QueryString("c")-1)
Set rsMaxOrder = Server.CreateObject("ADODB.Recordset")
rsMaxOrder.Open strSQL, adoCon
If IsNull(rsMaxOrder("MaxOrder")) Then
intThisOrder = 1
Else
intThisOrder = rsMaxOrder("MaxOrder")+1
End If
strSQL = "UPDATE " & strDBTable & "Modules"
strSQL = strSQL & " SET ColumnToAppearIn = " & CheckInt(Request.QueryString("c")-1) & ","
strSQL = strSQL & " OrderToShow = " & intThisOrder & " "
strSQL = strSQL & " WHERE Module_ID = " & CheckInt(Request.QueryString("m"))
adoCon.Execute(strSQL)
If adoCon.Errors.Count = 0 Then
adoCon.CommitTrans
Else
adoCon.RollbackTrans
End If
closeRS(rsMaxOrder)
closeRS(rsCommon)
closeDB()
response.redirect(strWebsiteUrl & "portal_mgmt_layout.asp")
Case "r"
adoCon.BeginTrans
strSQL = "UPDATE " & strDBTable & "Modules SET OrderToShow = [OrderToShow]-1 "
strSQL = strSQL & "WHERE ColumnToAppearIn = " & CheckInt(Request.QueryString("c")) & " AND OrderToShow > " & CheckInt(Request.QueryString("o"))
adoCon.Execute(strSQL)
strSQL = "SELECT MAX(OrderToShow) AS MaxOrder FROM " & strDBTable & "Modules WHERE ColumnToAppearIn = " & CheckInt(Request.QueryString("c")+1)
Set rsMaxOrder = Server.CreateObject("ADODB.Recordset")
rsMaxOrder.Open strSQL, adoCon
If IsNull(rsMaxOrder("MaxOrder")) Then
intThisOrder = 1
Else
intThisOrder = rsMaxOrder("MaxOrder")+1
End If
strSQL = "UPDATE " & strDBTable & "Modules"
strSQL = strSQL & " SET ColumnToAppearIn = " & CheckInt(Request.QueryString("c")+1) & ","
strSQL = strSQL & " OrderToShow = " & intThisOrder
strSQL = strSQL & " WHERE Module_ID = " & CheckInt(Request.QueryString("m"))
adoCon.Execute(strSQL)
If adoCon.Errors.Count = 0 Then
adoCon.CommitTrans
Else
adoCon.RollbackTrans
End If
closeRS(rsMaxOrder)
closeRS(rsCommon)
closeDB()
response.redirect(strWebsiteUrl & "portal_mgmt_layout.asp")
Case "ht"
strSQL = "UPDATE " & strDBTable & "Modules"
strSQL = strSQL & " SET showToggle =" & FalseToggle
strSQL = strSQL & " WHERE Module_ID = " & CheckInt(Request.QueryString("m"))
adoCon.Execute(strSQL)
closeRS(rsCommon)
closeDB()
response.redirect(strWebsiteUrl & "portal_mgmt_layout.asp")
Case "st"
strSQL = "UPDATE " & strDBTable & "Modules"
strSQL = strSQL & " SET showToggle = " & TrueToggle
strSQL = strSQL & " WHERE Module_ID = " & CheckInt(Request.QueryString("m"))
adoCon.Execute(strSQL)
closeRS(rsCommon)
closeDB()
response.redirect(strWebsiteUrl & "portal_mgmt_layout.asp")
Case else
closeRS(rsCommon)
closeDB()
response.redirect(strWebsiteUrl & "portal_mgmt_layout.asp")
End Select
End If
__________________ ---->Sin ayuda no se llega a ningun lado<---- Virla |