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