02. april 2003 - 21:47Der er
1 kommentar og 1 løsning
Galleri
Hey alle
Er der nogle der kender et godt script til et slags galleri, det er ikke så meget fordi at jeg skal bruge koden, eller noget, for det vil jeg helts selv lave, men jeg ved ikke hvordan jeg skal bygge det op.
Det skal være sådan at alle medlemmere i en klub skal kunne opload billeder og så skal man kunne se dem.. :)
Det kunne være fedt med et link til et system jeg kan downloade.
Function AscAt(s, n) AscAt = Asc(Mid(s, n, 1)) End Function
Function HexAt(s, n) Dim lsH lsH = Hex(AscAt(s, n)) If Len(lsH) <> 2 Then lsH = "0" & lsH HexAt = lsH End Function
Function isJPG(filen) If inStr(uCase(filen), ".JPG") <> 0 Or inStr(uCase(filen), ".JPEG") <> 0 Then isJPG = true Else isJPG = false End If End Function
Function isPNG(filen) If inStr(uCase(filen), ".PNG") <> 0 Then isPNG = true Else isPNG = false End If End Function
Function isGIF(filen) If inStr(uCase(filen), ".GIF") <> 0 Then isGIF = true Else isGIF = false End If End Function
Function ReadImg(filen) If isGIF(filen) Then ReadImg = ReadGIF(filen) Else If isJPG(filen) Then ReadImg = ReadJPG(filen) Else If isPNG(filen) Then ReadImg = ReadPNG(filen) End If End If End If End Function
Sub Rep(s) Response.Write s & "<BR>" End Sub
Function ReadJPG(filen) Dim fso, ts, s, HW, ns, n, ok HW = Array("","") Set fso = CreateObject("Scripting.FileSystemObject") Set ts = fso.OpenTextFile(Server.MapPath(filen), 1) ts.Skip(2) ns = ts.Read(2) Do While Not (ns = "ÿÀ" Or ns = "ÿÂ") ns = ts.Read(2) n = HexToDec(HexAt(ns,1) & HexAt(ns,2)) n = n - 2 ts.Skip(n) ns = ts.Read(2) Loop ts.Skip(3) s = ts.Read(4) HW(0) = HexToDec(HexAt(s,3) & HexAt(s,4)) HW(1) = HexToDec(HexAt(s,1) & HexAt(s,2)) ts.Close Set ts = Nothing ReadJPG = HW End Function
Function ReadPNG(filen) Dim fso, ts, s, HW, nbytes HW = Array("","") Set fso = CreateObject("Scripting.FileSystemObject") Set ts = fso.OpenTextFile(Server.MapPath(filen), 1) s = Right(ts.Read(24), 8) HW(0) = HexToDec(HexAt(s,3) & HexAt(s,4)) HW(1) = HexToDec(HexAt(s,7) & HexAt(s,8)) ts.Close ReadPNG = HW End Function
Function ReadGIF(filen) Dim fso, ts, s, HW, nbytes HW = Array("","") Set fso = CreateObject("Scripting.FileSystemObject") Set ts = fso.OpenTextFile(Server.MapPath(filen), 1) ts.Skip(6) s = ts.Read(4) HW(0) = HexToDec(HexAt(s,2) & HexAt(s,1)) HW(1) = HexToDec(HexAt(s,4) & HexAt(s,3)) ts.Close ReadGIF = HW End Function
Function isDigit(c) If inStr("0123456789", c) <> 0 Then isDigit = true Else isDigit = false End If End Function
Function isHex(c) If inStr("0123456789ABCDEFabcdef", c) <> 0 Then isHex = true Else ishex = false End If End Function
Function HexToDec(cadhex) Dim n, i, ch, decimal decimal = 0 n = Len(cadhex) For i=1 To n ch = Mid(cadhex, i, 1) If isHex(ch) Then decimal = decimal * 16 If isDigit(ch) Then decimal = decimal + ch Else decimal = decimal + Asc(uCase(ch)) - Asc("A") + 10 End If Else HexToDec = -1 End If Next HexToDec = decimal End Function
%>
Så kan du lave en side som hedder vis.asp som denne for at vise et billedet i fuld størrelse.
Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.