Subversion Repositories svnkaklik

Rev

Go to most recent revision | Details | Last modification | View Log

Rev Author Line No. Line
6 kaklik 1
<?php
2
/*************************
3
  Coppermine Photo Gallery
4
  ************************
5
  Copyright (c) 2003-2005 Coppermine Dev Team
6
  v1.1 originaly written by Gregory DEMAR
7
 
8
  This program is free software; you can redistribute it and/or modify
9
  it under the terms of the GNU General Public License as published by
10
  the Free Software Foundation; either version 2 of the License, or
11
  (at your option) any later version.
12
  ********************************************
13
  Coppermine version: 1.3.3
14
  $Source: /cvsroot/coppermine/stable/themes/rainy_day/theme.php,v $
15
  $Revision: 1.10 $
16
  $Author: gaugau $
17
  $Date: 2005/04/19 03:17:15 $
18
**********************************************/
19
 
20
define('THEME_HAS_RATING_GRAPHICS', 1);
21
// HTML template for main menu
22
$template_main_menu1 = <<<EOT
23
                <span class="topmenu">
24
                        <table border="0" cellpadding="0" cellspacing="0">
25
                                <tr>
26
<!-- BEGIN my_gallery -->
27
                                        <td><img name="spacer" src="images/spacer.gif" width="5" height="25" border="0" id="spacer" alt="" /></td>
28
                                        <td><img name="button1_r1_c1" src="themes/rainy_day/images/button1_r1_c1.gif" width="5" height="25" border="0" id="button1_r1_c1" alt="" /></td>
29
                                        <td background="themes/rainy_day/images/button1_r1_c2.gif">
30
                                                <a href="{MY_GAL_TGT}" title="{MY_GAL_TITLE}">{MY_GAL_LNK}</a>
31
                                        </td>
32
                                        <td><img name="button1_r1_c3" src="themes/rainy_day/images/button1_r1_c3.gif" width="5" height="25" border="0" id="button1_r1_c3" alt="" /></td>
33
<!-- END my_gallery -->
34
<!-- BEGIN allow_memberlist -->
35
                                        <td><img name="spacer" src="images/spacer.gif" width="5" height="25" border="0" id="spacer" alt="" /></td>
36
                                        <td><img name="button1_r1_c1" src="themes/rainy_day/images/button1_r1_c1.gif" width="5" height="25" border="0" id="button1_r1_c1" alt="" /></td>
37
                                        <td background="themes/rainy_day/images/button1_r1_c2.gif">
38
                                                <a href="{MEMBERLIST_TGT}" title="{MEMBERLIST_TITLE}">{MEMBERLIST_LNK}</a>
39
                                        </td>
40
                                        <td><img name="button1_r1_c3" src="themes/rainy_day/images/button1_r1_c3.gif" width="5" height="25" border="0" id="button1_r1_c3" alt="" /></td>
41
<!-- END allow_memberlist -->
42
<!-- BEGIN my_profile -->
43
                                        <td><img name="spacer" src="images/spacer.gif" width="5" height="25" border="0" id="spacer" alt="" /></td>
44
                                        <td><img name="button1_r1_c1" src="themes/rainy_day/images/button1_r1_c1.gif" width="5" height="25" border="0" id="button1_r1_c1" alt="" /></td>
45
                                        <td background="themes/rainy_day/images/button1_r1_c2.gif">
46
                                                <a href="{MY_PROF_TGT}">{MY_PROF_LNK}</a>
47
                                        </td>
48
                                        <td><img name="button1_r1_c3" src="themes/rainy_day/images/button1_r1_c3.gif" width="5" height="25" border="0" id="button1_r1_c3" alt="" /></td>
49
<!-- END my_profile -->
50
<!-- BEGIN faq -->
51
                                        <td><img name="spacer" src="images/spacer.gif" width="5" height="25" border="0" id="spacer" alt="" /></td>
52
                                        <td><img name="button1_r1_c1" src="themes/rainy_day/images/button1_r1_c1.gif" width="5" height="25" border="0" id="button1_r1_c1" alt="" /></td>
53
                                        <td background="themes/rainy_day/images/button1_r1_c2.gif">
54
 
55
                        <a href="{FAQ_TGT}" title="{FAQ_TITLE}">{FAQ_LNK}</a>
56
                                        </td>
57
                                        <td><img name="button1_r1_c3" src="themes/rainy_day/images/button1_r1_c3.gif" width="5" height="25" border="0" id="button1_r1_c3" alt="" /></td>
58
<!-- END faq -->
59
<!-- BEGIN enter_admin_mode -->
60
                                        <td><img name="spacer" src="images/spacer.gif" width="5" height="25" border="0" id="spacer" alt="" /></td>
61
                                        <td><img name="button1_r1_c1" src="themes/rainy_day/images/button1_r1_c1.gif" width="5" height="25" border="0" id="button1_r1_c1" alt="" /></td>
62
                                        <td background="themes/rainy_day/images/button1_r1_c2.gif">
63
                                                <a href="{ADM_MODE_TGT}" title="{ADM_MODE_TITLE}">{ADM_MODE_LNK}</a>
64
                                        </td>
65
                                        <td><img name="button1_r1_c3" src="themes/rainy_day/images/button1_r1_c3.gif" width="5" height="25" border="0" id="button1_r1_c3" alt="" /></td>
66
<!-- END enter_admin_mode -->
67
<!-- BEGIN leave_admin_mode -->
68
                                        <td><img name="spacer" src="images/spacer.gif" width="5" height="25" border="0" id="spacer" alt="" /></td>
69
                                        <td><img name="button1_r1_c1" src="themes/rainy_day/images/button1_r1_c1.gif" width="5" height="25" border="0" id="button1_r1_c1" alt="" /></td>
70
                                        <td background="themes/rainy_day/images/button1_r1_c2.gif">
71
                                                <a href="{USR_MODE_TGT}" title="{USR_MODE_TITLE}">{USR_MODE_LNK}</a>
72
                                        </td>
73
                                        <td><img name="button1_r1_c3" src="themes/rainy_day/images/button1_r1_c3.gif" width="5" height="25" border="0" id="button1_r1_c3" alt="" /></td>
74
<!-- END leave_admin_mode -->
75
<!-- BEGIN upload_pic -->
76
                                        <td><img name="spacer" src="images/spacer.gif" width="5" height="25" border="0" id="spacer" alt="" /></td>
77
                                        <td><img name="button1_r1_c1" src="themes/rainy_day/images/button1_r1_c1.gif" width="5" height="25" border="0" id="button1_r1_c1" alt="" /></td>
78
                                        <td background="themes/rainy_day/images/button1_r1_c2.gif">
79
                                                <a href="{UPL_PIC_TGT}" title="{UPL_PIC_TITLE}">{UPL_PIC_LNK}</a>
80
                                        </td>
81
                                        <td><img name="button1_r1_c3" src="themes/rainy_day/images/button1_r1_c3.gif" width="5" height="25" border="0" id="button1_r1_c3" alt="" /></td>
82
<!-- END upload_pic -->
83
<!-- BEGIN register -->
84
                                        <td><img name="spacer" src="images/spacer.gif" width="5" height="25" border="0" id="spacer" alt="" /></td>
85
                                        <td><img name="button1_r1_c1" src="themes/rainy_day/images/button1_r1_c1.gif" width="5" height="25" border="0" id="button1_r1_c1" alt="" /></td>
86
                                        <td background="themes/rainy_day/images/button1_r1_c2.gif">
87
                                                <a href="{REGISTER_TGT}" title="{REGISTER_TITLE}">{REGISTER_LNK}</a>
88
                                        </td>
89
                                        <td><img name="button1_r1_c3" src="themes/rainy_day/images/button1_r1_c3.gif" width="5" height="25" border="0" id="button1_r1_c3" alt="" /></td>
90
<!-- END register -->
91
<!-- BEGIN login -->
92
                                        <td><img name="spacer" src="images/spacer.gif" width="5" height="25" border="0" id="spacer" alt="" /></td>
93
                                        <td><img name="button1_r1_c1" src="themes/rainy_day/images/button1_r1_c1.gif" width="5" height="25" border="0" id="button1_r1_c1" alt="" /></td>
94
                                        <td background="themes/rainy_day/images/button1_r1_c2.gif">
95
                                                <a href="{LOGIN_TGT}">{LOGIN_LNK}</a>
96
                                        </td>
97
                                        <td><img name="button1_r1_c3" src="themes/rainy_day/images/button1_r1_c3.gif" width="5" height="25" border="0" id="button1_r1_c3" alt="" /></td>
98
<!-- END login -->
99
<!-- BEGIN logout -->
100
                                        <td><img name="spacer" src="images/spacer.gif" width="5" height="25" border="0" id="spacer" alt="" /></td>
101
                                        <td><img name="button1_r1_c1" src="themes/rainy_day/images/button1_r1_c1.gif" width="5" height="25" border="0" id="button1_r1_c1" alt="" /></td>
102
                                        <td background="themes/rainy_day/images/button1_r1_c2.gif">
103
                                                <a href="{LOGOUT_TGT}">{LOGOUT_LNK}</a>
104
                                        </td>
105
                                        <td><img name="button1_r1_c3" src="themes/rainy_day/images/button1_r1_c3.gif" width="5" height="25" border="0" id="button1_r1_c3" alt="" /></td>
106
<!-- END logout -->
107
                                </tr>
108
                        </table>
109
                </span>
110
EOT;
111
 
112
$template_main_menu2 = <<<EOT
113
<!-- BEGIN album_list -->
114
                                        <td><img name="spacer" src="images/spacer.gif" width="5" height="25" border="0" id="spacer" alt="" /></td>
115
                                        <td><img name="button1_r1_c1" src="themes/rainy_day/images/button1_r1_c1.gif" width="5" height="25" border="0" id="button1_r1_c1" alt="" /></td>
116
                                        <td background="themes/rainy_day/images/button1_r1_c2.gif">
117
                                                <a href="{ALB_LIST_TGT}" title="{ALB_LIST_TITLE}">{ALB_LIST_LNK}</a>
118
                                        </td>
119
                                        <td><img name="button1_r1_c3" src="themes/rainy_day/images/button1_r1_c3.gif" width="5" height="25" border="0" id="button1_r1_c3" alt="" /></td>
120
<!-- END album_list -->
121
                                        <td><img name="spacer" src="images/spacer.gif" width="5" height="25" border="0" id="spacer" alt="" /></td>
122
                                        <td><img name="button1_r1_c1" src="themes/rainy_day/images/button1_r1_c1.gif" width="5" height="25" border="0" id="button1_r1_c1" alt="" /></td>
