Forum 

Forum AspNuke.it - Il tuo Portale OpenSource in ASP

creazione nuove pagine

Autore Messaggio
carrap

Amatore
Amatore
40 Discussioni



Profilo - carrap
17 marzo 2006 alle 09:11:44 Profilo - carrapInvia un messaggio privato Rispondi quotando
djveleno

Amministratore

Esperto
Esperto
1025 Discussioni



Profilo - djveleno
17 marzo 2006 alle 21:34:29 Profilo - djvelenoInvia un messaggio privato Rispondi quotando
A questo 3D cosa bisogna rispondere?
Posso buttare li a caso qualche frase o, prendo spunto dal titolo?
---------------
A lavare la testa ai somari, ci si rimette l'acqua e il sapone!

http://aspnuke208.somee.com/Default.asp

carrap

Amatore
Amatore
40 Discussioni



Profilo - carrap
20 marzo 2006 alle 18:46:39 Profilo - carrapInvia un messaggio privato Rispondi quotando
hai ragione ma avevo fretta e non ho notato di non aver scritto nulla!!!
il mio problema e quello di riscrivere la pagina images-inc nella pagina societa-inc.non so di questo codice cosa cambiare e non so se devo fare un nuovo db:

<%
' ************************************************************************
' * ASPNUKE: Free web portal in ASP *
' ************************************************************************
' * ASP-Nuke 2.0 Copyright (c) 2004 by Aspnuke.it Staff *
' * (staff@aspnuke.it) http://www.aspnuke.it *
' * *
' * Re-design by Enrico Musante (c) 2004 (emu@libero.it) *
' * Re-design by Frank Zalabard (c) 2004 (fsarzana@hotmail.com) *
' * *
' * ASP-Nuke 1.0, 1.1, 1.2 Copyright (c) 2002-2003 by Gaetan Bouveret *
' * (webmaster@asp-nuke.com) http://www.asp-nuke.com *
' * *
' * This program is free software. You can redistribute it and/or modify *
' * it under the terms of the GNU General Public License as published by *
' * the Free Software Foundation; either version 2 of the License, or *
' * (at your option) any later version. *
' * *
' ************************************************************************
%>
<%
' Display the top images list (by date)
' IN : iTop (int) : number of results wanted
' OUT : -
Sub DisplayTopImages(iTop)
Dim oCn, oRs, rSQL, iLine, iLoop

Set oCn = DBConnexion(DB_MAIN)

If iTop = "" Then
iTop = 0
end if
rSQL = "SELECT iID, iTitle, iDate, iHits FROM images WHERE iValid=1 ORDER BY iDate DESC, iTitle"

Set oRs = DBRecordSet(oCn, rSQL)
If Not oRs.EOF Then
CreateTopTable "TopImages", GetTranslation("LANG_TOP") & " " & iTop & " - " & GetTranslation("LANG_IMAGES")

Response.Write GLOBAL_SITE_SUBTABLE & vbCRLF
Response.Write " <tr class=""tablelinemain"">" & vbCRLF
Response.Write " <td>" & GetTranslation("LANG_TITLE") & "</td>" & vbCRLF
Response.Write " <td width=""80"" align=""center"">" & GetTranslation("LANG_HITS") & "</td>" & vbCRLF
Response.Write " <td width=""80"" align=""center"">" & GetTranslation("LANG_DATE") & "</td>" & vbCRLF
Response.Write " </td>" & vbCRLF
Response.Write " </tr>" & vbCRLF

