Subversion Repositories svnkaklik

Rev

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

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