123
                                        <td background="themes/rainy_day/images/button1_r1_c2.gif">
124
                                                <a href="{LASTUP_TGT}">{LASTUP_LNK}</a>
125
                                        </td>
126
                                        <td><img name="button1_r1_c3" src="themes/rainy_day/images/button1_r1_c3.gif" width="5" height="25" border="0" id="button1_r1_c3" alt="" /></td>
127
                                        <td><img name="spacer" src="images/spacer.gif" width="5" height="25" border="0" id="spacer" alt="" /></td>
128
                                        <td><img name="button1_r1_c1" src="themes/rainy_day/images/button1_r1_c1.gif" width="5" height="25" border="0" id="button1_r1_c1" alt="" /></td>
129
                                        <td background="themes/rainy_day/images/button1_r1_c2.gif">
130
                                                <a href="{LASTCOM_TGT}">{LASTCOM_LNK}</a>
131
                                        </td>
132
                                        <td><img name="button1_r1_c3" src="themes/rainy_day/images/button1_r1_c3.gif" width="5" height="25" border="0" id="button1_r1_c3" alt="" /></td>
133
                                        <td><img name="spacer" src="images/spacer.gif" width="5" height="25" border="0" id="spacer" alt="" /></td>
134
                                        <td><img name="button1_r1_c1" src="themes/rainy_day/images/button1_r1_c1.gif" width="5" height="25" border="0" id="button1_r1_c1" alt="" /></td>
135
                                        <td background="themes/rainy_day/images/button1_r1_c2.gif">
136
                                                <a href="{TOPN_TGT}">{TOPN_LNK}</a>
137
                                        </td>
138
                                        <td><img name="button1_r1_c3" src="themes/rainy_day/images/button1_r1_c3.gif" width="5" height="25" border="0" id="button1_r1_c3" alt="" /></td>
139
                                        <td><img name="spacer" src="images/spacer.gif" width="5" height="25" border="0" id="spacer" alt="" /></td>
140
                                        <td><img name="button1_r1_c1" src="themes/rainy_day/images/button1_r1_c1.gif" width="5" height="25" border="0" id="button1_r1_c1" alt="" /></td>
141
                                        <td background="themes/rainy_day/images/button1_r1_c2.gif">
142
                                                <a href="{TOPRATED_TGT}">{TOPRATED_LNK}</a>
143
                                        </td>
144
                                        <td><img name="button1_r1_c3" src="themes/rainy_day/images/button1_r1_c3.gif" width="5" height="25" border="0" id="button1_r1_c3" alt="" /></td>
145
                                        <td><img name="spacer" src="images/spacer.gif" width="5" height="25" border="0" id="spacer" alt="" /></td>
146
                                        <td><img name="button1_r1_c1" src="themes/rainy_day/images/button1_r1_c1.gif" width="5" height="25" border="0" id="button1_r1_c1" alt="" /></td>
147
                                        <td background="themes/rainy_day/images/button1_r1_c2.gif">
148
                                                <a href="{FAV_TGT}">{FAV_LNK}</a>
149
                                        </td>
150
                                        <td><img name="button1_r1_c3" src="themes/rainy_day/images/button1_r1_c3.gif" width="5" height="25" border="0" id="button1_r1_c3" alt="" /></td>
151
                                        <td><img name="spacer" src="images/spacer.gif" width="5" height="25" border="0" id="spacer" alt="" /></td>
152
                                        <td><img name="button1_r1_c1" src="themes/rainy_day/images/button1_r1_c1.gif" width="5" height="25" border="0" id="button1_r1_c1" alt="" /></td>
153
                                        <td background="themes/rainy_day/images/button1_r1_c2.gif">
154
                                                <a href="{SEARCH_TGT}">{SEARCH_LNK}</a>
155
                                        </td>
156
                                        <td><img name="button1_r1_c3" src="themes/rainy_day/images/button1_r1_c3.gif" width="5" height="25" border="0" id="button1_r1_c3" alt="" /></td>
157
EOT;
158
// HTML template for gallery admin menu
159
$template_gallery_admin_menu = <<<EOT
160
 
161
                <div align="center">
162
                <table cellpadding="0" cellspacing="1">
163
                        <tr>
164
                                <td class="admin_menu"><a href="editpics.php?mode=upload_approval" title="">{UPL_APP_LNK}</a></td>
165
                                <td class="admin_menu"><a href="config.php" title="">{CONFIG_LNK}</a></td>
166
                                <td class="admin_menu"><a href="albmgr.php{CATL}" title="">{ALBUMS_LNK}</a></td>
167
                                <td class="admin_menu"><a href="catmgr.php" title="">{CATEGORIES_LNK}</a></td>
168
                                <td class="admin_menu"><a href="usermgr.php" title="">{USERS_LNK}</a></td>
169
                                <td class="admin_menu"><a href="groupmgr.php" title="">{GROUPS_LNK}</a></td>
170
                                <td class="admin_menu"><a href="banning.php" title="">{BAN_LNK}</a></td>
171
                                <td class="admin_menu"><a href="db_ecard.php" title="">{DB_ECARD_LNK}</a></td>
172
                                <td class="admin_menu"><a href="reviewcom.php" title="">{COMMENTS_LNK}</a></td>
173
                                <td class="admin_menu"><a href="searchnew.php" title="">{SEARCHNEW_LNK}</a></td>
174
                                <td class="admin_menu"><a href="util.php" title="">{UTIL_LNK}</a></td>
175
                                <td class="admin_menu"><a href="profile.php?op=edit_profile" title="">{MY_PROF_LNK}</a></td>
176
                        </tr>
177
                </table>
178
                </div>
179
 
180
EOT;
181
// HTML template for user admin menu
182
$template_user_admin_menu = <<<EOT
183
 
184
                <div align="center">
185
                <table cellpadding="0" cellspacing="1">
186
                        <tr>
187
                                <td class="admin_menu"><a href="albmgr.php" title="">{ALBMGR_LNK}</a></td>
188
                                <td class="admin_menu"><a href="modifyalb.php" title="">{MODIFYALB_LNK}</a></td>
189
                                <td class="admin_menu"><a href="profile.php?op=edit_profile" title="">{MY_PROF_LNK}</a></td>
190
                        </tr>
191
                </table>
192
                </div>
193
 
194
EOT;
195
// HTML template for the category list
196
$template_cat_list = <<<EOT
197
 
198
<!-- BEGIN header -->
199
        <tr>
200
                <td class="tableh1" width="80%"><b>{CATEGORY}</b></td>
201
                <td class="tableh1" width="10%" align="center"><b>{ALBUMS}</b></td>
202
                <td class="tableh1" width="10%" align="center"><b>{PICTURES}</b></td>
203
        </tr>
204
<!-- END header -->
205
<!-- BEGIN catrow_noalb -->
206
        <tr>
207
                <td class="tableh2" colspan="3"><table border="0"><tr><td>{CAT_THUMB}</td><td><span class="catlink"><b>{CAT_TITLE}</b></span>{CAT_DESC}</td></tr></table></td>
208
        </tr>
209
<!-- END catrow_noalb -->
210
<!-- BEGIN catrow -->
211
        <tr>
212
                <td class="tableb"><table border="0"><tr><td>{CAT_THUMB}</td><td><span class="catlink"><b>{CAT_TITLE}</b></span>{CAT_DESC}</td></tr></table></td>
213
                <td class="tableb" align="center">{ALB_COUNT}</td>
214
                <td class="tableb" align="center">{PIC_COUNT}</td>
215
        </tr>
216
      <tr>
217
            <td class="tableb" colspan=3>{CAT_ALBUMS}</td>
218
      </tr>
219
<!-- END catrow -->
220
<!-- BEGIN footer -->
221
        <tr>
222
                <td colspan="3" class="tableh1" align="center"><span class="statlink"><b>{STATISTICS}</b></span></td>
223
        </tr>
224
<!-- END footer -->
225
<!-- BEGIN spacer -->
226
        <img src="images/spacer.gif" width="1" height="17" /><br />
227
<!-- END spacer -->
228
 
229
EOT;
230
// HTML template for the breadcrumb
231
$template_breadcrumb = <<<EOT
232
<!-- BEGIN breadcrumb -->
233
        <tr>
234
                <td colspan="3" class="tableh1"><span class="statlink"><b>{BREADCRUMB}</b></span></td>
235
        </tr>
236
<!-- END breadcrumb -->
237
<!-- BEGIN breadcrumb_user_gal -->
238
        <tr>
239
                <td colspan="3" class="tableh1">
240
                <table width="100%" cellpadding="0" cellspacing="0" border="0">
241
                <tr>
242
                        <td><span class="statlink"><b>{BREADCRUMB}</b></span></td>
243
                        <td align="right"><span class="statlink"><b>{STATISTICS}</b></span></td>
244
                </tr>
245
                </table>
246
                </td>
247
        </tr>
248
<!-- END breadcrumb_user_gal -->
249
 
250
EOT;
251
// HTML template for the album list
252
$template_album_list = <<<EOT
253
 
254
<!-- BEGIN stat_row -->
255
        <tr>
256
                <td colspan="{COLUMNS}" class="tableh1" align="center"><span class="statlink"><b>{STATISTICS}</b></span></td>
257
        </tr>
258
<!-- END stat_row -->
259
<!-- BEGIN header -->
260
        <tr>
261
<!-- END header -->
262
<!-- BEGIN album_cell -->
263
        <td width="{COL_WIDTH}%" height="100%" valign="top">
264
        <table width="100%" height="100%" cellspacing="0" cellpadding="0">
265
        <tr>
266
                <td colspan="3" height="1" valign="top" class="tableh2">
267
                        <a href="{ALB_LINK_TGT}" class="alblink"><b>{ALBUM_TITLE}</b></a>
268
                </td>
269
        </tr>
270
        <tr>
271
                <td colspan="3">
272
                        <img src="images/spacer.gif" width="1" height="1"><br />
273
                </td>
274
        </tr>
275
        <tr height="100%">
276
                <td align="center" height="100%" valign="middle" class="thumbnails">
277
                        <img src="images/spacer.gif" width="{THUMB_CELL_WIDTH}" height="1" class="image" style="margin-top: 0px;
278
 margin-bottom: 0px; border: none;"><br />
279
                        <a href="{ALB_LINK_TGT}" class="albums">{ALB_LINK_PIC}<br /></a>
280
                </td>
281
                <td height="100%">
282
                        <img src="images/spacer.gif" width="1" height="1">
283
                </td>
284
                <td width="100%" height="100%" valign="top" class="tableb_compact">