iLine = 1
iLoop = 0
While Not oRs.EOF And iLoop < iTop
Response.Write " <tr class=""tableline" & iLine & """>" & vbCRLF
Response.Write " <td><a href=""" & sURLPage & "?id=" & oRs("iID") & """>" & Server.HTMLEncode(oRs("iTitle")) & "</a></td>" & vbCRLF
Response.Write " <td align=""center"">" & oRs("iHits") & "</td>" & vbCRLF
Response.Write " <td align=""center"">" & GetDateDDMMYYYY(StringToDate(oRs("iDate"))) & "</td>" & vbCRLF
Response.Write " </td>" & vbCRLF
Response.Write " </tr>" & vbCRLF

iLine = 1 + ((iLine-1) XOR 1)
oRs.MoveNext
iLoop = iLoop + 1
WEnd

Response.Write "</table>" & vbCRLF
CreateBottomTable ""
Else
CreateTable "ImagesEmpty", "", GetTranslation("LANG_EMPTY_SECTION"), ""
End If

oRs.Close
Set oRs = Nothing
oCn.Close
Set oCn = Nothing
End Sub

' Display information for a specific images
' IN : iID (int) : image's id (table images, field iID)
' OUT : -
Sub DisplayImage(iID, iPage)
Dim oCn, oRs, rSQL
Dim iCat, iPre, iPost

iCat = Request.QueryString("cat")
If IsNumeric(iCat) and iCat <> "" Then
iCat = CInt(iCat)
Else
iCat = 0
End If

Set oCn = DBConnexion(DB_MAIN)

If iCat <> 0 Then
rSQL = "SELECT iID FROM images WHERE iValid=1 AND iCategory=" & iCat & " ORDER BY iDate"
Else
rSQL = "SELECT iID FROM images WHERE iValid=1 ORDER BY iDate"
End If
Set oRs = DBRecordSet(oCn, rSQL)
iPre = -1
iPost = -1
While Not oRs.EOF
If CLng(oRs(0)) = CLng(iID )Then
oRs.MoveNext
if Not oRs.EOF Then
iPost = oRs(0)
End if
Else
if iPost = -1 then
iPre = oRs(0)
End if
oRs.MoveNext
End If
WEnd
rSQL = "SELECT iHits, iTitle, iSourceNormal, iDescription FROM images WHERE iValid=1 AND iID=" & NormNumber(iID)

Set oRs = DBRecordSet(oCn, rSQL)
If Not oRs.EOF Then
rSQL = "UPDATE images SET iHits=" & oRs("iHits")+1 & " WHERE iID=" & NormNumber(iID)
DBExecute oCn, rSQL

CreateTopTable "Image", Server.HTMLEncode(oRs("iTitle"))
Response.Write GLOBAL_SITE_SUBTABLE & vbCRLF
if bHiddenImagesDir Then
Response.Write " <tr class=""tableline1""><td align=""center""><a href=""Java_Script:history.back(1)""><img src=""" & GLOBAL_SITE_PATH & "hiddenimage.asp?img=" & iID & """ border=""0""></a></td></tr>" & vbCRLF
else
Response.Write " <tr class=""tableline1""><td align=""center""><a href=""Java_Script:history.back(1)""><img src=""" & Server.HTMLEncode(oRs("iSourceNormal")) & """ border=""0""></a></td></tr>" & vbCRLF
end if
Response.Write " <tr class=""tableline2""><td align=""center"">" & CodeMessage(oRs("iDescription"), False) & "</td></tr>" & vbCRLF
Response.Write " <tr class=""tableline1""><td align=""center"">" & GetTranslation("LANG_HITS") & " : " & oRs("iHits")+1 & "</td></tr>" & vbCRLF
Response.Write " <tr class=""tableline2""><td align=""center"">" & iif(iPre <> -1,"<a href=""" & sURLPage & "?cat=" & iCat & "&id=" & iPre & """>&laquo;</a>", "&nbsp;") & "&nbsp;&nbsp;&nbsp;&nbsp;" & iif(iPost <> -1,"<a href=""" & sURLPage & "?cat=" & iCat & "&id=" & iPost & """>&raquo;</a>", "&nbsp;") & "</td></tr>" & vbCRLF
Response.Write " <tr class=""tablelinemain""><td align=""center""><a href=""Java_Script:history.back(1)"">" & GetTranslation("LANG_BACK") & "</a></td></tr>" & vbCRLF
Response.Write "</table>" & vbCRLF
CreateBottomTable ""
End If

oRs.Close
Set oRs = Nothing
oCn.Close
Set oCn = Nothing
End Sub

' Display all images for one category
' IN : iCategory (int) : image's category (table images, field iCategory)
' : iPage (int) : current page
' OUT : -
Sub DisplayImagesSearch(iCategory, iPage)
Dim oCn, oRs, oRs2, rSQL, iLine, iNum, sTitleCat
Dim iNbImages, iNbPages, iLoop, X, sSmall

iNum = 0

Set oCn = DBConnexion(DB_MAIN)

If iCategory <> "" and iCategory <> 0 Then
rSQL = "SELECT cTitle FROM categories WHERE cID=" & iCategory
Set oRs = DBRecordSet(oCn, rSQL)
If Not oRs.EOF Then
sTitleCat = " - " & Server.HTMLEncode(oRs(0))
End If
rSQL = "SELECT Count(iID) FROM images WHERE iValid=1 AND iCategory=" & iCategory
Set oRs = DBRecordSet(oCn, rSQL)
iNbImages = oRs(0)

rSQL = "SELECT iID FROM images WHERE iValid=1 AND iCategory=" & iCategory & " ORDER BY iDate, iTitle"
Set oRs = DBRecordSet(oCn, rSQL)
iLoop = 0
While Not oRs.EOF And iLoop < ((iPage-1)*GLOBAL_IMAGES_PAGE)
oRs.MoveNext
iLoop = iLoop + 1
WEnd

If Not oRs.EOF Then
CreateTopTable "ImagesByCategory", GetTranslation("LANG_IMAGES") & sTitleCat

Response.Write GLOBAL_SITE_SUBTABLE & vbCRLF
iLine = 1
iLoop = 0
While Not oRs.EOF And iLoop < GLOBAL_IMAGES_PAGE
rSQL = "SELECT iTitle, iSourceSmall, iSourceNormal, iHits FROM images WHERE iID=" & oRs(0)
Set oRs2 = DBRecordSet(oCn, rSQL)
If iNum Mod 3 = 0 Then
Response.Write " <tr class=""tableline" & iLine & """>" & vbCRLF
End If
Response.Write " <td align=""center"" width=""33%"">" & vbCRLF
Response.Write " <a href=""" & sURLPage & "?id=" & oRs(0) & "&cat=" & iCategory & "&page=" & iPage & """>"
'if there is no thumb, stretch the normal
sSmall = "" & oRs2("iSourceSmall")
if sSmall = "" Or sSmall = "http://" or bForceThumbGeneration then
Response.Write getResizedImageTag("" & oRs2("iSourceNormal"), "", "" & oRs(0))
else
if bHiddenImagesDir Then
Response.Write "<img src=""" & GLOBAL_SITE_PATH & "hiddenthumb.asp?img=" & oRs(0) & """ border=""0"">"
else
Response.Write "<img src=""" & Server.HTMLEncode(sSmall) & """ border=""0"">"
end if
end if
Response.Write "<br>" & Server.HTMLEncode(oRs2("iTitle")) & "</a>"
Response.Write "<br><span class=""small"">" & oRs2("iHits") & " " & GetTranslation("LANG_HITS") & "</span>"
Response.Write "</td>" & vbCRLF
If iNum Mod 3 = 2 Then
Response.Write " </tr>" & vbCRLF
iLine = 1 + ((iLine-1) XOR 1)
End If
iNum = iNum + 1
iLoop = iLoop + 1

oRs2.Close
Set oRs2 = Nothing

oRs.MoveNext
WEnd
Select Case (iNum Mod 3)
Case 1
Response.Write "<td width=""33%"">&nbsp</td><td width=""33%"">&nbsp</td></tr>" & vbCRLF
Case 2
Response.Write "<td width=""33%"">&nbsp</td></tr>" & vbCRLF
End Select

' pages managing
iNbPages = iNbImagesGLOBAL_IMAGES_PAGE
If iNbImages mod GLOBAL_IMAGES_PAGE Then
iNbPages = iNbPages + 1
End If
If iNbPages > 1 Then
Response.Write " <tr class=""tablelinemain"">" & vbCRLF
Response.Write " <td align=""center"" colspan=""3"">" & vbCRLF
If iPage <> 1 Then
Response.Write " &nbsp;<a href=""" & sURLPage & "?cat=" & iCategory & "&page=" & iPage-1 & """>&lt;&lt;</a>" & vbCRLF
End If
For X = 1 To iNbPages
If X <> iPage Then
Response.Write " &nbsp;<a href=""" & sURLPage & "?cat=" & iCategory & "&page=" & X & """>" & X & "</a>" & vbCRLF
Else
Response.Write "&nbsp;" & X & "" & vbCRLF
End If
Next
If iPage <> iNbPages Then
Response.Write " &nbsp;<a href=""" & sURLPage & "?cat=" & iCategory & "&page=" & iPage+1 & """>&gt;&gt;</a>" & vbCRLF
End If
Response.Write " </td>" & vbCRLF
Response.Write " </tr>" & vbCRLF
End If

Response.Write " <tr class=""tablelinemain"">" & vbCRLF
Response.Write " <td align=""center"" colspan=""3"">" & GetTranslation("LANG_IMAGES") & " : " & iNum & "/" & iNbImages & "</td>" & vbCRLF
Response.Write " </tr>" & vbCRLF
Response.Write "</table>" & vbCRLF

CreateBottomTable ""
End If
End If

oRs.Close
Set oRs = Nothing
oCn.Close
Set oCn = Nothing
End Sub

' Display all images for one folder
' IN : iCategory (int) : image's category (table images, field iCategory)
' : iPage (int) : current page
' OUT : -
Sub DisplayImagesFolder(UplPath, iPage)
Dim oRs, iLine, iNum, sTitleCat
Dim iNbImages, iNbPages, iLoop, X, sSmall
Dim lngWidth, lngHeight, lngDepth, strImageType
Dim fso, fld, fil, UpPath

iNum = 0
UpPath = GLOBAL_SITE_PATH & UplPath & "/"
Set fso = Server.CreateObject("Scripting.FileSystemObject")
if fso.FolderExists(Server.MapPath(UpPath)) Then
Set fld = fso.GetFolder(Server.MapPath(UpPath))

set oRs = Server.CreateObject("ADODB.Recordset")
oRs.Fields.Append "nome", 200, 255 ' adVarChar
oRs.Fields.Append "dimensione", 3, 4 ' smallint
oRs.Fields.Append "misure", 200, 255 ' adVarChar
oRs.Fields.Append "data", 7 ' Date
oRs.Open
iLoop = 0
For Each fil In fld.files
strImageType = lcase(fso.GetExtensionName(fil.path))
If instr(imgExtensions, "*." & strImageType) > 0 Then
If gfxSpex(fil.path, lngWidth, lngHeight, lngDepth, strImageType) Then
oRs.AddNew
oRs("nome") = fil.name
oRs("dimensione") = fil.size
oRs("misure") = lngWidth & "X" & lngHeight & " - " & lngDepth & " colors - " & fil.size & " bytes"
oRs("data") = fil.DateLastModified
iLoop = iLoop + 1
End If
End If
Next

Set fld = nothing
iNbImages = iLoop
oRs.Sort = "nome ASC"
iLoop = 0
While Not oRs.EOF And iLoop < ((iPage-1)*GLOBAL_IMAGES_PAGE)

oRs.movenext
iLoop = iLoop + 1
wend

If Not oRs.EOF Then
Response.Write "<_Script language=""Java_Script"" type=""text/Java_Script"">" & vbCRLF
Response.Write " function openNormalPicture(sMyPicture)" & vbCRLF
Response.Write " {" & vbCRLF
Response.Write " if (sMyPicture != '')"
Response.Write " {" & vbCRLF
Response.Write " window.open('" & GLOBAL_SITE_PATH & GLOBAL_SITE_VIEW_IMAGE_PAGE & "?img=' + sMyPicture, 'Picture', 'width=500,height=100,menubar=no,resizable=yes');" & vbCRLF
Response.Write " }" & vbCRLF
Response.Write " }" & vbCRLF
Response.Write "</_Script>" & vbCRLF

CreateTopTable "ImagesByFolder", UplPath & " - " & GetTranslation("LANG_IMAGES")

Response.Write GLOBAL_SITE_SUBTABLE & vbCRLF
iLine = 1
iLoop = 0
While Not oRs.EOF And iLoop < GLOBAL_IMAGES_PAGE
If iNum Mod 3 = 0 Then
Response.Write " <tr class=""tableline" & iLine & """>" & vbCRLF
End If
Response.Write " <td align=""center"" width=""33%"">" & vbCRLF
Response.Write " <a href=""Java_Script:openNormalPicture('" & GLOBAL_SITE_URL & UpPath & oRs("nome") & "')"">"
'if there is no thumb, stretch the normal
Response.Write getResizedImageTag(GLOBAL_SITE_URL & UpPath & oRs("nome"), "", "")

