Jullie hebben ze misschien vast wel gezien, de foto's op mijn site ( http://ccc4u.net/digicam.ccc4u )
Ik wilde dit scriptje opensource maken, om te kijken of mensen er nog wat aan konden verbeteren...
Als je nu een foto page maakt, doe je dat door een dir te maken onder je fotopage root (zie in mijn geval het script) met daarin de genummerde JPGs en dit kleine variabelen bestandje in te vullen:
Dus voor http://ccc4u.net/webmaster.ccc4u heb ik het volgende var bestand gebruikt:
Ik wilde dit scriptje opensource maken, om te kijken of mensen er nog wat aan konden verbeteren...
PHP:
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
| <? // op te geven variabelen zijn: // $page --> naam van de pagina minux extensie // $dir --> directory waar de plaatjes staan // $max --> maximale aantal photo's // $titel --> Titel van de page // $comment --> eventueel lul verhaaltje.... include("header.inc"); if ($aantalpp < 1) $aantalpp = 1; if ($aantalpp > 10) { echo "<b>10 plaatjes per page is wel genoeg...</b>"; $aantalpp = 10; } if ($show == "all") $aantalpp = $max; $last = $max; $first = 1; if ($image > $max) $image = $max - $aantalpp; $prev = $image - ($aantalpp + 1); $next = $image + $aantalpp; if (($next + $aantalpp) > $max) $next = $max - $aantalpp; if ($image == 0 || $image < 0) $image = 1; if ($image == 1) { echo "<table border=\"0\" width=\"100%\" cellpadding=\"0\" cellspacing=\"5\"> <tr> <td width=\"100%\" bgcolor=\"#000080\"> <p align=\"center\"><font size=\"6\" face=\"Verdana\" color=\"#FFFFFF\">$titel </font></p> </td> </tr> <tr> <td width=\"100%\"> <p align = \"center\"> <font size=\"3\">$comment</font>"; while ($disp < $aantalpp) { echo "<p align=\"center\">[img]\"images/digicam/$dir/$image.jpg\"></p[/img]"; $image++; $disp++; } $image = $image - $disp; $disp = 0; echo " </font></p>"; if ($image > $max) $image = $max - $aantalpp; echo"<p align=\"center\">&nbsp;</p> <p align=\"center\">&nbsp;</p> <a href=\"$page.ccc4u?image=$first\"><b>|&lt;&lt;&nbsp;&nbsp;&nbsp;&nbsp;</b></a> <a href=\"http://ccc4u.net/$page.ccc4u?image=$next&aantalpp=$aantalpp\">Volgende</a>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;<a href=\"$page.ccc4u?image=$last\">&gt;&gt;|</a> </font></p></p> <form action=\"$page.ccc4u\" method=\"post\"> <b>Laat mij </b> <input type=\"text\" name=\"aantalpp\" size=\"1\" value=\"2\"><b> plaatjes per page zien! <p align=\"center\">&nbsp; <input type=\"submit\" value=\"Regel dat!\" name=\"B1\" style=\"font-family: Verdana; color: #FFFFFF; font-weight: bold; background-color: #000080\"></b></font> </form> <p align=\"center\">&nbsp;</p> <p align=\"center\">&nbsp;</td> </tr> </table> <p>&nbsp;</p>"; $image = 1; } if ($image > 1 && $image < $max) { $oldimage = $image; echo "<table border=\"0\" width=\"100%\" cellpadding=\"0\" cellspacing=\"5\"> <tr> <td width=\"100%\" bgcolor=\"#000080\"> <p align=\"center\"><font size=\"6\" face=\"Verdana\" color=\"#FFFFFF\">$titel </font></p> </td> </tr> <tr> <td width=\"100%\"><p align = \"center\"> <font size=\"3\">$comment</font>"; while ($disp < $aantalpp) { echo "<p align=\"center\">[img]\"images/digicam/$dir/$image.jpg\"></p[/img]"; $image++; $disp++; } $image = $image - $disp; $disp = 0; echo " </font></p>"; if ($image > $max) $image = $max - $aantalpp; echo"<p align=\"center\">&nbsp;</p> <p align=\"center\">&nbsp;</p> <a href=\"$page.ccc4u?image=$first\"><b>|&lt;&lt;&nbsp;&nbsp;&nbsp;&nbsp;</b></a> <a href=\"http://ccc4u.net/$page.ccc4u?image=$next&aantalpp=$aantalpp\">Volgende</a>&nbsp;&nbsp;&nbsp;"; if ($image < 0) $image = 1; echo "<a href=\"http://ccc4u.net/$page.ccc4u?image=$prev&aantalpp=$aantalpp\">Vorige</a> &nbsp;&nbsp;&nbsp;&nbsp;<a href=\"$page.ccc4u?image=$last\">&gt;&gt;|</a> </font></p></p> <form action=\"$page.ccc4u\" method=\"post\"> <b>Laat mij </b> <input type=\"text\" name=\"aantalpp\" size=\"1\" value=\"2\"><b> plaatjes per page zien! <p align=\"center\">&nbsp; <input type=\"submit\" value=\"Regel dat!\" name=\"B1\" style=\"font-family: Verdana; color: #FFFFFF; font-weight: bold; background-color: #000080\"></b></font> </form> <p align=\"center\">&nbsp;</p> <p align=\"center\">&nbsp;</td> </tr> </table> <p>&nbsp;</p>"; $image = $oldimage; } if ($image == $max) { $oldimage = $image; echo "<table border=\"0\" width=\"100%\" cellpadding=\"0\" cellspacing=\"5\"> <tr> <td width=\"100%\" bgcolor=\"#000080\"> <p align=\"center\"><font size=\"6\" face=\"Verdana\" color=\"#FFFFFF\">$titel </font></p> </td> </tr> <tr> <td width=\"100%\"><p align = \"center\"> <font size=\"3\">$comment</font>"; while ($disp < $aantalpp) { echo "<p align=\"center\">[img]\"images/digicam/$dir/$image.jpg\"></p[/img]"; $image++; $disp++; } $image = $image - $disp; $disp = 0; echo " </font></p>"; echo"<p align=\"center\">&nbsp;</p> <p align=\"center\">&nbsp;</p> <a href=\"$page.ccc4u?image=$first\"><b>|&lt;&lt;&nbsp;&nbsp;&nbsp;&nbsp;</b></a> &nbsp;&nbsp;&nbsp;"; echo "<a href=\"http://ccc4u.net/$page.ccc4u?image=$prev&aantalpp=$aantalpp\">Vorige</a> &nbsp;&nbsp;&nbsp;&nbsp;<a href=\"$page.ccc4u?image=$last\">&gt;&gt;|</a> </font></p></p> <form action=\"$page.ccc4u\" method=\"post\"> <b>Laat mij </b> <input type=\"text\" name=\"aantalpp\" size=\"1\" value=\"2\"><b> plaatjes per page zien! <p align=\"center\">&nbsp; <input type=\"submit\" value=\"Regel dat!\" name=\"B1\" style=\"font-family: Verdana; color: #FFFFFF; font-weight: bold; background-color: #000080\"></b></font> </form></td> </tr> </table> <p>&nbsp;</p>"; $image = $oldimage; } include("footer.inc"); ?> |
Als je nu een foto page maakt, doe je dat door een dir te maken onder je fotopage root (zie in mijn geval het script) met daarin de genummerde JPGs en dit kleine variabelen bestandje in te vullen:
PHP:
1
2
3
4
5
6
7
8
| <? $page = ""; // pagetitel.ccc4u $max = ; // aantal plaatjes $dir = ""; // dir waarin de plaatjes staan $titel = ""; // titel van page $comment = ""; // verhaaltje erbij include("images.inc"); // script includen ?> |
Dus voor http://ccc4u.net/webmaster.ccc4u heb ik het volgende var bestand gebruikt:
PHP:
1
2
3
4
5
6
7
8
| <? $page = "webmaster"; $max = 24; $dir = "Jelle"; $titel = "The WebMaster!"; $comment = "Blij als ik was met mijn webcam, moest ik ook even wat pics van mezelf online gooien... :-)"; include("images.inc"); ?> |