285
                        {ADMIN_MENU}
286
                        <p>{ALB_DESC}</p>
287
                        <p class="album_stat">{ALB_INFOS}</p>
288
                </td>
289
        </tr>
290
        </table>
291
        </td>
292
<!-- END album_cell -->
293
<!-- BEGIN empty_cell -->
294
        <td width="{COL_WIDTH}%" height="100%" valign="top">
295
        <table width="100%" height="100%" cellspacing="0" cellpadding="0">
296
        <tr>
297
                <td height="1" valign="top" class="tableh2">
298
                        <b>&nbsp;</b>
299
                </td>
300
        </tr>
301
        <tr>
302
                <td>
303
                        <img src="images/spacer.gif" width="1" height="1"><br />
304
                </td>
305
        </tr>
306
        <tr height="100%">
307
                <td width="100%" height="100%" valign="top" class="tableb_compact">
308
                        &nbsp;
309
                </td>
310
        </tr>
311
        </table>
312
        </td>
313
<!-- END empty_cell -->
314
<!-- BEGIN row_separator -->
315
        </tr>
316
        <tr>
317
<!-- END row_separator -->
318
<!-- BEGIN footer -->
319
        </tr>
320
<!-- END footer -->
321
<!-- BEGIN tabs -->
322
        <tr>
323
                <td colspan="{COLUMNS}" style="padding: 0px;">
324
                        <table width="100%" cellspacing="0" cellpadding="0">
325
                                <tr>
326
                                        {TABS}
327
                                </tr>
328
                        </table>
329
                </td>
330
        </tr>
331
<!-- END tabs -->
332
<!-- BEGIN spacer -->
333
        <img src="images/spacer.gif" width="1" height="17" /><br />
334
<!-- END spacer -->
335
 
336
EOT;
337
// HTML template for filmstrip display
338
$template_film_strip = <<<EOT
339
 
340
        <tr>
341
         <td valign="top" background='themes/rainy_day/images/tile.gif' align="center" height='30'>&nbsp;</td>
342
        </tr>
343
        <tr>
344
        <td valign="bottom" class="thumbnails" align="center">
345
          {THUMB_STRIP}
346
        </td>
347
        </tr>
348
        <tr>
349
         <td valign="top" background='themes/rainy_day/images/tile.gif' align="center" height='30'>&nbsp;</td>
350
        </tr>
351
<!-- BEGIN thumb_cell -->
352
                                        <a href="{LINK_TGT}">{THUMB}</a>&nbsp;
353
                                        {CAPTION}
354
                                        {ADMIN_MENU}
355
<!-- END thumb_cell -->
356
<!-- BEGIN empty_cell -->
357
                <td valign="top" align="center" >1&nbsp;</td>
358
<!-- END empty_cell -->
359
 
360
EOT;
361
// HTML template for the album list
362
$template_album_list_cat = <<<EOT
363
 
364
<!-- BEGIN c_stat_row -->
365
        <tr>
366
                <td colspan="{COLUMNS}" class="tableh1" align="center"><span class="statlink"><b>{STATISTICS}</b></span></td>
367
        </tr>
368
<!-- END c_stat_row -->
369
<!-- BEGIN c_header -->
370
        <tr>
371
<!-- END c_header -->
372
<!-- BEGIN c_album_cell -->
373
        <td width="{COL_WIDTH}%" height="100%" valign="top">
374
        <table width="100%" height="100%" cellspacing="0" cellpadding="0">
375
        <tr>
376
                <td colspan="3" height="1" valign="top" class="tableh2">
377
                        <a href="{ALB_LINK_TGT}" class="alblink"><b>{ALBUM_TITLE}</b></a>
378
                </td>
379
        </tr>
380
        <tr>
381
                <td colspan="3">
382
                        <img src="images/spacer.gif" width="1" height="1"><br />
383
                </td>
384
        </tr>
385
        <tr height="100%">
386
                <td align="center" height="100%" valign="middle" class="thumbnails">
387
                        <img src="images/spacer.gif" width="{THUMB_CELL_WIDTH}" height="1" class="image" style="margin-top: 0px;
388
 margin-bottom: 0px; border: none;"><br />
389
                        <a href="{ALB_LINK_TGT}" class="albums">{ALB_LINK_PIC}<br /></a>
390
                </td>
391
                <td height="100%">
392
                        <img src="images/spacer.gif" width="1" height="1">
393
                </td>
394
                <td width="100%" height="100%" valign="top" class="tableb_compact">
395
                        {ADMIN_MENU}
396
                        <p>{ALB_DESC}</p>
397
                        <p class="album_stat">{ALB_INFOS}</p>
398
                </td>
399
        </tr>
400
        </table>
401
        </td>
402
<!-- END c_album_cell -->
403
<!-- BEGIN c_empty_cell -->
404
        <td width="{COL_WIDTH}%" height="100%" valign="top">
405
        <table width="100%" height="100%" cellspacing="0" cellpadding="0">
406
        <tr>
407
                <td height="1" valign="top" class="tableh2">
408
                        <b>&nbsp;</b>
409
                </td>
410
        </tr>
411
        <tr>
412
                <td>
413
                        <img src="images/spacer.gif" width="1" height="1"><br />
414
                </td>
415
        </tr>
416
        <tr height="100%">
417
                <td width="100%" height="100%" valign="top" class="tableb_compact">
418
                        &nbsp;
419
                </td>
420
        </tr>
421
        </table>
422
        </td>
423
<!-- END c_empty_cell -->
424
<!-- BEGIN c_row_separator -->
425
        </tr>
426
        <tr>
427
<!-- END c_row_separator -->
428
<!-- BEGIN c_footer -->
429
        </tr>
430
<!-- END c_footer -->
431
<!-- BEGIN c_tabs -->
432
        <tr>
433
                <td colspan="{COLUMNS}" style="padding: 0px;">
434
                        <table width="100%" cellspacing="0" cellpadding="0">
435
                                <tr>
436
                                        {TABS}
437
                                </tr>
438
                        </table>
439
                </td>
440
        </tr>
441
<!-- END c_tabs -->
442
<!-- BEGIN c_spacer -->
443
        <img src="images/spacer.gif" width="1" height="17" /><br />
444
<!-- END c_spacer -->
445
 
446
EOT;
447
// HTML template for the ALBUM admin menu displayed in the album list
448
$template_album_admin_menu = <<<EOT
449
        <table border="0" cellpadding="0" cellspacing="1">
450
                <tr>
451
                        <td align="center" valign="middle" class="admin_menu">
452
                                <a href="delete.php?id={ALBUM_ID}&what=album"  class="adm_menu" onclick="return confirm('{CONFIRM_DELETE}');">{DELETE}</a>
453
                        </td>
454
                        <td align="center" valign="middle" class="admin_menu">
455
                                <a href="modifyalb.php?album={ALBUM_ID}"  class="adm_menu">{MODIFY}</a>
456
                        </td>
457
                        <td align="center" valign="middle" class="admin_menu">
458
                                <a href="editpics.php?album={ALBUM_ID}"  class="adm_menu">{EDIT_PICS}</a>
459
                        </td>
460
                </tr>
461
        </table>
462
 
463
EOT;
464
// HTML template for title row of the thumbnail view (album title + sort options)
465
$template_thumb_view_title_row = <<<EOT
466
 
467
                        <table width="100%" cellpadding="0" cellspacing="0">
468
                        <tr>
469
                                <td width="100%" class="statlink"><h2>{ALBUM_NAME}</h2></td>
470
                                <td><img src="images/spacer.gif" width="1"></td>
471
                                <td class="sortorder_cell">
472
                                        <table height="100%" cellpadding="0" cellspacing="0">
473
                                        <tr>
474
                        <td class="sortorder_options">{TITLE}</td>
475
                        <td class="sortorder_options"><span class="statlink"><a href="thumbnails.php?album={AID}&page={PAGE}&sort=ta" title="{SORT_TA}">&nbsp;+&nbsp;</a></span></td>
476
                        <td class="sortorder_options"><span class="statlink"><a href="thumbnails.php?album={AID}&page={PAGE}&sort=td" title="{SORT_TD}">&nbsp;-&nbsp;</a></span></td>
477
                                        </tr>
478
                                        <tr>
479
                                                <td class="sortorder_options">{NAME}</td>
480
                                                <td class="sortorder_options"><span class="statlink"><a href="thumbnails.php?album={AID}&page={PAGE}&sort=na" title="{SORT_NA}">&nbsp;+&nbsp;</a></span></td>
481
                                                <td class="sortorder_options"><span class="statlink"><a href="thumbnails.php?album={AID}&page={PAGE}&sort=nd" title="{SORT_ND}">&nbsp;-&nbsp;</a></span></td>
482
                                        </tr>
483
                                        <tr>
484
                                                <td class="sortorder_options">{DATE}</td>
485
                                                <td class="sortorder_options"><span class="statlink"><a href="thumbnails.php?album={AID}&page={PAGE}&sort=da" title="{SORT_DA}">&nbsp;+&nbsp;</a></span></td>
486
                                                <td class="sortorder_options"><span class="statlink"><a href="thumbnails.php?album={AID}&page={PAGE}&sort=dd" title="{SORT_DD}">&nbsp;-&nbsp;</a></span></td>
487
                                        </tr>
488
                                        </table>
489
                                </td>
490
                        </tr>
491
                        </table>
492
 
493
EOT;
494
 
495
 
496
// HTML template for title row of the fav thumbnail view (album title + download)
497
$template_fav_thumb_view_title_row = <<<EOT
498
 
499
                        <table width="100%" cellpadding="0" cellspacing="0">
500
                        <tr>
501
                                <td width="100%" class="statlink"><h2>{ALBUM_NAME}</h2></td>
502
                                <td><img src="images/spacer.gif" width="1"></td>
503
                                <td class="sortorder_cell">
504
                                        <table height="100%" cellpadding="0" cellspacing="0">
505
                                                <tr>
506
                                                        <td class="sortorder_options"><span class="statlink"><a href="zipdownload.php">{DOWNLOAD_ZIP}</a></span></td>
507
                                                </tr>
508
                                                </table>
509
                                </td>
510
                        </tr>
511
                        </table>
512
 
513
EOT;
514
 
515
 
516
// HTML template for thumbnails display
517
$template_thumbnail_view = <<<EOT
518
 
519
<!-- BEGIN header -->
520
        <tr>
521
<!-- END header -->
522
<!-- BEGIN thumb_cell -->
523
        <td valign="top" class="thumbnails" width ="{CELL_WIDTH}" align="center">
524
                <table width="100%" cellpadding="0" cellspacing="0">