Response.Write "<br>" & Server.HTMLEncode(oRs("nome")) & "</a>"
Response.Write "<br><span class=""small"">" & oRs("misure") & "</span>"
Response.Write "</td>" & vbCRLF
If iNum Mod 3 = 2 Then
Response.Write " </tr>" & vbCRLF
iLine = 1 + ((iLine-1) XOR 1)
End If
iNum = iNum + 1
iLoop = iLoop + 1
oRs.MoveNext
WEnd
oRs.close
set oRs = nothing
Select Case (iNum Mod 3)
Case 1
Response.Write "<td width=""33%"">&nbsp</td><td width=""33%"">&nbsp</td></tr>" & vbCRLF
Case 2
Response.Write "<td width=""33%"">&nbsp</td></tr>" & vbCRLF
End Select

' pages managing
iNbPages = iNbImagesGLOBAL_IMAGES_PAGE
If iNbImages mod GLOBAL_IMAGES_PAGE Then
iNbPages = iNbPages + 1
End If
If iNbPages > 1 Then
Response.Write " <tr class=""tablelinemain"">" & vbCRLF
Response.Write " <td align=""center"" colspan=""3"">" & vbCRLF
If iPage <> 1 Then
Response.Write " &nbsp;<a href=""" & sURLPage & "?fld=" & UplPath & "&page=" & iPage-1 & """>&lt;&lt;</a>" & vbCRLF
End If
For X = 1 To iNbPages
If X <> iPage Then
Response.Write " &nbsp;<a href=""" & sURLPage & "?fld=" & UplPath & "&page=" & X & """>" & X & "</a>" & vbCRLF
Else
Response.Write "&nbsp;" & X & "" & vbCRLF
End If
Next
If iPage <> iNbPages Then
Response.Write " &nbsp;<a href=""" & sURLPage & "?fld=" & UplPath & "&page=" & iPage+1 & """>&gt;&gt;</a>" & vbCRLF
End If
Response.Write " </td>" & vbCRLF
Response.Write " </tr>" & vbCRLF
End If

Response.Write " <tr class=""tablelinemain"">" & vbCRLF
Response.Write " <td align=""center"" colspan=""3"">" & GetTranslation("LANG_IMAGES") & " : " & iNum & "/" & iNbImages & "</td>" & vbCRLF
Response.Write " </tr>" & vbCRLF
Response.Write "</table>" & vbCRLF

CreateBottomTable ""
End If
End If
End Sub

' Display a navigation bar for images
' IN : -
' OUT : -
Sub DisplayFolderNavigation(UpPath)
Dim iLine, iNum, fld, fol, fso, parent

iNum = 0
if instrrev(UpPath, "/") > 0 then
CreateTopTable "ImageFolder", GetTranslation("LANG_BACK")
Response.Write "<a href=""" & sURLPage & "?fld=" & left(UpPath,instrrev(UpPath, "/")-1) & """>" & GetTranslation("LANG_BACK") & "</a>" & vbCRLF
CreateBottomTable ""
end if

iLine = 1
iNum = 0
Set fso = Server.CreateObject("Scripting.FileSystemObject")
if fso.FolderExists(Server.MapPath(UpPath)) Then
Set fld = fso.GetFolder(Server.MapPath(UpPath))
For Each fol In fld.Subfolders
'skip folders beginning with "_"
if left(fol.name,1) <> "_" then
'open table on first folder
if iNum = 0 then
CreateTopTable "SearchImagesFolders", UpPath & " - " & GetTranslation("LANG_SUB_CATEGORIES")
Response.Write GLOBAL_SITE_SUBTABLE & vbCRLF
end if
If iNum mod 2 = 0 Then
Response.Write " <tr class=""tableline" & iLine & """>" & vbCRLF
end if
Response.Write " <td width=""50%""><a href=""" & sURLPage & "?fld=" & UpPath & "/" & fol.name & """>" & fol.name & "</td>" & vbCRLF
If iNum mod 2 = 1 Then
Response.Write " </tr>" & vbCRLF
iLine = 1 + ((iLine-1) XOR 1)
End If

iNum = iNum + 1
end if
Next
Set fol = nothing
if iNum > 0 then
If iNum mod 2 = 1 Then
Response.Write " <td>&nbsp;</td>" & vbCRLF
Response.Write " </tr>" & vbCRLF
End If
Response.Write "</table>" & vbCRLF
CreateBottomTable ""
end if
end if
End Sub

' Display a navigation bar for images
' IN : iCategoryParent (int) : image's parent category (table categories, field cParent)
' OUT : -
Sub DisplayImagesNavigation(iCategoryParent)
Dim oCn, oRs, oRs2, rSQL, iLine, iNum, sItems

Set oCn = DBConnexion(DB_MAIN)

If iCategoryParent = "" Then
iCategoryParent = 0
end if

If iCategoryParent <> 0 Then
rSQL = "SELECT cId, cParent, cTitle, cDescription, cImage FROM categories WHERE cID=" & iCategoryParent
Set oRs = DBRecordSet(oCn, rSQL)

If Not oRs.EOF Then
CreateTopTable "ImageCategory", CodeMessage(oRs("cTitle"), True)
If oRs("cImage") <> "" Then
Response.Write "<img src=""" & Server.HTMLEncode(oRs("cImage") & "") & """ border=""0"" align=""left"">"
End If
Response.Write CodeMessage(oRs("cDescription"), False)
Response.Write "<br>&nbsp;<br><a href=""" & sURLPage & "?cat=" & oRs("cParent") & """>" & GetTranslation("LANG_BACK") & "</a>" & vbCRLF
CreateBottomTable ""
End If
oRs.Close
Set oRs = Nothing
End If

rSQL = "SELECT cId, cTitle, cImage FROM categories WHERE cType=" & CATEGORY_TYPE_IMAGES & " and cParent=" & iCategoryParent & " ORDER BY cTitle"
Set oRs = DBRecordSet(oCn, rSQL)

If Not oRs.EOF Then
If iCategoryParent = 0 Then
CreateTopTable "SearchImagesCategories", GetTranslation("LANG_IMAGES") & " - " & GetTranslation("LANG_CATEGORIES")
Else
CreateTopTable "SearchImagesCategories", GetTranslation("LANG_IMAGES") & " - " & GetTranslation("LANG_SUB_CATEGORIES")
End If
Response.Write GLOBAL_SITE_SUBTABLE & vbCRLF
iLine = 1
iNum = 0

While Not oRs.EOF
If iNum mod 2 = 0 Then
Response.Write " <tr class=""tableline" & iLine & """>" & vbCRLF
end if
rSQL = "SELECT Count(iID) FROM images WHERE iValid=1 AND iCategory=" & oRs("cID")
Set oRs2 = DBRecordSet(oCn, rSQL)
sItems = iif(oRs2(0)>0,"(" & oRs2(0) & ")","")

