Ik heb zelf ook een soort van fotoalbum gemaakt met php
code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
| <?
echo "<center><table border=0 cellspacing=0 cellpadding=0><tr><td><a href=/fotoalbum/show?id=$id&show=1><img src=/fotoalbum/$id/1.jpg width=105 height=73 border=0 alt=\"";
include ("$id/1.txt");
echo "\"></a></td><td><a href=/fotoalbum/show?id=$id&show=2><img src=/fotoalbum/$id/preview/2.jpg width=105 height=73 border=0 alt=\"";
include ("$id/2.txt");
echo "\"></a></td><td><a href=/fotoalbum/show?id=$id&show=3><img src=/fotoalbum/$id/preview/3.jpg width=105 height=73 border=0 alt=\"";
include ("$id/3.txt");
echo "\"></a></td><td><a href=/fotoalbum/show?id=$id&show=4><img src=/fotoalbum/$id/preview/4.jpg width=105 height=73 border=0 alt=\"";
include ("$id/4.txt");
echo "\"></a></td><td><a href=/fotoalbum/show?id=$id&show=5><img src=/fotoalbum/$id/preview/5.jpg width=105 height=73 border=0 alt=\"";
include ("$id/5.txt");
echo "\"></a></td><td><a href=/fotoalbum/show?id=$id&show=6><img src=/fotoalbum/$id/preview/6.jpg width=105 height=73 border=0 alt=\"";
include ("$id/6.txt");
echo "\"></a></td></tr><tr><td><a href=/fotoalbum/show?id=$id&show=7><img src=/fotoalbum/$id/preview/7.jpg width=105 height=73 border=0 alt=\"";
include ("$id/7.txt");
echo "\"></a></td><td colspan=4 rowspan=4 align=center><img src=/fotoalbum/$id/$show.jpg width=418 height=290 border=0 alt=\"";
include ("$id/$show.txt");
echo "\"></td><td><a href=/fotoalbum/show?id=$id&show=8><img src=/fotoalbum/$id/preview/8.jpg width=105 height=73 border=0 alt=\"";
include ("$id/8.txt");
echo "\"></a></td></tr><tr><td><a href=/fotoalbum/show?id=$id&show=9><img src=/fotoalbum/$id/preview/9.jpg width=105 height=73 border=0 alt=\"";
include ("$id/9.txt");
echo "\"></a></td><td><a href=/fotoalbum/show?id=$id&show=10><img src=/fotoalbum/$id/preview/10.jpg width=105 height=73 border=0 alt=\"";
include ("$id/10.txt");
echo "\"></a></td></tr><tr><td><a href=/fotoalbum/show?id=$id&show=11><img src=/fotoalbum/$id/preview/11.jpg width=105 height=73 border=0 alt=\"";
include ("$id/11.txt");
echo "\"></a></td><td><a href=/fotoalbum/show?id=$id&show=12><img src=/fotoalbum/$id/preview/12.jpg width=105 height=73 border=0 alt=\"";
include ("$id/12.txt");
echo "\"></a></td></tr><tr><td><a href=/fotoalbum/show?id=$id&show=13><img src=/fotoalbum/$id/preview/13.jpg width=105 height=73 border=0 alt=\"";
include ("$id/13.txt");
echo "\"></a></td><td><a href=/fotoalbum/show?id=$id&show=14><img src=/fotoalbum/$id/preview/14.jpg width=105 height=73 border=0 alt=\"";
include ("$id/14.txt");
echo "\"></a></td></tr><tr><td><a href=/fotoalbum/show?id=$id&show=15><img src=/fotoalbum/$id/preview/15.jpg width=105 height=73 border=0 alt=\"";
include ("$id/15.txt");
echo "\"></a></td><td><a href=/fotoalbum/show?id=$id&show=16><img src=/fotoalbum/$id/preview/16.jpg width=105 height=73 border=0 alt=\"";
include ("$id/16.txt");
echo "\"></a></td><td><a href=/fotoalbum/show?id=$id&show=17><img src=/fotoalbum/$id/preview/17.jpg width=105 height=73 border=0 alt=\"";
include ("$id/17.txt");
echo "\"></a></td><td><a href=/fotoalbum/show?id=$id&show=18><img src=/fotoalbum/$id/preview/18.jpg width=105 height=73 border=0 alt=\"";
include ("$id/18.txt");
echo "\"></a></td><td><a href=/fotoalbum/show?id=$id&show=19><img src=/fotoalbum/$id/preview/19.jpg width=105 height=73 border=0 alt=\"";
include ("$id/19.txt");
echo "\"></a></td><td><a href=/fotoalbum/show?id=$id&show=20><img src=/fotoalbum/$id/preview/20.jpg width=105 height=73 border=0 alt=\"";
include ("$id/20.txt");
echo "\"></a></td></tr></table></center>";
?> |
let niet op het hele table gebeuren, dit is alleen voor de layout (20 foto's die rondom de groote foto staan).
Ik gebruik voor meerdere fotoalbums 1 php bestand. D.m.v. de includes leest hij dus in wat hij moet doen.
Indeling op de server:
- naam van de map is $id
- in bovenstaande map staat een map preview
- alle foto's hebben de naam 1.jpg ---> 20.jpg
- txt bestandjes met een gelijke naamsopbouw (1.jpg wordt 1.txt) bevatten de omschrijving.
Door nu de juiste url in te laden veranderd de foto in het midden, de grote dus.