525
                        <tr>
526
                                <td align="center">
527
                                        <a href="{LINK_TGT}">{THUMB}<br /></a>
528
                                        {CAPTION}
529
                                        {ADMIN_MENU}
530
                                </td>
531
                        </tr>
532
                </table>
533
        </td>
534
<!-- END thumb_cell -->
535
<!-- BEGIN empty_cell -->
536
                <td valign="top" class="thumbnails" align="center">&nbsp;</td>
537
<!-- END empty_cell -->
538
<!-- BEGIN row_separator -->
539
        </tr>
540
        <tr>
541
<!-- END row_separator -->
542
<!-- BEGIN footer -->
543
        </tr>
544
<!-- END footer -->
545
<!-- BEGIN tabs -->
546
        <tr>
547
                <td colspan="{THUMB_COLS}" style="padding: 0px;">
548
                        <table width="100%" cellspacing="0" cellpadding="0">
549
                                <tr>
550
                                        {TABS}
551
                                </tr>
552
                        </table>
553
                </td>
554
        </tr>
555
<!-- END tabs -->
556
<!-- BEGIN spacer -->
557
        <img src="images/spacer.gif" width="1" height="17" /><br />
558
<!-- END spacer -->
559
 
560
EOT;
561
// HTML template for the thumbnail view when there is no picture to show
562
$template_no_img_to_display = <<<EOT
563
        <tr>
564
                <td class="tableb" height="200" align="center">
565
                        <font size="3"><b>{TEXT}</b></font>
566
                </td>
567
        </tr>
568
<!-- BEGIN spacer -->
569
        <img src="images/spacer.gif" width="1" height="17" /><br />
570
<!-- END spacer -->
571
 
572
EOT;
573
// HTML template for the USER info box in the user list view
574
$template_user_list_info_box = <<<EOT
575
 
576
        <table cellspacing="1" cellpadding="0" border="0" width="100%" class="user_thumb_infobox">
577
                <tr>
578
                        <th><a href="profile.php?uid={USER_ID}">{USER_NAME}</a></th>
579
                </tr>
580
                <tr>
581
                        <td>{ALBUMS}</td>
582
                </tr>
583
                <tr>
584
                        <td>{PICTURES}</td>
585
                </tr>
586
        </table>
587
 
588
EOT;
589
// HTML template for the image navigation bar
590
$template_img_navbar = <<<EOT
591
 
592
        <tr>
593
                <td align="center" valign="middle" class="navmenu" width="48">
594
                        <a href="{THUMB_TGT}" class="navmenu_pic" title="{THUMB_TITLE}"><img src="images/folder.gif" width="16" height="16" align="absmiddle" border="0" alt="{THUMB_TITLE}" /></a>
595
                </td>
596
                <td align="center" valign="middle" class="navmenu" width="48">
597
                        <a href="javascript:;" onClick="blocking('picinfo','yes', 'block'); return false;" title="{PIC_INFO_TITLE}"><img src="images/info.gif" width="16" height="16" border="0" align="absmiddle" alt="{PIC_INFO_TITLE}" /></a>
598
                </td>
599
                <td align="center" valign="middle" class="navmenu" width="48">
600
                        <a href="{SLIDESHOW_TGT}" title="{SLIDESHOW_TITLE}"><img src="images/slideshow.gif" width="16" height="16" border="0" align="absmiddle" alt="{SLIDESHOW_TITLE}" /></a>
601
                </td>
602
                <td align="center" valign="middle" class="navmenu" witdh="100%">
603
                        {PIC_POS}
604
                </td>
605
                <td align="center" valign="middle" class="navmenu" width="48">
606
                        <a href="{ECARD_TGT}" title="{ECARD_TITLE}"><img src="images/ecard.gif" width="16" height="16" border="0" align="absmiddle" alt="{ECARD_TITLE}"></a>
607
                </td>
608
                <td align="center" valign="middle" class="navmenu" width="48">
609
                        <a href="{PREV_TGT}" class="navmenu_pic" title="{PREV_TITLE}"><img src="images/prev.gif" width="16" height="16" border="0" align="absmiddle" alt="{PREV_TITLE}" /></a>
610
                </td>
611
                <td align="center" valign="middle" class="navmenu" width="48">
612
                        <a href="{NEXT_TGT}" class="navmenu_pic" title="{NEXT_TITLE}"><img src="images/next.gif" width="16" height="16" border="0" align="absmiddle" alt="{NEXT_TITLE}" /></a>
613
                </td>
614
        </tr>
615
 
616
EOT;
617
// HTML template for intermediate image display
618
$template_display_picture = <<<EOT
619
        <tr>
620
                <td align="center" class="tableb" height="{CELL_HEIGHT}" style="white-space: nowrap; padding: 0px;">
621
                        <table cellspacing="2" cellpadding="0" class="imageborder">
622
                                <tr>
623
                                        <td align="center">
624
                                                {IMAGE}
625
                                                {ADMIN_MENU}
626
                                        </td>
627
                                </tr>
628
                        </table>
629
<!-- BEGIN img_desc -->
630
                        <table cellpadding="0" cellspacing="0" class="img_caption_table">
631
<!-- BEGIN title -->
632
                                <tr>
633
                                        <th>
634
                                                {TITLE}
635
                                        </th>
636
                                </tr>
637
<!-- END title -->
638
<!-- BEGIN caption -->
639
                                <tr>
640
                                        <td>
641
                                                {CAPTION}
642
                                        </td>
643
                                </tr>
644
<!-- END caption -->
645
                        </table>
646
<!-- END img_desc -->
647
                </td>
648
        </tr>
649
 
650
EOT;
651
// HTML template for the image rating box
652
$template_image_rating = <<<EOT
653
 
654
        <tr>
655
                <td colspan="6" class="tableh2_compact"><b>{TITLE}</b> {VOTES}</td>
656
        </tr>
657
        <tr>
658
                <td class="tableb_compact" width="17%" align="center"><a href="{RATE0}" title="{RUBBISH}"><img src="themes/rainy_day/images/rating0.gif" alt="{RUBBISH}" border="0" /><br /></a></td>
659
                <td class="tableb_compact" width="17%" align="center"><a href="{RATE1}" title="{POOR}"><img src="themes/rainy_day/images/rating1.gif" alt="{POOR}" border="0" /><br /></a></td>
660
                <td class="tableb_compact" width="17%" align="center"><a href="{RATE2}" title="{FAIR}"><img src="themes/rainy_day/images/rating2.gif" alt="{FAIR}" border="0" /><br /></a></td>
661
                <td class="tableb_compact" width="17%" align="center"><a href="{RATE3}" title="{GOOD}"><img src="themes/rainy_day/images/rating3.gif" alt="{GOOD}" border="0" /><br /></a></td>
662
                <td class="tableb_compact" width="17%" align="center"><a href="{RATE4}" title="{EXCELLENT}"><img src="themes/rainy_day/images/rating4.gif" alt="{EXCELLENT}" border="0" /><br /></a></td>
663
                <td class="tableb_compact" width="17%" align="center"><a href="{RATE5}" title="{GREAT}"><img src="themes/rainy_day/images/rating5.gif" alt="{GREAT}" border="0" /><br /></a></td>
664
        </tr>
665
 
666
EOT;
667
// HTML template for the display of comments
668
$template_image_comments = <<<EOT
669
 
670
        <tr>
671
                <td>
672
                        <table width="100%" cellpadding="0" cellspacing="0">
673
                                <td class="tableh2_compact" nowrap>
674
                                        <b>{MSG_AUTHOR}</b>
675
<!-- BEGIN ipinfo -->
676
                                                                                 ({HDR_IP} [{RAW_IP}])
677
<!-- END ipinfo -->
678
                                </td>
679
                                <td class="tableh2_compact" align="right" width="100%">
680
<!-- BEGIN buttons -->
681
                                        <a href="javascript:;" onClick="blocking('cbody{MSG_ID}','', 'block'); blocking('cedit{MSG_ID}','', 'block'); return false;" title="{EDIT_TITLE}"><img src="images/edit.gif" border="0" align="absmiddle" ></a>
682
                                        <a href="delete.php?msg_id={MSG_ID}&what=comment"  onclick="return confirm('{CONFIRM_DELETE}');"><img src="images/delete.gif" border="0" align="absmiddle" ></a>
683
<!-- END buttons -->
684
                                </td>
685
                                <td class="tableh2_compact" align="right" nowrap>
686
                                        <span class="comment_date">[{MSG_DATE}]</span>
687
                                </td>
688
                        </table>
689
                </td>
690
        </tr>
691
        <tr>
692
                <td class="tableb_compact">
693
                        <div id="cbody{MSG_ID}" style="display:block">
694
                                {MSG_BODY}
695
                        </div>
696
                        <div id="cedit{MSG_ID}" style="display:none">
697
<!-- BEGIN edit_box_smilies -->
698
                                <table width="100%" cellpadding="0" cellspacing="0">
699
 
700
                                                <form name="f{MSG_ID}" method="POST" action="db_input.php">
701
                                                <input type="hidden" name="event" value="comment_update">
702
                                                <input type="hidden" name="msg_id" value="{MSG_ID}">
703
                                                <tr>
704
                                                <td>
705
                                                   <input type=text name=msg_author value="{MSG_AUTHOR}" class="textinput" size="25">
706
                                                </td>
707
                                                </tr>
708
                                                <tr>
709
                                                <td width="80%">
710
                                                        <textarea cols="40" rows="2" class="textinput" name="msg_body" onselect="storeCaret_f{MSG_ID}(this);" onclick="storeCaret_f{MSG_ID}(this);" onkeyup="storeCaret_f{MSG_ID}(this);" style="width: 100%;">{MSG_BODY_RAW}</textarea>
711
                                                </td>
712
                                                <td class="tableb_compact">
713
                                                </td>
714
                                                <td>
715
                                                        <input type="submit" class="comment_button" name="submit" value="{OK}">
716
                                                </td>
717
                                                </form>
718
                                        </tr>
719
                                        <tr>
720
                                                <td colspan="3"><img src="images/spacer.gif" width="1" height="2" /><br /></td>
721
                                        </tr>
722
                                </table>
723
                                {SMILIES}
724
<!-- END edit_box_smilies -->
725
<!-- BEGIN edit_box_no_smilies -->
726
                                <table width="100%" cellpadding="0" cellspacing="0">
727
                                        <tr>
728
                                                <form name="f{MSG_ID}" method="POST" action="db_input.php">
729
                                                <input type="hidden" name="event" value="comment_update">
730
                                                <input type="hidden" name="msg_id" value="{MSG_ID}">
