Subversion Repositories svnkaklik

Rev

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