If oRs("cImage") <> "" Then
Response.Write " <td width=""50%"" align=""center""><a href=""" & sURLPage & "?cat=" & oRs("cID") & """><img src=""" & Server.HTMLEncode(oRs("cImage")) & """ border=""0"" alt=""" & oRs("cTitle") & """><br>" & Server.HTMLEncode(oRs("cTitle")) & " " & sItems & "</td>" & vbCRLF
Else
Response.Write " <td width=""50%""><a href=""" & sURLPage & "?cat=" & oRs("cID") & """>" & Server.HTMLEncode(oRs("cTitle")) & " " & sItems & "</td>" & vbCRLF
End If

oRs2.Close
Set oRs2 = Nothing

If iNum mod 2 = 1 Then
Response.Write " </tr>" & vbCRLF
iLine = 1 + ((iLine-1) XOR 1)
End If

iNum = iNum + 1
oRs.MoveNext
WEnd
If iNum mod 2 = 1 Then
Response.Write " <td>&nbsp;</td>" & vbCRLF
Response.Write " </tr>" & vbCRLF
End If
Response.Write "</table>" & vbCRLF
CreateBottomTable ""
End If

oRs.Close
Set oRs = Nothing
oCn.Close
Set oCn = Nothing
End Sub

' Display a line to let users post their images
' IN : iCat : download category
' OUT : -
Sub DisplayAddImages(iCat)
If sPseudo <> "" Then
CreateTable "AddMemberImages", "", "<a href=""" & GLOBAL_SITE_IMAGES_PAGE & "?do=new&cat=" & iCat & """>" & GetTranslation("LANG_ADD") & " - " & GetTranslation("LANG_IMAGES") & "</a>", ""
End If
End Sub

' Display edit member's image's form
' IN : iCat (int) : image's category (table images, field iCategory)
' OUT : -
Sub EditMemberImage(iCat)
Dim oCn, oRs, rSQL, oRs2

If sPseudo <> "" Then
Set oCn = DBConnexion(DB_MAIN)

rSQL = "SELECT cID, cTitle FROM categories WHERE cType=" & CATEGORY_TYPE_IMAGES
Set oRs = DBRecordSet(oCn, rSQL)

If Not oRs.EOF Then
Response.Write "<_Script language=""Java_Script"" type=""text/Java_Script"">" & vbCRLF
Response.Write " function confirmDo()" & vbCRLF
Response.Write " {" & vbCRLF
Response.Write " var ok;" & vbCRLF
Response.Write " ok = true;" & vbCRLF
Response.Write " if (!confirm('" & JSEncrypt(GetTranslation("LANG_CONFIRM")) & "')) ok = false;" & vbCRLF
'//ZALABARD HtmlArea 3.0
Response.Write " " & AddHtmlArea_GetHTML("edition", "iDescription") & vbCRLF
'// End Zalabard
Response.Write " if (document.edition.iTitle.value == '')" & vbCRLF
Response.Write " {" & vbCRLF
Response.Write " ok = false;" & vbCRLF
Response.Write " alert('" & GetTranslation("LANG_MUST_FILL") & " " & GetTranslation("LANG_TITLE") & "');" & vbCRLF
Response.Write " }" & vbCRLF
Response.Write " if (ok)" & vbCRLF
Response.Write " {" & vbCRLF
Response.Write " document.edition.submit();" & vbCRLF
Response.Write " }" & vbCRLF
Response.Write " }" & vbCRLF
Response.Write " function openSmallPicture()" & vbCRLF
Response.Write " {" & vbCRLF
Response.Write " var sMyPicture = document.edition.iSourceSmall.value;" & vbCRLF
Response.Write " if (sMyPicture != '')"
Response.Write " {" & vbCRLF
Response.Write " window.open('" & GLOBAL_SITE_PATH & GLOBAL_SITE_VIEW_IMAGE_PAGE & "?img=' + sMyPicture, 'Picture', 'width=500,height=100,menubar=no,resizable=yes');" & vbCRLF
Response.Write " }" & vbCRLF
Response.Write " }" & vbCRLF
Response.Write " function openNormalPicture()" & vbCRLF
Response.Write " {" & vbCRLF
Response.Write " var sMyPicture = document.edition.iSourceNormal.value;" & vbCRLF
Response.Write " if (sMyPicture != '')"
Response.Write " {" & vbCRLF
Response.Write " window.open('" & GLOBAL_SITE_PATH & GLOBAL_SITE_VIEW_IMAGE_PAGE & "?img=' + sMyPicture, 'Picture', 'width=500,height=100,menubar=no,resizable=yes');" & vbCRLF
Response.Write " }" & vbCRLF
Response.Write " }" & vbCRLF

If IsAuthorizedBin(ROLE_UPLOAD) Then
Response.Write " function uploadPicture(elem)" & vbCRLF
Response.Write " {" & vbCRLF
Response.Write " if (elem != '')"
Response.Write " {" & vbCRLF
Response.Write " window.open('" & GLOBAL_SITE_PATH & "uploadimg.asp?item=' + elem, 'Picture', 'width=500,height=100,menubar=no,resizable=no');" & vbCRLF
Response.Write " }" & vbCRLF
Response.Write " }" & vbCRLF
End if

Response.Write "</_Script>" & vbCRLF
CreateTopTable "Edit", GetTranslation("LANG_ADD") & " - " & GetTranslation("LANG_IMAGE")
Response.Write GLOBAL_SITE_SUBTABLE & vbCRLF
Response.Write "<_form name=""edition"" method=""post"" action=""" & sUrlPage & "?cat=" & iCat & """>" & vbCRLF
Response.Write "<input type=""hidden"" name=""Do"" value=""add"">" & vbCRLF
Response.Write "<input type=""hidden"" name=""iID"" value=""0"">" & vbCRLF
Response.Write " <tr class=""tablelinemain"">" & vbCRLF
Response.Write " <td width=""150"">" & GetTranslation("LANG_FIELD") & "</td>" & vbCRLF
Response.Write " <td>" & GetTranslation("LANG_VALUE") & "</td>" & vbCRLF
Response.Write " </tr>" & vbCRLF
Response.Write " <tr class=""tableline1"">" & vbCRLF
Response.Write " <td>" & GetTranslation("LANG_TITLE") & "</td>" & vbCRLF
Response.Write " <td><input name=""iTitle"" value="""" maxlength=""50"" size=""50"" class=""cell""></td>" & vbCRLF
Response.Write " </tr>" & vbCRLF
Response.Write " <tr class=""tableline2"">" & vbCRLF
Response.Write " <td>" & GetTranslation("LANG_DATE") & "</td>" & vbCRLF
Response.Write " <td>" & GetDateDDMMYYYY(Now()) & "<input type=""hidden"" name=""iDate"" value=""" & DateTimeToString(Now()) & """></td>" & vbCRLF
Response.Write " </tr>" & vbCRLF
Response.Write " <tr class=""tableline1"">" & vbCRLF
Response.Write " <td>" & GetTranslation("LANG_DESCRIPTION") & "</td>" & vbCRLF
Response.Write " <td>" & vbCRLF
AddHTMLAREA "iDescription", "", "400px", 60, 3, "cell", ""
Response.Write " </td></tr>" & vbCRLF
Response.Write " <tr class=""tableline2"">" & vbCRLF
Response.Write " <td>" & GetTranslation("LANG_URL") & " " & GetTranslation("LANG_THUMBNAIL") & "</td>" & vbCRLF
Response.Write " <td>" & vbCRLF
Response.Write " <input name=""iSourceSmall"" value=""http://"" maxlength=""250"" size=""50"" class=""cell"">" & vbCRLF
Response.Write " <a href=""Java_Script:openSmallPicture()""><img src=""" & GLOBAL_SITE_IMAGES_PATH & "view.gif"" border=""0""></a>" & vbCRLF
If IsAuthorizedBin(ROLE_UPLOAD) and bAllowUploadImages then
Response.Write " <a href=""Java_Script:uploadPicture('document.edition.iSourceSmall')""><img src=""" & GLOBAL_SITE_IMAGES_PATH & "edit.gif"" border=""0""></a>" & vbCRLF
end if
Response.Write " </td>" & vbCRLF
Response.Write " </tr>" & vbCRLF
Response.Write " <tr class=""tableline1"">" & vbCRLF
Response.Write " <td>" & GetTranslation("LANG_URL") & " " & GetTranslation("LANG_IMAGE") & "</td>" & vbCRLF
Response.Write " <td>" & vbCRLF
Response.Write " <input name=""iSourceNormal"" value=""http://"" maxlength=""250"" size=""50"" class=""cell"">" & vbCRLF
Response.Write " <a href=""Java_Script:openNormalPicture()""><img src=""" & GLOBAL_SITE_IMAGES_PATH & "view.gif"" border=""0""></a>" & vbCRLF
If IsAuthorizedBin(ROLE_UPLOAD) and bAllowUploadImages then
Response.Write " <a href=""Java_Script:uploadPicture('document.edition.iSourceNormal')""><img src=""" & GLOBAL_SITE_IMAGES_PATH & "edit.gif"" border=""0""></a>" & vbCRLF
end if
Response.Write " </td>" & vbCRLF
Response.Write " </tr>" & vbCRLF
Response.Write " <tr class=""tableline2"">" & vbCRLF
Response.Write " <td>" & GetTranslation("LANG_CATEGORY") & "</td>" & vbCRLF
Response.Write " <td>" & vbCRLF
Response.Write " <select name=""iCategory"" class=""cell"">" & vbCRLF