731
                                                <td>
732
                                                <input type=text name=msg_author value="{MSG_AUTHOR}" class="textinput" size="25">
733
                                                </td>
734
                                        </tr>
735
                                        <tr>
736
                                                <td width="100%">
737
                                                        <textarea cols="40" rows="2" class="textinput" name="msg_body" style="width: 100%;">{MSG_BODY_RAW}</textarea>
738
                                                </td>
739
                                                <td class="tableb_compact">
740
                                                </td>
741
                                                <td>
742
                                                        <input type="submit" class="comment_button" name="submit" value="{OK}">
743
                                                </td>
744
                                                </form>
745
                                        </tr>
746
                                        <tr>
747
                                                <td colspan="3"><img src="images/spacer.gif" width="1" height="2" /><br /></td>
748
                                        </tr>
749
                                </table>
750
<!-- END edit_box_no_smilies -->
751
                        </div>
752
                </td>
753
        </tr>
754
 
755
EOT;
756
 
757
$template_add_your_comment = <<<EOT
758
 
759
        <tr>
760
                <td class="tableh2_compact"><b>{ADD_YOUR_COMMENT}</b></td>
761
        </tr>
762
        <tr>
763
                <form method="post" name="post" action="db_input.php">
764
                <td colspan="3">
765
                        <table width="100%" cellpadding="0" cellspacing="0">
766
                                <input type="hidden" name="event" value="comment">
767
                                <input type="hidden" name="pid" value="{PIC_ID}">
768
<!-- BEGIN user_name_input -->
769
                                <td class="tableb_compact">
770
                          {NAME}
771
                 </td>
772
                 <td class="tableb_compact">
773
                                        <input type="text" class="textinput" name="msg_author" size="10" maxlength="20" value="{USER_NAME}">
774
                                </td>
775
<!-- END user_name_input -->
776
<!-- BEGIN input_box_smilies -->
777
                <td class="tableb_compact">
778
                {COMMENT} </td>
779
                                <td width="100%" class="tableb_compact">
780
                                <input type="text" class="textinput" id="message" name="msg_body" onselect="storeCaret_post(this);" onclick="storeCaret_post(this);" onkeyup="storeCaret_post(this);" maxlength="{MAX_COM_LENGTH}" style="width: 100%;">                                        <!-- END input_box_smilies -->
781
<!-- BEGIN input_box_no_smilies -->
782
                                <input type="text" class="textinput" id="message" name="msg_body"  maxlength="{MAX_COM_LENGTH}" style="width: 100%;">
783
<!-- END input_box_no_smilies -->
784
                                </td>
785
                                <td class="tableb_compact">
786
                                <input type="submit" class="comment_button" name="submit" value="{OK}">
787
                                </td>
788
                        </table>
789
                </td>
790
                </form>
791
        </tr>
792
<!-- BEGIN smilies -->
793
        <tr>
794
                <td width="100%" class="tableb_compact">
795
                        {SMILIES}
796
                </td>
797
        </tr>
798
<!-- END smilies -->
799
 
800
EOT;
801
// HTML template used by the cpg_die function
802
$template_cpg_die = <<<EOT
803
 
804
        <tr>
805
                <td class="tableb" height="300" align="center">
806
                        <font size="3"><b>{MESSAGE}</b></font>
807
<!-- BEGIN file_line -->
808
                        <br />
809
                        <br />
810
                        {FILE_TXT}{FILE} - {LINE_TXT}{LINE}
811
<!-- END file_line -->
812
<!-- BEGIN output_buffer -->
813
                        <br />
814
                        <br />
815
                        <div align="left">
816
                                {OUTPUT_BUFFER}
817
                        </div>
818
<!-- END output_buffer -->
819
                        <br /><br />
820
                </td>
821
        </tr>
822
 
823
 
824
EOT;
825
// HTML template used by the msg_box function
826
$template_msg_box = <<<EOT
827
 
828
        <tr>
829
                <td class="tableb" height="150" align="center">
830
                        <font size="3"><b>{MESSAGE}</b></font>
831
                </td>
832
        </tr>
833
<!-- BEGIN button -->
834
                <tr>
835
                        <td align="center" class="tablef">
836
                                <table cellpadding="0" cellspacing="0">
837
                                        <tr>
838
                                                <td class="admin_menu">
839
                                                        <a href="{LINK}">{TEXT}</a>
840
                                                </td>
841
                                        </tr>
842
                                </table>
843
                        </td>
844
                </tr>
845
<!-- END button -->
846
 
847
EOT;
848
// HTML template for e-cards
849
$template_ecard = <<<EOT
850
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
851
<html dir="{LANG_DIR}">
852
<head>
853
<title>{TITLE}</title>
854
<meta http-equiv="content-type" content="text/html; charset={CHARSET}" />
855
</head>
856
<body bgcolor="#FFFFFF" text="#0F5475" link="#0F5475" vlink="#0F5475" alink="#0F5475">
857
<br />
858
<p align="center"><a href="{VIEW_ECARD_TGT}"><b>{VIEW_ECARD_LNK}</b></a></p>
859
<table border="0" cellspacing="0" cellpadding="1" align="center">
860
  <tr>
861
    <td bgcolor="#000000">
862
      <table border="0" cellspacing="0" cellpadding="10" bgcolor="#ffffff">
863
        <tr>
864
          <td valign="top">
865
           <img src="{PIC_URL}" border="1" alt="" /><br />
866
          </td>
867
          <td valign="top" width="200" height="250">
868
            <div align="right"><img src="{URL_PREFIX}images/stamp.gif" alt="" border="0" /></div>
869
            <br />
870
            <b><font face="arial" color="#000000" size="4">{GREETINGS}</font></b>
871
            <br />
872
            <br />
873
            <font face="arial" color="#000000" size="2">{MESSAGE}</font>
874
            <br />
875
            <br />
876
            <font face="arial" color="#000000" size="2">{SENDER_NAME}</font>
877
            (<a href="mailto:{SENDER_EMAIL}"><font face="arial" color="#000000" size="2">{SENDER_EMAIL}</font></a>)
878
          </td>
879
        </tr>
880
      </table>
881
    </td>
882
  </tr>
883
</table>
884
<p align="center"><a href="{VIEW_MORE_TGT}"><b>{VIEW_MORE_LNK}</b></a></p>
885
</body>
886
</html>
887
EOT;
888
// Template used for tabbed display
889
$template_tab_display = array('left_text' => '<td width="100%%" align="left" valign="middle" class="tableh1_compact" style="white-space: nowrap"><b>{LEFT_TEXT}</b></td>' . "\n",
890
    'tab_header' => '',
891
    'tab_trailer' => '',
892
    'active_tab' => '<td><img src="images/spacer.gif" width="1" height="1"></td>' . "\n" . '<td align="center" valign="middle" class="tableb_compact"><b>%d</b></td>',
893
    'inactive_tab' => '<td><img src="images/spacer.gif" width="1" height="1"></td>' . "\n" . '<td align="center" valign="middle" class="navmenu"><a href="{LINK}"><b>%d</b></a></td>' . "\n"
894
    );
895
 
896
function pageheader($section, $meta = '')
897
{
898
    global $CONFIG, $THEME_DIR;
899
    global $template_header, $lang_charset, $lang_text_dir;
900
 
901
    $charset = ($CONFIG['charset'] == 'language file') ? $lang_charset : $CONFIG['charset'];
902
 
903
    header('P3P: CP="CAO DSP COR CURa ADMa DEVa OUR IND PHY ONL UNI COM NAV INT DEM PRE"');
904
    header("Content-Type: text/html; charset=$charset");
905
    user_save_profile();
906
 
907
    $template_vars = array('{LANG_DIR}' => $lang_text_dir,
908
        '{TITLE}' => $CONFIG['gallery_name'] . ' - ' . $section,
909
        '{CHARSET}' => $charset,
910
        '{META}' => $meta,
911
        '{GAL_NAME}' => $CONFIG['gallery_name'],
912
        '{GAL_DESCRIPTION}' => $CONFIG['gallery_description'],
913
        '{MAIN_MENU1}' => theme_main_menu1(),
914
        '{MAIN_MENU2}' => theme_main_menu2(),
915
        '{ADMIN_MENU}' => theme_admin_mode_menu()
916
        );
917
 
918
    echo template_eval($template_header, $template_vars);
919
}
920
// Function for writing a pagefooter
921
function pagefooter()
922
{
923
    global $HTTP_GET_VARS, $HTTP_POST_VARS, $HTTP_SERVER_VARS;
924
    global $USER, $ALBUM_SET, $CONFIG, $time_start, $query_stats;
925
    global $template_footer;
926
 
927
    if ($CONFIG['debug_mode']==1 || ($CONFIG['debug_mode']==2 && GALLERY_ADMIN_MODE)) {
928
    cpg_debug_output();
929
    }
930
 
931
    echo $template_footer;
932
}
933
// Function to start a 'standard' table
934
function starttable($width = '-1', $title = '', $title_colspan = '1')
935
{
936
    global $CONFIG;
937
 
938
    if ($width == '-1') $width = $CONFIG['picture_table_width'];
939
    if ($width == '100%') $width = $CONFIG['main_table_width'];
940
    echo <<<EOT
941
 
942
<!-- Start standard table -->
943
<table align="center" width="$width" cellspacing="1" cellpadding="0" class="maintable">
944
 
945
EOT;
946
    if ($title) {
947
        echo <<<EOT
948
        <tr>
949
                <td class="tableh1" colspan="$title_colspan"><h2>$title</h2></td>
950
        </tr>
951
 
952
EOT;
953
    }
954
}
955
 
956
function endtable()
957
{
958
    echo <<<EOT
959
</table>
960
<!-- End standard table -->
961
 
962
EOT;
963
}
964
 
