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