While Not oRs.EOF
Response.Write " <option value=""" & oRs("cID") & """"
If oRs("cID") = iCat Then
Response.Write " selected"
end if
Response.Write ">" & Server.HTMLEncode(oRs("cTitle")) & "</option>" & vbCRLF
oRs.MoveNext
WEnd

Response.Write " </select>" & vbCRLF
Response.Write " <tr class=""tableline1"">" & vbCRLF
Response.Write " <td>" & GetTranslation("LANG_VERSION") & "</td>" & vbCRLF
Response.Write " <td>" & vbCRLF
Response.Write " <select name=""iVersion"" class=""cell"">" & vbCRLF

rSQL = "SELECT vID, vCode FROM versions ORDER BY vCode"
Set oRs2 = DBRecordSet(oCn, rSQL)

While Not oRs2.EOF
Response.Write " <option value=""" & oRs2("vID") & """"
If oRs2("vCode") = sXMLVersion Then
Response.Write " selected"
end if
Response.Write ">" & oRs2("vCode") & "</option>" & vbCRLF
oRs2.MoveNext
WEnd
oRs2.Close
Set oRs2 = Nothing

Response.Write " </select>" & vbCRLF
Response.Write " </td>" & vbCRLF
Response.Write " </tr>" & vbCRLF
Response.Write " <tr class=""tablelinemain"">" & vbCRLF
Response.Write " <td colspan=""2""><input type=""button"" value=""" & GetTranslation("LANG_SUBMIT") & """ class=""button"" onClick=""confirmDo();"" id=1 name=1></td>" & vbCRLF
Response.Write " </tr>" & vbCRLF
Response.Write "</_form>" & vbCRLF
Response.Write "</table>" & vbCRLF
CreateBottomTable ""
End If

oRs.Close
Set oRs = Nothing
oCn.Close
Set oCn = Nothing
End If
End Sub

' Add member's image (insert query)
' IN : sTitle (string) : image's title (table images, field iTitle)
' : sDate (string) : image add date (table images, field iDate)
' : sDescription (string) : image's description (table images, field iDescription)
' : sSourceSmall (string) : image's source for thumbnail (table images, field iSourceSmal)
' : sSourceNormal (string) : image's source (table images, field iSourceNormal)
' : iHits (int) : number of times where image has been viewed (table images, field iHits)
' : iCategory (int) : image's category (table images, field iCategory)
' : iVersion (int) : image's version language (table images, field iVersion)
' OUT : (boolean) : True if added
Function AddMemberImage(sTitle, sDate, sDescription, sSourceSmall, sSourceNormal, iHits, iCategory, iVersion)
Dim oCn, rSQL

Set oCn = DBConnexion(DB_MAIN)
rSQL = "INSERT INTO images (iTitle, iDate, iDescription, iSourceSmall, iSourceNormal, iHits, iCategory, iVersion, iValid) VALUES ('" & SQLEncrypt(sTitle) & "', '" & sDate & "', '" & SQLEncrypt(sDescription) & "', '" & SQLEncrypt(sSourceSmall) & "', '" & SQLEncrypt(sSourceNormal) & "', 0, " & iCategory & ", " & iVersion & ", 0)"
DBExecute oCn, rSQL

oCn.Close
Set oCn = Nothing

AddMemberImage = True
End Function

' Process actions
' IN : -
' OUT : -
Sub DoImagesPage()
If Request.Form("do") = "add" and Request.Form("iTitle") <> "" Then
If AddMemberImage(Request.Form("iTitle"), Request.Form("iDate"), Request.Form("iDescription"), Request.Form("iSourceSmall"), Request.Form("iSourceNormal"), 0, Request.Form("iCategory"), Request.Form("iVersion")) Then
sInfoPage = GetTranslation("LANG_IMAGES") & " - " & GetTranslation("LANG_ADD_SUCCESS")
Else
sInfoPage = GetTranslation("LANG_IMAGES") & " - " & GetTranslation("LANG_ADD_ERROR")
End If
End If
End Sub

' Display page
' IN : -
' OUT : -
Sub DisplayImagesPage()
Dim iCat, iPage, iImage
Dim sFolder

iCat = Request.QueryString("cat")
If IsNumeric(iCat) and iCat <> "" Then
iCat = CInt(iCat)
Else
iCat = 0
End If

iPage = Request.QueryString("page")
If IsNumeric(iPage) and iPage <> "" Then
iPage = CInt(iPage)
Else
iPage = 1
End If

iImage = Request.QueryString("id")

sFolder = Request.QueryString("fld")
if instr(sFolder, "..") > 0 then
sFolder = ""
end if
If sFolder <> "" Then
DisplayFolderNavigation sFolder
DisplayImagesFolder sFolder, iPage
Else
DisplayImagesNavigation(iCat)

If iImage <> "" Then
DisplayImage(iImage), iPage
ElseIf iCat <> 0 Then
If Request.QueryString("do") = "new" Then
EditMemberImage(iCat)
Else
DisplayAddImages(iCat)
DisplayImagesSearch iCat, iPage
End If
Else
DisplayTopImages GLOBAL_IMAGES_TOP
End If
End If
End Sub
%>



grazie mille
djveleno

Amministratore

Esperto
Esperto
1025 Discussioni



Profilo - djveleno
20 marzo 2006 alle 19:52:10 Profilo - djvelenoInvia un messaggio privato Rispondi quotando
Dipende da cosa deve visualizzare la pagina societa-inc.asp, deve visualizzare immagini? Penso di sì, ma, perchè riscrivere un codice che c'è già? Perchè non organizzare la galleria immagini per argomento e al massimo scrivere qualche riga codice che richiami gli argomenti trattati? O forse non ho capito io cosa intendevi.
Ciauzz Dj
---------------
A lavare la testa ai somari, ci si rimette l'acqua e il sapone!

http://aspnuke208.somee.com/Default.asp

Log in

Login
Password
Memorizza i tuoi dati:

Cerca

 

Sostieni AspNuke

Un piccolo gesto per aiutarci a mantenere AspNuke.it online

Promo

MusicWebItalia.it
Video Testi Traduzioni Spot Colonne sonore Accordi e Spartiti gratis.

Visitatori

Visitatori Correnti : 170
Membri : 0 offline Anna

Iscritti

 Utenti: 18940
Ultimo iscritto : glauco
Lista iscritti
Messaggi privati: 3373 Commenti: 2210 Immagini: 39 Downloads: 144 Articoli: 49 Pagine: 101 Siti web: 558 Notizie: 180 Sondaggi: 11 Preferiti: 5684721 Post sui forum: 51195 Libro degli ospiti: 4 Eventi: 7

Versioni

Temi