965
function theme_main_menu1()
966
{
967
    global $CONFIG, $album, $actual_cat, $cat, $REFERER, $HTTP_SERVER_VARS;
968
    global $lang_main_menu, $template_main_menu1;
969
 
970
    static $main_menu = '';
971
 
972
    if ($main_menu != '') return $main_menu;
973
 
974
    $album_l = isset($album) ? "?album=$album" : '';
975
    $cat_l = (isset($actual_cat))? "?cat=$actual_cat" : (isset($cat) ? "?cat=$cat" : '');
976
    $my_gallery_id = FIRST_USER_CAT + USER_ID;
977
 
978
    $template_main_menu = &$template_main_menu1;
979
 
980
    if (USER_ID) {
981
        template_extract_block($template_main_menu, 'login');
982
    } else {
983
        template_extract_block($template_main_menu, 'logout');
984
        template_extract_block($template_main_menu, 'my_profile');
985
    }
986
 
987
    if (GALLERY_ADMIN_MODE || USER_ADMIN_MODE) {
988
        template_extract_block($template_main_menu, 'enter_admin_mode');
989
    } elseif (USER_CAN_CREATE_ALBUMS || USER_IS_ADMIN) {
990
        template_extract_block($template_main_menu, 'leave_admin_mode');
991
    }
992
 
993
    if (!USER_CAN_CREATE_ALBUMS && !USER_IS_ADMIN) {
994
        template_extract_block($template_main_menu, 'enter_admin_mode');
995
        template_extract_block($template_main_menu, 'leave_admin_mode');
996
    }
997
 
998
    if (!USER_CAN_CREATE_ALBUMS) {
999
        template_extract_block($template_main_menu, 'my_gallery');
1000
    }
1001
 
1002
    if (USER_CAN_CREATE_ALBUMS) {
1003
        template_extract_block($template_main_menu, 'my_profile');
1004
    }
1005
 
1006
    if (!USER_CAN_UPLOAD_PICTURES) {
1007
        template_extract_block($template_main_menu, 'upload_pic');
1008
    }
1009
 
1010
    if (USER_ID || !$CONFIG['allow_user_registration']) {
1011
        template_extract_block($template_main_menu, 'register');
1012
    }
1013
 
1014
    if (!USER_ID || !$CONFIG['allow_memberlist']) {
1015
        template_extract_block($template_main_menu, 'allow_memberlist');
1016
    }
1017
 
1018
    if (!$CONFIG['display_faq']) {
1019
        template_extract_block($template_main_menu, 'faq');
1020
    }
1021
 
1022
    $param = array('{MY_GAL_TGT}' => "index.php?cat=$my_gallery_id",
1023
        '{MY_GAL_TITLE}' => $lang_main_menu['my_gal_title'],
1024
        '{MY_GAL_LNK}' => $lang_main_menu['my_gal_lnk'],
1025
        '{MEMBERLIST_TGT}' => "usermgr.php",
1026
        '{MEMBERLIST_TITLE}' => $lang_main_menu['memberlist_title'],
1027
        '{MEMBERLIST_LNK}' => $lang_main_menu['memberlist_lnk'],
1028
        '{MY_PROF_TGT}' => "profile.php?op=edit_profile",
1029
        '{MY_PROF_LNK}' => $lang_main_menu['my_prof_lnk'],
1030
        '{FAQ_TGT}' => "faq.php",
1031
        '{FAQ_TITLE}' => $lang_main_menu['faq_title'],
1032
        '{FAQ_LNK}' => $lang_main_menu['faq_lnk'],
1033
        '{ADM_MODE_TGT}' => "admin.php?admin_mode=1&referer=$REFERER",
1034
        '{ADM_MODE_TITLE}' => $lang_main_menu['adm_mode_title'],
1035
        '{ADM_MODE_LNK}' => $lang_main_menu['adm_mode_lnk'],
1036
        '{USR_MODE_TGT}' => "admin.php?admin_mode=0&referer=$REFERER",
1037
        '{USR_MODE_TITLE}' => $lang_main_menu['usr_mode_title'],
1038
        '{USR_MODE_LNK}' => $lang_main_menu['usr_mode_lnk'],
1039
        '{UPL_PIC_TGT}' => "upload.php",
1040
        '{UPL_PIC_TITLE}' => $lang_main_menu['upload_pic_title'],
1041
        '{UPL_PIC_LNK}' => $lang_main_menu['upload_pic_lnk'],
1042
        '{REGISTER_TGT}' => "register.php",
1043
        '{REGISTER_TITLE}' => $lang_main_menu['register_title'],
1044
        '{REGISTER_LNK}' => $lang_main_menu['register_lnk'],
1045
        '{LOGIN_TGT}' => "login.php?referer=$REFERER",
1046
        '{LOGIN_LNK}' => $lang_main_menu['login_lnk'],
1047
        '{LOGOUT_TGT}' => "logout.php?referer=$REFERER",
1048
        '{LOGOUT_LNK}' => $lang_main_menu['logout_lnk'] . " [" . USER_NAME . "]",
1049
        );
1050
 
1051
    $main_menu = template_eval($template_main_menu, $param);
1052
    return $main_menu;
1053
}
1054
 
1055
function theme_main_menu2()
1056
{
1057
    global $CONFIG, $album, $actual_cat, $cat, $REFERER, $HTTP_SERVER_VARS;
1058
    global $lang_main_menu, $template_main_menu2;
1059
 
1060
    static $main_menu = '';
1061
 
1062
    if ($main_menu != '') return $main_menu;
1063
 
1064
    $cat_l = isset($actual_cat) ? "?cat=$actual_cat" : (isset($cat) ? "?cat=$cat" : '');
1065
    $cat_l2 = isset($cat) ? "&cat=$cat" : '';
1066
 
1067
    $template_main_menu = &$template_main_menu2;
1068
 
1069
    $param = array('{ALB_LIST_TGT}' => "index.php$cat_l",
1070
        '{ALB_LIST_TITLE}' => $lang_main_menu['alb_list_title'],
1071
        '{ALB_LIST_LNK}' => $lang_main_menu['alb_list_lnk'],
1072
        '{LASTUP_TGT}' => "thumbnails.php?album=lastup$cat_l2",
1073
        '{LASTUP_LNK}' => $lang_main_menu['lastup_lnk'],
1074
        '{LASTCOM_TGT}' => "thumbnails.php?album=lastcom$cat_l2",
1075
        '{LASTCOM_LNK}' => $lang_main_menu['lastcom_lnk'],
1076
        '{TOPN_TGT}' => "thumbnails.php?album=topn$cat_l2",
1077
        '{TOPN_LNK}' => $lang_main_menu['topn_lnk'],
1078
        '{TOPRATED_TGT}' => "thumbnails.php?album=toprated$cat_l2",
1079
        '{TOPRATED_LNK}' => $lang_main_menu['toprated_lnk'],
1080
        '{FAV_TGT}' => "thumbnails.php?album=favpics",
1081
        '{FAV_LNK}' => $lang_main_menu['fav_lnk'],
1082
        '{SEARCH_TGT}' => "search.php",
1083
        '{SEARCH_LNK}' => $lang_main_menu['search_lnk'],
1084
        );
1085
 
1086
    $main_menu = template_eval($template_main_menu, $param);
1087
    return $main_menu;
1088
}
1089
 
1090
function theme_admin_mode_menu()
1091
{
1092
    global $cat;
1093
    global $lang_gallery_admin_menu, $lang_user_admin_menu;
1094
    global $template_gallery_admin_menu, $template_user_admin_menu;
1095
 
1096
    $cat_l = isset($cat) ? "?cat=$cat" : '';
1097
 
1098
    if (GALLERY_ADMIN_MODE) {
1099
        $param = array('{CATL}' => $cat_l,
1100
            '{UPL_APP_LNK}' => $lang_gallery_admin_menu['upl_app_lnk'],
1101
            '{CONFIG_LNK}' => $lang_gallery_admin_menu['config_lnk'],
1102
            '{ALBUMS_LNK}' => $lang_gallery_admin_menu['albums_lnk'],
1103
            '{CATEGORIES_LNK}' => $lang_gallery_admin_menu['categories_lnk'],
1104
            '{USERS_LNK}' => $lang_gallery_admin_menu['users_lnk'],
1105
            '{GROUPS_LNK}' => $lang_gallery_admin_menu['groups_lnk'],
1106
            '{COMMENTS_LNK}' => $lang_gallery_admin_menu['comments_lnk'],
1107
            '{SEARCHNEW_LNK}' => $lang_gallery_admin_menu['searchnew_lnk'],
1108
            '{MY_PROF_LNK}' => $lang_user_admin_menu['my_prof_lnk'],
1109
            '{UTIL_LNK}' => $lang_gallery_admin_menu['util_lnk'],
1110
            '{BAN_LNK}' => $lang_gallery_admin_menu['ban_lnk'],
1111
            '{DB_ECARD_LNK}' => $lang_gallery_admin_menu['db_ecard_lnk'],
1112
            );
1113
 
1114
        $html = template_eval($template_gallery_admin_menu, $param);
1115
    } elseif (USER_ADMIN_MODE) {
1116
        $param = array('{ALBMGR_LNK}' => $lang_user_admin_menu['albmgr_lnk'],
1117
            '{MODIFYALB_LNK}' => $lang_user_admin_menu['modifyalb_lnk'],
1118
            '{MY_PROF_LNK}' => $lang_user_admin_menu['my_prof_lnk']
1119
            );
1120
 
1121
        $html = template_eval($template_user_admin_menu, $param);
1122
    } else {
1123
        $html = '';
1124
    }
1125
 
1126
    return $html;
1127
}
1128
 
1129
function theme_display_cat_list($breadcrumb, &$cat_data, $statistics)
1130
{
1131
    global $template_cat_list, $lang_cat_list;
1132
 
1133
    starttable('100%');
1134
 
1135
    if (count($cat_data) > 0) {
1136
        $template = template_extract_block($template_cat_list, 'header');
1137
        $params = array('{CATEGORY}' => $lang_cat_list['category'],
1138
            '{ALBUMS}' => $lang_cat_list['albums'],
1139
            '{PICTURES}' => $lang_cat_list['pictures'],
1140
            );
1141
        echo template_eval($template, $params);
1142
    }
1143
 
1144
    $template_noabl = template_extract_block($template_cat_list, 'catrow_noalb');
1145
    $template = template_extract_block($template_cat_list, 'catrow');
1146
    foreach($cat_data as $category) {
1147
        if (count($category) == 3) {
1148
            $params = array('{CAT_TITLE}' => $category[0],
1149
                '{CAT_THUMB}' => $category['cat_thumb'],
1150
                '{CAT_DESC}' => $category[1]
1151
                );
1152
            echo template_eval($template_noabl, $params);
1153
        } else {
1154
            $params = array('{CAT_TITLE}' => $category[0],
1155
                '{CAT_THUMB}' => $category['cat_thumb'],
1156
                '{CAT_DESC}' => $category[1],
1157
                '{CAT_ALBUMS}' => $category['cat_albums'],
1158
                '{ALB_COUNT}' => $category[2],
1159
                '{PIC_COUNT}' => $category[3],
1160
                );
1161
            echo template_eval($template, $params);
1162
        }
1163
    }
1164
 
1165
    if ($statistics && count($cat_data) > 0) {
1166
        $template = template_extract_block($template_cat_list, 'footer');
1167
        $params = array('{STATISTICS}' => $statistics);
1168
        echo template_eval($template, $params);
1169
    }
1170
    endtable();
1171
 
1172
    if (count($cat_data) > 0)
1173
        echo template_extract_block($template_cat_list, 'spacer');
1174
}
1175
 
1176
function theme_display_breadcrumb($breadcrumb, &$cat_data)
1177
{
1178
    /**
1179
     * ** added breadcrumb as a seperate element
1180
     */
1181
    global $template_breadcrumb, $lang_breadcrumb;
1182
 
1183
    starttable('100%');
1184
    if ($breadcrumb) {
1185
        $template = template_extract_block($template_breadcrumb, 'breadcrumb');
1186
        $params = array('{BREADCRUMB}' => $breadcrumb
1187
            );
1188
        echo template_eval($template, $params);
1189
    }
1190
    endtable();
1191
}
1192
 
1193
function theme_display_album_list(&$alb_list, $nbAlb, $cat, $page, $total_pages)
1194
{
1195
    global $CONFIG, $STATS_IN_ALB_LIST, $statistics, $template_tab_display, $template_album_list, $lang_album_list;
1196
 
1197
    $theme_alb_list_tab_tmpl = $template_tab_display;
1198
 
1199
    $theme_alb_list_tab_tmpl['left_text'] = strtr($theme_alb_list_tab_tmpl['left_text'], array('{LEFT_TEXT}' => $lang_album_list['album_on_page']));
1200
    $theme_alb_list_tab_tmpl['inactive_tab'] = strtr($theme_alb_list_tab_tmpl['inactive_tab'], array('{LINK}' => 'index.php?cat=' . $cat . '&page=%d'));
1201
 
1202
    $tabs = create_tabs($nbAlb, $page, $total_pages, $theme_alb_list_tab_tmpl);
1203
 
1204
    $album_cell = template_extract_block($template_album_list, 'album_cell');
1205
    $empty_cell = template_extract_block($template_album_list, 'empty_cell');
1206
    $tabs_row = template_extract_block($template_album_list, 'tabs');
1207
    $stat_row = template_extract_block($template_album_list, 'stat_row');
1208
    $spacer = template_extract_block($template_album_list, 'spacer');
1209
    $header = template_extract_block($template_album_list, 'header');
1210
    $footer = template_extract_block($template_album_list, 'footer');
1211
    $rows_separator = template_extract_block($template_album_list, 'row_separator');
1212
 
1213
    $count = 0;
1214
 
1215
    $columns = $CONFIG['album_list_cols'];
1216
    $column_width = ceil(100 / $columns);
1217
    $thumb_cell_width = $CONFIG['alb_list_thumb_size'] + 2;
1218
 
1219
    starttable('100%');
1220
 
1221
    if ($STATS_IN_ALB_LIST) {
1222
        $params = array('{STATISTICS}' => $statistics,
1223
            '{COLUMNS}' => $columns,
1224
            );
1225
        echo template_eval($stat_row, $params);
1226
    }
1227
 
1228
    echo $header;
1229
    if (is_array($alb_list)) {
1230
        foreach($alb_list as $album) {
1231
                $count ++;
1232
 
1233
                $params = array('{COL_WIDTH}' => $column_width,
1234
                '{ALBUM_TITLE}' => $album['album_title'],
1235
                '{THUMB_CELL_WIDTH}' => $thumb_cell_width,
1236
                '{ALB_LINK_TGT}' => "thumbnails.php?album={$album['aid']}",
1237
                '{ALB_LINK_PIC}' => $album['thumb_pic'],
1238
                '{ADMIN_MENU}' => $album['album_adm_menu'],
1239
                '{ALB_DESC}' => $album['album_desc'],
1240
                '{ALB_INFOS}' => $album['album_info'],
1241
                );
1242
 
1243
                echo template_eval($album_cell, $params);
1244
 
1245
                if ($count % $columns == 0 && $count < count($alb_list)) {
1246
                echo $rows_separator;
1247
                }
1248
        }
1249
    }
1250
 
1251
    $params = array('{COL_WIDTH}' => $column_width);
1252
    $empty_cell = template_eval($empty_cell, $params);
1253
 
1254
    while ($count++ % $columns != 0) {
1255
        echo $empty_cell;
1256
    }
1257
 
1258
    echo $footer;
1259
    // Tab display
1260
    $params = array('{COLUMNS}' => $columns,
1261
        '{TABS}' => $tabs,
1262
        );
1263
    echo template_eval($tabs_row, $params);
1264
 
1265
    endtable();
1266
 
1267
    echo $spacer;
1268
}
1269
// Function to display first level Albums of a category
1270
function theme_display_album_list_cat(&$alb_list, $nbAlb, $cat, $page, $total_pages)
1271
{
1272
    global $CONFIG, $STATS_IN_ALB_LIST, $statistics, $template_tab_display, $template_album_list_cat, $lang_album_list;
1273
    if (!$CONFIG['first_level']) {
1274
        return;
1275
    }
1276
    // $theme_alb_list_tab_tmpl = $template_tab_display;
1277
    // $theme_alb_list_tab_tmpl['left_text'] = strtr($theme_alb_list_tab_tmpl['left_text'],array('{LEFT_TEXT}' => $lang_album_list['album_on_page']));
1278
    // $theme_alb_list_tab_tmpl['inactive_tab'] = strtr($theme_alb_list_tab_tmpl['inactive_tab'],array('{LINK}' => 'index.php?cat='.$cat.'&page=%d'));
1279
    // $tabs = create_tabs($nbAlb, $page, $total_pages, $theme_alb_list_tab_tmpl);
1280
    // echo $template_album_list_cat;
1281
    $template_album_list_cat1 = $template_album_list_cat;
1282
    $album_cell = template_extract_block($template_album_list_cat1, 'c_album_cell');
1283
    $empty_cell = template_extract_block($template_album_list_cat1, 'c_empty_cell');
1284
    $tabs_row = template_extract_block($template_album_list_cat1, 'c_tabs');
1285
    $stat_row = template_extract_block($template_album_list_cat1, 'c_stat_row');
1286
    $spacer = template_extract_block($template_album_list_cat1, 'c_spacer');
1287
    $header = template_extract_block($template_album_list_cat1, 'c_header');
1288
    $footer = template_extract_block($template_album_list_cat1, 'c_footer');
1289
    $rows_separator = template_extract_block($template_album_list_cat1, 'c_row_separator');
1290
 
1291
    $count = 0;
1292
 
1293
    $columns = $CONFIG['album_list_cols'];
1294
    $column_width = ceil(100 / $columns);
1295
    $thumb_cell_width = $CONFIG['alb_list_thumb_size'] + 2;
1296
 
1297
    starttable('100%');
1298
 
1299
    if ($STATS_IN_ALB_LIST) {
1300
        $params = array('{STATISTICS}' => $statistics,
1301
            '{COLUMNS}' => $columns,
1302
            );
1303
        echo template_eval($stat_row, $params);
1304
    }
1305
 
1306
    echo $header;
1307
        if (is_array($alb_list)) {
1308
                foreach($alb_list as $album) {
1309
                        $count ++;
1310
 
1311
                        $params = array('{COL_WIDTH}' => $column_width,
1312
                        '{ALBUM_TITLE}' => $album['album_title'],
1313
                        '{THUMB_CELL_WIDTH}' => $thumb_cell_width,
1314
                        '{ALB_LINK_TGT}' => "thumbnails.php?album={$album['aid']}",
1315
                        '{ALB_LINK_PIC}' => $album['thumb_pic'],
1316
                        '{ADMIN_MENU}' => $album['album_adm_menu'],
1317
                        '{ALB_DESC}' => $album['album_desc'],
1318
                        '{ALB_INFOS}' => $album['album_info'],
1319
                        );
1320
 
1321
                        echo template_eval($album_cell, $params);
1322
 
1323
                        if ($count % $columns == 0 && $count < count($alb_list)) {
1324
                        echo $rows_separator;
1325
                        }
1326
                }
1327
        }
1328
    $params = array('{COL_WIDTH}' => $column_width);
1329
    $empty_cell = template_eval($empty_cell, $params);
1330
 
1331
    while ($count++ % $columns != 0) {
1332
        echo $empty_cell;
1333
    }
1334
 
1335
    echo $footer;
1336
    // Tab display
1337
    $params = array('{COLUMNS}' => $columns,
1338
        '{TABS}' => $tabs,
1339
        );
1340
    echo template_eval($tabs_row, $params);
1341
 
1342
    endtable();
1343
 
1344
    echo $spacer;
1345
}
1346
 
1347
function theme_display_thumbnails(&$thumb_list, $nbThumb, $album_name, $aid, $cat, $page, $total_pages, $sort_options, $display_tabs, $mode = 'thumb')
1348
{
1349
    global $CONFIG;
1350
    global $template_thumb_view_title_row, $template_fav_thumb_view_title_row, $lang_thumb_view, $template_tab_display, $template_thumbnail_view;
1351
 
1352
    static $header = '';
1353
    static $thumb_cell = '';
1354
    static $empty_cell = '';
1355
    static $row_separator = '';
1356
    static $footer = '';
1357
    static $tabs = '';
1358
    static $spacer = '';
1359
 
1360
    if ($header == '') {
1361
        $thumb_cell = template_extract_block($template_thumbnail_view, 'thumb_cell');
1362
        $tabs = template_extract_block($template_thumbnail_view, 'tabs');
1363
        $header = template_extract_block($template_thumbnail_view, 'header');
1364
        $empty_cell = template_extract_block($template_thumbnail_view, 'empty_cell');
1365
        $row_separator = template_extract_block($template_thumbnail_view, 'row_separator');
1366
        $footer = template_extract_block($template_thumbnail_view, 'footer');
1367
        $spacer = template_extract_block($template_thumbnail_view, 'spacer');
1368
    }
1369
 
1370
    $cat_link = is_numeric($aid) ? '' : '&cat=' . $cat;
1371
 
1372
    $theme_thumb_tab_tmpl = $template_tab_display;
1373
 
1374
    if ($mode == 'thumb') {
1375
        $theme_thumb_tab_tmpl['left_text'] = strtr($theme_thumb_tab_tmpl['left_text'], array('{LEFT_TEXT}' => $lang_thumb_view['pic_on_page']));
1376
        $theme_thumb_tab_tmpl['inactive_tab'] = strtr($theme_thumb_tab_tmpl['inactive_tab'], array('{LINK}' => 'thumbnails.php?album=' . $aid . $cat_link . '&page=%d'));
1377
    } else {
1378
        $theme_thumb_tab_tmpl['left_text'] = strtr($theme_thumb_tab_tmpl['left_text'], array('{LEFT_TEXT}' => $lang_thumb_view['user_on_page']));
1379
        $theme_thumb_tab_tmpl['inactive_tab'] = strtr($theme_thumb_tab_tmpl['inactive_tab'], array('{LINK}' => 'index.php?cat=' . $cat . '&page=%d'));
1380
    }
1381
 
1382
    $thumbcols = $CONFIG['thumbcols'];
1383
    $cell_width = ceil(100 / $CONFIG['thumbcols']) . '%';
1384
 
1385
    $tabs_html = $display_tabs ? create_tabs($nbThumb, $page, $total_pages, $theme_thumb_tab_tmpl) : '';
1386
    // The sort order options are not available for meta albums
1387
    if ($sort_options) {
1388
        $param = array('{ALBUM_NAME}' => $album_name,
1389
            '{AID}' => $aid,
1390
            '{PAGE}' => $page,
1391
            '{NAME}' => $lang_thumb_view['name'],
1392
            '{TITLE}' => $lang_thumb_view['title'],
1393
            '{DATE}' => $lang_thumb_view['date'],
1394
            '{SORT_TA}' => $lang_thumb_view['sort_ta'],
1395
            '{SORT_TD}' => $lang_thumb_view['sort_td'],
1396
            '{SORT_NA}' => $lang_thumb_view['sort_na'],
1397
            '{SORT_ND}' => $lang_thumb_view['sort_nd'],
1398
            '{SORT_DA}' => $lang_thumb_view['sort_da'],
1399
            '{SORT_DD}' => $lang_thumb_view['sort_dd'],
1400
            );
1401
        $title = template_eval($template_thumb_view_title_row, $param);
1402
    } else if ($aid == 'favpics' && $CONFIG['enable_zipdownload'] == 1) { //Lots of stuff can be added here later
1403
       $param = array('{ALBUM_NAME}' => $album_name,
1404
                             '{DOWNLOAD_ZIP}'=>$lang_thumb_view['download_zip']
1405
                               );
1406
       $title = template_eval($template_fav_thumb_view_title_row, $param);
1407
    } else {
1408
        $title = $album_name;
1409
    }
1410
 
1411
    if ($mode == 'thumb') {
1412
        starttable('100%', $title, $thumbcols);
1413
    } else {
1414
        starttable('100%');
1415
    }
1416
 
1417
    echo $header;
1418
 
1419
    $i = 0;
1420
    foreach($thumb_list as $thumb) {
1421
        $i++;
1422
        if ($mode == 'thumb') {
1423
            if ($aid == 'lastalb') {
1424
                $params = array('{CELL_WIDTH}' => $cell_width,
1425
                    '{LINK_TGT}' => "thumbnails.php?album={$thumb['aid']}",
1426
                    '{THUMB}' => $thumb['image'],
1427
                    '{CAPTION}' => $thumb['caption'],
1428
                    '{ADMIN_MENU}' => $thumb['admin_menu']
1429
                    );
1430
            } else {
1431
                $params = array('{CELL_WIDTH}' => $cell_width,
1432
                    '{LINK_TGT}' => "displayimage.php?album=$aid$cat_link&pos={$thumb['pos']}",
1433
                    '{THUMB}' => $thumb['image'],
1434
                    '{CAPTION}' => $thumb['caption'],
1435
                    '{ADMIN_MENU}' => $thumb['admin_menu']
1436
                    );
1437
            }
1438
        } else {
1439
            $params = array('{CELL_WIDTH}' => $cell_width,
1440
                '{LINK_TGT}' => "index.php?cat={$thumb['cat']}",
1441
                '{THUMB}' => $thumb['image'],
1442
                '{CAPTION}' => $thumb['caption'],
1443
                '{ADMIN_MENU}' => ''
1444
                );
1445
        }
1446
        echo template_eval($thumb_cell, $params);
1447
 
1448
        if ((($i % $thumbcols) == 0) && ($i < count($thumb_list))) {
1449
            echo $row_separator;
1450
        }
1451
    }
1452
    for (;($i % $thumbcols); $i++) {
1453
        echo $empty_cell;
1454
    }
1455
    echo $footer;
1456
 
1457
    if ($display_tabs) {
1458
        $params = array('{THUMB_COLS}' => $thumbcols,
1459
            '{TABS}' => $tabs_html
1460
            );
1461
        echo template_eval($tabs, $params);
1462
    }
1463
 
1464
    endtable();
1465
    echo $spacer;
1466
}
1467
// Added to display flim_strip
1468
function theme_display_film_strip(&$thumb_list, $nbThumb, $album_name, $aid, $cat, $pos, $sort_options, $mode = 'thumb')
1469
{
1470
    global $CONFIG;
1471
    global $template_film_strip, $lang_film_strip;
1472
 
1473
    static $template = '';
1474
    static $thumb_cell = '';
1475
    static $empty_cell = '';
1476
    static $spacer = '';
1477
 
1478
    if ((!$template)) {
1479
        $template = $template_film_strip;
1480
        $thumb_cell = template_extract_block($template, 'thumb_cell');
1481
        $empty_cell = template_extract_block($template, 'empty_cell');
1482
        // $spacer = template_extract_block($template, 'spacer');
1483
    }
1484
 
1485
    if ($header == '') {
1486
    }
1487
 
1488
    $cat_link = is_numeric($aid) ? '' : '&cat=' . $cat;
1489
 
1490
    $theme_thumb_tab_tmpl = $template_tab_display;
1491
 
1492
    if ($mode == 'thumb') {
1493
        $theme_thumb_tab_tmpl['left_text'] = strtr($theme_thumb_tab_tmpl['left_text'], array('{LEFT_TEXT}' => $lang_thumb_view['pic_on_page']));
1494
        $theme_thumb_tab_tmpl['inactive_tab'] = strtr($theme_thumb_tab_tmpl['inactive_tab'], array('{LINK}' => 'thumbnails.php?album=' . $aid . $cat_link . '&page=%d'));
1495
    } else {
1496
        $theme_thumb_tab_tmpl['left_text'] = strtr($theme_thumb_tab_tmpl['left_text'], array('{LEFT_TEXT}' => $lang_thumb_view['user_on_page']));
1497
        $theme_thumb_tab_tmpl['inactive_tab'] = strtr($theme_thumb_tab_tmpl['inactive_tab'], array('{LINK}' => 'index.php?cat=' . $cat . '&page=%d'));
1498
    }
1499
 
1500
    $thumbcols = $CONFIG['thumbcols'];
1501
    $cell_width = ceil(100 / $CONFIG['max_film_strip_items']) . '%';
1502
 
1503
    $i = 0;
1504
    $thumb_strip = '';
1505
    foreach($thumb_list as $thumb) {
1506
        $i++;
1507
        if ($mode == 'thumb') {
1508
            $params = array('{CELL_WIDTH}' => $cell_width,
1509
                '{LINK_TGT}' => "displayimage.php?album=$aid$cat_link&pos={$thumb['pos']}",
1510
                '{THUMB}' => $thumb['image'],
1511
                '{CAPTION}' => '',
1512
                '{ADMIN_MENU}' => ''
1513
                );
1514
        } else {
1515
            $params = array('{CELL_WIDTH}' => $cell_width,
1516
                '{LINK_TGT}' => "index.php?cat={$thumb['cat']}",
1517
                '{THUMB}' => $thumb['image'],
1518
                '{CAPTION}' => '',
1519
                '{ADMIN_MENU}' => ''
1520
                );
1521
        }
1522
        $thumb_strip .= template_eval($thumb_cell, $params);
1523
        // if ((($i % $thumbcols) == 0) && ($i < count($thumb_list))) {
1524
        // echo $row_separator;
1525
        // }
1526
    }
1527
    // for (;($i % $thumbcols); $i++){
1528
    // echo $empty_cell;
1529
    // }
1530
    $params = array('{THUMB_STRIP}' => $thumb_strip,
1531
        '{COLS}' => $i);
1532
 
1533
    ob_start();
1534
    starttable('');
1535
    echo template_eval($template, $params);
1536
    endtable();
1537
    $film_strip = ob_get_contents();
1538
    ob_end_clean();
1539
 
1540
    return $film_strip;
1541
}
1542
 
1543
function theme_no_img_to_display($album_name)
1544
{
1545
    global $lang_errors, $template_no_img_to_display;
1546
 
1547
    static $template = '';
1548
    static $spacer;
1549
 
1550
    if ((!$template)) {
1551
        $template = $template_no_img_to_display;
1552
        $spacer = template_extract_block($template, 'spacer');
1553
    }
1554
 
1555
    $params = array('{TEXT}' => $lang_errors['no_img_to_display']);
1556
    starttable('100%', $album_name);
1557
    echo template_eval($template, $params);
1558
    endtable();
1559
}
1560
 
1561
function theme_display_image($nav_menu, $picture, $votes, $pic_info, $comments, $film_strip)
1562
{
1563
    global $HTTP_COOKIE_VARS, $CONFIG;
1564
 
1565
    starttable();
1566
    echo $nav_menu;
1567
    endtable();
1568
 
1569
    starttable();
1570
    echo $picture;
1571
    endtable();
1572
    if ($CONFIG['display_film_strip'] == 1) {
1573
        echo $film_strip;
1574
    }
1575
    starttable();
1576
    echo $votes;
1577
    endtable();
1578
 
1579
    $picinfo = isset($HTTP_COOKIE_VARS['picinfo']) ? $HTTP_COOKIE_VARS['picinfo'] : ($CONFIG['display_pic_info'] ? 'block' : 'none');
1580
    echo "<div id=\"picinfo\" style=\"display: $picinfo;\">\n";
1581
    starttable();
1582
    echo $pic_info;
1583
    endtable();
1584
    echo "</div>\n";
1585
 
1586
    starttable();
1587
    echo $comments;
1588
    endtable();
1589
}
1590
 
1591
function theme_html_picinfo(&$info)
1592
{
1593
    global $lang_picinfo;
1594
 
1595
    $html = '';
1596
 
1597
    $html .= "        <tr><td colspan=\"2\" class=\"tableh2_compact\"><b>{$lang_picinfo['title']}</b></td></tr>\n";
1598
    $template = "        <tr><td class=\"tableb_compact\" valign=\"top\" nowrap>%s:</td><td class=\"tableb_compact\">%s</td></tr>\n";
1599
    foreach ($info as $key => $value) $html .= sprintf($template, $key, $value);
1600
 
1601
    return $html;
1602
}
1603
 
1604
?>