annotate mgallery.php @ 67:fc4900455610

Slightly adjust gallery html structure.
author Matti Hamalainen <ccr@tnsp.org>
date Wed, 14 Sep 2016 15:35:53 +0300
parents be68b2d06674
children 941d3be57d7b
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
1 <?php
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
2 //
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
3 // Yet Another Image Gallery
32
953b0f7636f4 Update copyrights.
Matti Hamalainen <ccr@tnsp.org>
parents: 31
diff changeset
4 // (C) Copyright 2015-2016 Tecnic Software productions (TNSP)
0
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
5 //
27
b8f8e03f943b Fix site library include.
Matti Hamalainen <ccr@tnsp.org>
parents: 24
diff changeset
6 require "mgeneric.inc.php";
0
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
7 require "mgallery.inc.php";
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
8
48
5a2dd41ff7ad Initial implementation of language selector.
Matti Hamalainen <ccr@tnsp.org>
parents: 47
diff changeset
9 $pageLang = "fi";
5a2dd41ff7ad Initial implementation of language selector.
Matti Hamalainen <ccr@tnsp.org>
parents: 47
diff changeset
10 $pageLanguages =
5a2dd41ff7ad Initial implementation of language selector.
Matti Hamalainen <ccr@tnsp.org>
parents: 47
diff changeset
11 [
5a2dd41ff7ad Initial implementation of language selector.
Matti Hamalainen <ccr@tnsp.org>
parents: 47
diff changeset
12 "fi" => "Finnish",
5a2dd41ff7ad Initial implementation of language selector.
Matti Hamalainen <ccr@tnsp.org>
parents: 47
diff changeset
13 "en" => "English",
5a2dd41ff7ad Initial implementation of language selector.
Matti Hamalainen <ccr@tnsp.org>
parents: 47
diff changeset
14 ];
5a2dd41ff7ad Initial implementation of language selector.
Matti Hamalainen <ccr@tnsp.org>
parents: 47
diff changeset
15
0
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
16
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
17 //
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
18 // Various utility functions
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
19 //
38
3f16beb79f9e Add image title string to certain images.
Matti Hamalainen <ccr@tnsp.org>
parents: 35
diff changeset
20 function mgGetImageTitleStr($filename, &$data)
3f16beb79f9e Add image title string to certain images.
Matti Hamalainen <ccr@tnsp.org>
parents: 35
diff changeset
21 {
3f16beb79f9e Add image title string to certain images.
Matti Hamalainen <ccr@tnsp.org>
parents: 35
diff changeset
22 return
3f16beb79f9e Add image title string to certain images.
Matti Hamalainen <ccr@tnsp.org>
parents: 35
diff changeset
23 chentities($filename).
3f16beb79f9e Add image title string to certain images.
Matti Hamalainen <ccr@tnsp.org>
parents: 35
diff changeset
24 mgGetArr($data, "datetime", " - %1", "", "mgTimeStr");
3f16beb79f9e Add image title string to certain images.
Matti Hamalainen <ccr@tnsp.org>
parents: 35
diff changeset
25 }
3f16beb79f9e Add image title string to certain images.
Matti Hamalainen <ccr@tnsp.org>
parents: 35
diff changeset
26
3f16beb79f9e Add image title string to certain images.
Matti Hamalainen <ccr@tnsp.org>
parents: 35
diff changeset
27
0
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
28 function mgGetImageURL()
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
29 {
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
30 global $galImageURL, $galPath;
5
1bf73b49fc91 Beautify the generated URLs by removing occurences of duplicate forward
Matti Hamalainen <ccr@tnsp.org>
parents: 4
diff changeset
31 return str_replace("//", "/", $galImageURL.$galPath."/".implode("", func_get_args()));
0
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
32 }
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
33
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
34
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
35 function mgGetURL($path, $image, $entities = TRUE)
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
36 {
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
37 global $galBaseURL, $galCleanURLS;
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
38 $amp = $entities ? "&amp;" : "&";
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
39
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
40 if ($galCleanURLS)
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
41 {
5
1bf73b49fc91 Beautify the generated URLs by removing occurences of duplicate forward
Matti Hamalainen <ccr@tnsp.org>
parents: 4
diff changeset
42 $url = $galBaseURL.$path."/".($image !== FALSE ? $image : "");
0
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
43 }
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
44 else
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
45 {
5
1bf73b49fc91 Beautify the generated URLs by removing occurences of duplicate forward
Matti Hamalainen <ccr@tnsp.org>
parents: 4
diff changeset
46 $url =
0
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
47 $galBaseURL.mgGetSetting("mgallery_php")."?path=".
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
48 $path.($image !== FALSE ? $amp."image=".$image : "");
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
49 }
5
1bf73b49fc91 Beautify the generated URLs by removing occurences of duplicate forward
Matti Hamalainen <ccr@tnsp.org>
parents: 4
diff changeset
50
1bf73b49fc91 Beautify the generated URLs by removing occurences of duplicate forward
Matti Hamalainen <ccr@tnsp.org>
parents: 4
diff changeset
51 return str_replace("//", "/", $url);
0
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
52 }
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
53
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
54
48
5a2dd41ff7ad Initial implementation of language selector.
Matti Hamalainen <ccr@tnsp.org>
parents: 47
diff changeset
55 function mgGetLanguageSelector()
5a2dd41ff7ad Initial implementation of language selector.
Matti Hamalainen <ccr@tnsp.org>
parents: 47
diff changeset
56 {
65
7019d87bc479 Improve/fix language selection support to store language cookie better.
Matti Hamalainen <ccr@tnsp.org>
parents: 63
diff changeset
57 global $pageLang, $pageLanguages, $galBaseURL;
48
5a2dd41ff7ad Initial implementation of language selector.
Matti Hamalainen <ccr@tnsp.org>
parents: 47
diff changeset
58 if (isset($pageLanguages) && count($pageLanguages) > 0)
5a2dd41ff7ad Initial implementation of language selector.
Matti Hamalainen <ccr@tnsp.org>
parents: 47
diff changeset
59 {
5a2dd41ff7ad Initial implementation of language selector.
Matti Hamalainen <ccr@tnsp.org>
parents: 47
diff changeset
60 $str = "<div id=\"languages\">";
5a2dd41ff7ad Initial implementation of language selector.
Matti Hamalainen <ccr@tnsp.org>
parents: 47
diff changeset
61 foreach ($pageLanguages as $id => $lang)
65
7019d87bc479 Improve/fix language selection support to store language cookie better.
Matti Hamalainen <ccr@tnsp.org>
parents: 63
diff changeset
62 $str .= "<a href=\"".$galBaseURL."?from=".urlencode($_SERVER["REQUEST_URI"])."&amp;lang=".$id."\">".$lang."</a> ";
48
5a2dd41ff7ad Initial implementation of language selector.
Matti Hamalainen <ccr@tnsp.org>
parents: 47
diff changeset
63 return $str."</div>\n";
5a2dd41ff7ad Initial implementation of language selector.
Matti Hamalainen <ccr@tnsp.org>
parents: 47
diff changeset
64 }
5a2dd41ff7ad Initial implementation of language selector.
Matti Hamalainen <ccr@tnsp.org>
parents: 47
diff changeset
65 else
5a2dd41ff7ad Initial implementation of language selector.
Matti Hamalainen <ccr@tnsp.org>
parents: 47
diff changeset
66 return "";
5a2dd41ff7ad Initial implementation of language selector.
Matti Hamalainen <ccr@tnsp.org>
parents: 47
diff changeset
67 }
5a2dd41ff7ad Initial implementation of language selector.
Matti Hamalainen <ccr@tnsp.org>
parents: 47
diff changeset
68
5a2dd41ff7ad Initial implementation of language selector.
Matti Hamalainen <ccr@tnsp.org>
parents: 47
diff changeset
69
0
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
70 function mgGetNaviActive(&$galIndex, $index, $delta, &$res, &$url, $entities)
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
71 {
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
72 global $galPath;
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
73 $res = $index + $delta;
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
74 if ($res >= 0 && $res <= sizeof($galIndex) - 1)
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
75 {
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
76 $url = mgGetURL($galPath, $galIndex[$res], $entities);
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
77 return TRUE;
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
78 }
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
79 else
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
80 return FALSE;
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
81 }
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
82
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
83
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
84 function mgGetNaviControlImage(&$galIndex, $index, $class, $url)
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
85 {
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
86 global $galTNPath;
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
87
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
88 $img = "<div class=\"imageCtrl ".$class."\">";
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
89
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
90 if ($url !== FALSE)
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
91 {
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
92 $img .=
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
93 "<a href=\"".$url."\"><img src=\"".
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
94 mgGetImageURL($galTNPath, $galIndex[$index]).
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
95 "\" alt=\"".$galIndex[$index]."\" /></a>";
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
96 }
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
97
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
98 return $img."</div>\n";
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
99 }
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
100
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
101
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
102 function mgGetNaviControlImageBox(&$galIndex, $index, $class, $delta)
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
103 {
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
104 if (!mgGetNaviActive($galIndex, $index, $delta, $res, $url, TRUE))
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
105 $url = FALSE;
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
106
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
107 return mgGetNaviControlImage($galIndex, $res, $class, $url);
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
108 }
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
109
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
110
7
dec931d9e860 Implement configurable navigation controls.
Matti Hamalainen <ccr@tnsp.org>
parents: 5
diff changeset
111 function mgGetControlText($id, $active, $url, $naviFlags)
dec931d9e860 Implement configurable navigation controls.
Matti Hamalainen <ccr@tnsp.org>
parents: 5
diff changeset
112 {
dec931d9e860 Implement configurable navigation controls.
Matti Hamalainen <ccr@tnsp.org>
parents: 5
diff changeset
113 if ($naviFlags & GNAV_TEXT)
dec931d9e860 Implement configurable navigation controls.
Matti Hamalainen <ccr@tnsp.org>
parents: 5
diff changeset
114 {
dec931d9e860 Implement configurable navigation controls.
Matti Hamalainen <ccr@tnsp.org>
parents: 5
diff changeset
115 $str = chentities(mgGetSetting("navi_ctrl_".$id));
dec931d9e860 Implement configurable navigation controls.
Matti Hamalainen <ccr@tnsp.org>
parents: 5
diff changeset
116 return
dec931d9e860 Implement configurable navigation controls.
Matti Hamalainen <ccr@tnsp.org>
parents: 5
diff changeset
117 "<span class=\"naviControl ".$id."\">[".
dec931d9e860 Implement configurable navigation controls.
Matti Hamalainen <ccr@tnsp.org>
parents: 5
diff changeset
118 ($active ? "<a href=\"".$url."\">".$str."</a>" : $str).
dec931d9e860 Implement configurable navigation controls.
Matti Hamalainen <ccr@tnsp.org>
parents: 5
diff changeset
119 "]</span>";
dec931d9e860 Implement configurable navigation controls.
Matti Hamalainen <ccr@tnsp.org>
parents: 5
diff changeset
120 }
dec931d9e860 Implement configurable navigation controls.
Matti Hamalainen <ccr@tnsp.org>
parents: 5
diff changeset
121 else
dec931d9e860 Implement configurable navigation controls.
Matti Hamalainen <ccr@tnsp.org>
parents: 5
diff changeset
122 return "";
dec931d9e860 Implement configurable navigation controls.
Matti Hamalainen <ccr@tnsp.org>
parents: 5
diff changeset
123 }
dec931d9e860 Implement configurable navigation controls.
Matti Hamalainen <ccr@tnsp.org>
parents: 5
diff changeset
124
dec931d9e860 Implement configurable navigation controls.
Matti Hamalainen <ccr@tnsp.org>
parents: 5
diff changeset
125
dec931d9e860 Implement configurable navigation controls.
Matti Hamalainen <ccr@tnsp.org>
parents: 5
diff changeset
126 function mgGetControl($id, &$galIndex, $index, $delta, $naviFlags)
0
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
127 {
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
128 $active = mgGetNaviActive($galIndex, $index, $delta, $res, $url, TRUE);
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
129 if ($active && ($naviFlags & GNAV_IMG))
7
dec931d9e860 Implement configurable navigation controls.
Matti Hamalainen <ccr@tnsp.org>
parents: 5
diff changeset
130 $img = mgGetNaviControlImage($galIndex, $res, $id, $url);
0
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
131 else
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
132 $img = "";
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
133
7
dec931d9e860 Implement configurable navigation controls.
Matti Hamalainen <ccr@tnsp.org>
parents: 5
diff changeset
134 $text = mgGetControlText($id, $active, $url, $naviFlags);
0
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
135
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
136 if ($delta < 0)
7
dec931d9e860 Implement configurable navigation controls.
Matti Hamalainen <ccr@tnsp.org>
parents: 5
diff changeset
137 return $img.$text;
0
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
138 else
7
dec931d9e860 Implement configurable navigation controls.
Matti Hamalainen <ccr@tnsp.org>
parents: 5
diff changeset
139 return $text.$img;
0
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
140 }
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
141
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
142
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
143 function mgGetNaviControls(&$galIndex, $index, $naviFlags)
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
144 {
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
145 global $galPath;
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
146
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
147 return
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
148 "<div class=\"naviControls\">".
7
dec931d9e860 Implement configurable navigation controls.
Matti Hamalainen <ccr@tnsp.org>
parents: 5
diff changeset
149 mgGetControl("prev", $galIndex, $index, -1, $naviFlags).
dec931d9e860 Implement configurable navigation controls.
Matti Hamalainen <ccr@tnsp.org>
parents: 5
diff changeset
150 mgGetControlText("up", TRUE, mgGetURL($galPath, FALSE), $naviFlags).
dec931d9e860 Implement configurable navigation controls.
Matti Hamalainen <ccr@tnsp.org>
parents: 5
diff changeset
151 mgGetControl("next", $galIndex, $index, 1, $naviFlags).
0
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
152 "</div>\n";
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
153 }
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
154
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
155
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
156 function mgPrintTable($class, &$galEntries, &$galIndex, $start, $limit)
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
157 {
19
59075f5e7a62 Add configuration setting to enable and disable use of HTML table elements.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
158 global $galAlbumIcon, $galPath, $galTNPath, $galImageURL, $galUseCoverImages, $galUseTables;
0
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
159
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
160 $galCount = count($galIndex);
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
161 if ($start >= $galCount)
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
162 return $start;
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
163
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
164 $end = ($limit === FALSE) ? $galCount : $start + $limit;
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
165 if ($end > $galCount) $end = $galCount;
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
166
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
167 $rowLimit = mgGetSetting("album_row_limit");
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
168 $n = 0;
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
169
19
59075f5e7a62 Add configuration setting to enable and disable use of HTML table elements.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
170 if ($galUseTables)
20
12916fcdb8b8 Improve the non-tabled mode.
Matti Hamalainen <ccr@tnsp.org>
parents: 19
diff changeset
171 echo "<table class=\"galleryTable ".$class."\">\n";
12916fcdb8b8 Improve the non-tabled mode.
Matti Hamalainen <ccr@tnsp.org>
parents: 19
diff changeset
172 else
12916fcdb8b8 Improve the non-tabled mode.
Matti Hamalainen <ccr@tnsp.org>
parents: 19
diff changeset
173 echo "<div class=\"galleryTable ".$class."\">\n";
19
59075f5e7a62 Add configuration setting to enable and disable use of HTML table elements.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
174
0
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
175 for ($index = $start; $index < $end; $index++)
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
176 {
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
177 $filename = &$galIndex[$index];
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
178 $data = &$galEntries[$filename];
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
179
19
59075f5e7a62 Add configuration setting to enable and disable use of HTML table elements.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
180 if ($galUseTables && $n == 0) echo " <tr>\n";
0
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
181
19
59075f5e7a62 Add configuration setting to enable and disable use of HTML table elements.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
182 if ($galUseTables)
20
12916fcdb8b8 Improve the non-tabled mode.
Matti Hamalainen <ccr@tnsp.org>
parents: 19
diff changeset
183 echo " <td class=\"galleryEntry\" id=\"cd".$data["base"]."\">\n";
19
59075f5e7a62 Add configuration setting to enable and disable use of HTML table elements.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
184 else
20
12916fcdb8b8 Improve the non-tabled mode.
Matti Hamalainen <ccr@tnsp.org>
parents: 19
diff changeset
185 echo " <div class=\"galleryEntry\">\n";
0
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
186
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
187 if ($data["type"] == 0)
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
188 {
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
189 echo
38
3f16beb79f9e Add image title string to certain images.
Matti Hamalainen <ccr@tnsp.org>
parents: 35
diff changeset
190 " <div class=\"imageBox\" title=\"".mgGetImageTitleStr($filename, $data).
3f16beb79f9e Add image title string to certain images.
Matti Hamalainen <ccr@tnsp.org>
parents: 35
diff changeset
191 "\"><a href=\"".mgGetURL($galPath, $filename)."\">".
0
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
192 "<img src=\"".mgGetImageURL($galTNPath, $filename)."\" alt=\"".
24
7f5209a6f7e0 Cosmetics.
Matti Hamalainen <ccr@tnsp.org>
parents: 20
diff changeset
193 chentities($filename)."\"></a></div>\n".
7f5209a6f7e0 Cosmetics.
Matti Hamalainen <ccr@tnsp.org>
parents: 20
diff changeset
194 mgGetArr($data, "caption", " <div class=\"imageCaption\">%1</div>\n", "", "chentities");
0
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
195 /*
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
196 if ($mode == "")
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
197 {
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
198 echo
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
199 " <select class=\"dropdown\" id=\"dd".$data["base"]."\" name=\"dd".$data["base"].
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
200 "\" onchange=\"galPhotoDataChanged('".$data["base"]."');\">\n";
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
201
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
202 foreach ($picChoices as $name => $value)
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
203 {
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
204 echo " <option value=\"$value\"".($value == $data["id"] ? " selected=\"selected\"" : "").">".chentities($name)."</option>\n";
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
205 }
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
206 echo
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
207 " </select>\n";
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
208 }
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
209 */
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
210 }
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
211 else
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
212 {
35
985596db0f01 Implement recursive depth album covers.
Matti Hamalainen <ccr@tnsp.org>
parents: 34
diff changeset
213 if ($galUseCoverImages && isset($data["image"]))
985596db0f01 Implement recursive depth album covers.
Matti Hamalainen <ccr@tnsp.org>
parents: 34
diff changeset
214 {
985596db0f01 Implement recursive depth album covers.
Matti Hamalainen <ccr@tnsp.org>
parents: 34
diff changeset
215 // Recursively determine the album cover image
985596db0f01 Implement recursive depth album covers.
Matti Hamalainen <ccr@tnsp.org>
parents: 34
diff changeset
216 $ptmp = [$galPath, $filename];
985596db0f01 Implement recursive depth album covers.
Matti Hamalainen <ccr@tnsp.org>
parents: 34
diff changeset
217 $curr = &$data;
985596db0f01 Implement recursive depth album covers.
Matti Hamalainen <ccr@tnsp.org>
parents: 34
diff changeset
218 while (is_array($curr["image"]))
985596db0f01 Implement recursive depth album covers.
Matti Hamalainen <ccr@tnsp.org>
parents: 34
diff changeset
219 {
985596db0f01 Implement recursive depth album covers.
Matti Hamalainen <ccr@tnsp.org>
parents: 34
diff changeset
220 $curr = &$curr["image"];
985596db0f01 Implement recursive depth album covers.
Matti Hamalainen <ccr@tnsp.org>
parents: 34
diff changeset
221 $ptmp[] = $curr["base"];
985596db0f01 Implement recursive depth album covers.
Matti Hamalainen <ccr@tnsp.org>
parents: 34
diff changeset
222 }
985596db0f01 Implement recursive depth album covers.
Matti Hamalainen <ccr@tnsp.org>
parents: 34
diff changeset
223
985596db0f01 Implement recursive depth album covers.
Matti Hamalainen <ccr@tnsp.org>
parents: 34
diff changeset
224 $ptmp[] = $galTNPath;
985596db0f01 Implement recursive depth album covers.
Matti Hamalainen <ccr@tnsp.org>
parents: 34
diff changeset
225 $ptmp[] = $curr["image"];
39
c1188641c5b7 Whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents: 38
diff changeset
226
35
985596db0f01 Implement recursive depth album covers.
Matti Hamalainen <ccr@tnsp.org>
parents: 34
diff changeset
227 $atmp = $galImageURL.implode("/", mgCleanPathArray(TRUE, 0, count($ptmp), $ptmp));
985596db0f01 Implement recursive depth album covers.
Matti Hamalainen <ccr@tnsp.org>
parents: 34
diff changeset
228 }
985596db0f01 Implement recursive depth album covers.
Matti Hamalainen <ccr@tnsp.org>
parents: 34
diff changeset
229 else
985596db0f01 Implement recursive depth album covers.
Matti Hamalainen <ccr@tnsp.org>
parents: 34
diff changeset
230 // No album cover, use default
985596db0f01 Implement recursive depth album covers.
Matti Hamalainen <ccr@tnsp.org>
parents: 34
diff changeset
231 $atmp = $galAlbumIcon;
985596db0f01 Implement recursive depth album covers.
Matti Hamalainen <ccr@tnsp.org>
parents: 34
diff changeset
232
0
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
233 echo
24
7f5209a6f7e0 Cosmetics.
Matti Hamalainen <ccr@tnsp.org>
parents: 20
diff changeset
234 " <a href=\"".mgGetURL(mgCleanPath(TRUE, $galPath, $filename), FALSE)."\">".
47
1e2b55775a84 Begin implementation of translated caption/title support.
Matti Hamalainen <ccr@tnsp.org>
parents: 44
diff changeset
235 "<img class=\"albumIcon\" src=\"".$atmp."\" alt=\"".
1e2b55775a84 Begin implementation of translated caption/title support.
Matti Hamalainen <ccr@tnsp.org>
parents: 44
diff changeset
236 mgGetTrans($data["caption"], TRUE).
1e2b55775a84 Begin implementation of translated caption/title support.
Matti Hamalainen <ccr@tnsp.org>
parents: 44
diff changeset
237 "\" />\n".
1e2b55775a84 Begin implementation of translated caption/title support.
Matti Hamalainen <ccr@tnsp.org>
parents: 44
diff changeset
238 " <div class=\"albumTitle\">".mgGetTrans($data["caption"], TRUE)."</div></a>\n";
0
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
239 }
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
240
19
59075f5e7a62 Add configuration setting to enable and disable use of HTML table elements.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
241 if ($galUseTables)
0
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
242 {
19
59075f5e7a62 Add configuration setting to enable and disable use of HTML table elements.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
243 echo " </td>\n";
59075f5e7a62 Add configuration setting to enable and disable use of HTML table elements.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
244 if (++$n >= $rowLimit)
59075f5e7a62 Add configuration setting to enable and disable use of HTML table elements.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
245 {
59075f5e7a62 Add configuration setting to enable and disable use of HTML table elements.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
246 echo " </tr>\n";
59075f5e7a62 Add configuration setting to enable and disable use of HTML table elements.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
247 $n = 0;
59075f5e7a62 Add configuration setting to enable and disable use of HTML table elements.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
248 }
0
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
249 }
19
59075f5e7a62 Add configuration setting to enable and disable use of HTML table elements.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
250 else
59075f5e7a62 Add configuration setting to enable and disable use of HTML table elements.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
251 echo " </div>\n";
0
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
252 }
19
59075f5e7a62 Add configuration setting to enable and disable use of HTML table elements.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
253
59075f5e7a62 Add configuration setting to enable and disable use of HTML table elements.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
254 if ($galUseTables)
0
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
255 {
19
59075f5e7a62 Add configuration setting to enable and disable use of HTML table elements.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
256 if ($n > 0)
59075f5e7a62 Add configuration setting to enable and disable use of HTML table elements.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
257 {
59075f5e7a62 Add configuration setting to enable and disable use of HTML table elements.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
258 while ($n++ < $rowLimit)
59075f5e7a62 Add configuration setting to enable and disable use of HTML table elements.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
259 echo " <td></td>\n";
59075f5e7a62 Add configuration setting to enable and disable use of HTML table elements.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
260 echo " </tr>\n";
59075f5e7a62 Add configuration setting to enable and disable use of HTML table elements.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
261 }
59075f5e7a62 Add configuration setting to enable and disable use of HTML table elements.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
262 echo "</table>\n";
0
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
263 }
20
12916fcdb8b8 Improve the non-tabled mode.
Matti Hamalainen <ccr@tnsp.org>
parents: 19
diff changeset
264 else
12916fcdb8b8 Improve the non-tabled mode.
Matti Hamalainen <ccr@tnsp.org>
parents: 19
diff changeset
265 echo "</div>\n";
12916fcdb8b8 Improve the non-tabled mode.
Matti Hamalainen <ccr@tnsp.org>
parents: 19
diff changeset
266
0
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
267 return $index;
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
268 }
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
269
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
270
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
271 function mgTimeStr($str)
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
272 {
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
273 $tmp = date_create_from_format("Y:m:d H:i:s", $str);
34
e786771dfaa5 Add seconds to outputted timestamps.
Matti Hamalainen <ccr@tnsp.org>
parents: 32
diff changeset
274 return date_format($tmp, "d M Y (H:i:s)");
0
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
275 }
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
276
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
277
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
278 function mgPrintPageInfoFooter()
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
279 {
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
280 if (($str = mgGetSetting("page_info")) !== FALSE)
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
281 echo "<div class=\"pageInfoFooter\">".$str."</div>";
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
282 }
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
283
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
284
31
300396947f04 Remove slight code duplication by factoring to a helper function.
Matti Hamalainen <ccr@tnsp.org>
parents: 29
diff changeset
285 function mgGetBreadCrump($class, &$pdata)
300396947f04 Remove slight code duplication by factoring to a helper function.
Matti Hamalainen <ccr@tnsp.org>
parents: 29
diff changeset
286 {
300396947f04 Remove slight code duplication by factoring to a helper function.
Matti Hamalainen <ccr@tnsp.org>
parents: 29
diff changeset
287 return
300396947f04 Remove slight code duplication by factoring to a helper function.
Matti Hamalainen <ccr@tnsp.org>
parents: 29
diff changeset
288 "<a class=\"".$class."\" href=\"".mgGetURL($pdata["path"], FALSE)."\">".
47
1e2b55775a84 Begin implementation of translated caption/title support.
Matti Hamalainen <ccr@tnsp.org>
parents: 44
diff changeset
289 mgGetTrans($pdata["caption"], TRUE).
1e2b55775a84 Begin implementation of translated caption/title support.
Matti Hamalainen <ccr@tnsp.org>
parents: 44
diff changeset
290 "</a>";
31
300396947f04 Remove slight code duplication by factoring to a helper function.
Matti Hamalainen <ccr@tnsp.org>
parents: 29
diff changeset
291 }
300396947f04 Remove slight code duplication by factoring to a helper function.
Matti Hamalainen <ccr@tnsp.org>
parents: 29
diff changeset
292
300396947f04 Remove slight code duplication by factoring to a helper function.
Matti Hamalainen <ccr@tnsp.org>
parents: 29
diff changeset
293
0
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
294 function mgPrintBreadCrumbs($galData)
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
295 {
63
1c32ece9acde Some residual array() => [] conversions.
Matti Hamalainen <ccr@tnsp.org>
parents: 49
diff changeset
296 $res = [];
0
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
297 if ($galData["caption"])
31
300396947f04 Remove slight code duplication by factoring to a helper function.
Matti Hamalainen <ccr@tnsp.org>
parents: 29
diff changeset
298 $res[] = mgGetBreadCrump("naviBreadCrumbCurr", $galData);
0
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
299
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
300 $tmp = $galData;
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
301 while (isset($tmp["parent"]))
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
302 {
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
303 $pdata = $tmp["parent"];
31
300396947f04 Remove slight code duplication by factoring to a helper function.
Matti Hamalainen <ccr@tnsp.org>
parents: 29
diff changeset
304 $res[] = mgGetBreadCrump("naviBreadCrumbItem", $pdata);
0
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
305 $tmp = $tmp["parent"];
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
306 }
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
307
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
308 if (count($res) > 1)
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
309 {
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
310 echo
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
311 "<div class=\"naviBreadCrumbs\">".
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
312 implode("<span class=\"naviBreadCrumbSep\"></span>", array_reverse($res)).
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
313 "</div>\n";
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
314 }
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
315 }
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
316
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
317
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
318 //
65
7019d87bc479 Improve/fix language selection support to store language cookie better.
Matti Hamalainen <ccr@tnsp.org>
parents: 63
diff changeset
319 // Check language
7019d87bc479 Improve/fix language selection support to store language cookie better.
Matti Hamalainen <ccr@tnsp.org>
parents: 63
diff changeset
320 //
7019d87bc479 Improve/fix language selection support to store language cookie better.
Matti Hamalainen <ccr@tnsp.org>
parents: 63
diff changeset
321 if (($tmp = stGetRequestItem("lang", FALSE, TRUE)) !== FALSE)
7019d87bc479 Improve/fix language selection support to store language cookie better.
Matti Hamalainen <ccr@tnsp.org>
parents: 63
diff changeset
322 {
7019d87bc479 Improve/fix language selection support to store language cookie better.
Matti Hamalainen <ccr@tnsp.org>
parents: 63
diff changeset
323 $tmp = strtolower($tmp);
7019d87bc479 Improve/fix language selection support to store language cookie better.
Matti Hamalainen <ccr@tnsp.org>
parents: 63
diff changeset
324 if (array_key_exists($tmp, $pageLanguages))
7019d87bc479 Improve/fix language selection support to store language cookie better.
Matti Hamalainen <ccr@tnsp.org>
parents: 63
diff changeset
325 {
7019d87bc479 Improve/fix language selection support to store language cookie better.
Matti Hamalainen <ccr@tnsp.org>
parents: 63
diff changeset
326 $pageLang = $tmp;
7019d87bc479 Improve/fix language selection support to store language cookie better.
Matti Hamalainen <ccr@tnsp.org>
parents: 63
diff changeset
327 setcookie("mglang", $tmp, time() + 365*24*60*60); // expire in a year
7019d87bc479 Improve/fix language selection support to store language cookie better.
Matti Hamalainen <ccr@tnsp.org>
parents: 63
diff changeset
328 }
7019d87bc479 Improve/fix language selection support to store language cookie better.
Matti Hamalainen <ccr@tnsp.org>
parents: 63
diff changeset
329 }
7019d87bc479 Improve/fix language selection support to store language cookie better.
Matti Hamalainen <ccr@tnsp.org>
parents: 63
diff changeset
330 else
7019d87bc479 Improve/fix language selection support to store language cookie better.
Matti Hamalainen <ccr@tnsp.org>
parents: 63
diff changeset
331 if (isset($_COOKIE["mglang"]))
7019d87bc479 Improve/fix language selection support to store language cookie better.
Matti Hamalainen <ccr@tnsp.org>
parents: 63
diff changeset
332 {
7019d87bc479 Improve/fix language selection support to store language cookie better.
Matti Hamalainen <ccr@tnsp.org>
parents: 63
diff changeset
333 $tmp = strtolower($_COOKIE["mglang"]);
7019d87bc479 Improve/fix language selection support to store language cookie better.
Matti Hamalainen <ccr@tnsp.org>
parents: 63
diff changeset
334 if (array_key_exists($tmp, $pageLanguages))
7019d87bc479 Improve/fix language selection support to store language cookie better.
Matti Hamalainen <ccr@tnsp.org>
parents: 63
diff changeset
335 $pageLang = $tmp;
7019d87bc479 Improve/fix language selection support to store language cookie better.
Matti Hamalainen <ccr@tnsp.org>
parents: 63
diff changeset
336 }
7019d87bc479 Improve/fix language selection support to store language cookie better.
Matti Hamalainen <ccr@tnsp.org>
parents: 63
diff changeset
337
7019d87bc479 Improve/fix language selection support to store language cookie better.
Matti Hamalainen <ccr@tnsp.org>
parents: 63
diff changeset
338
7019d87bc479 Improve/fix language selection support to store language cookie better.
Matti Hamalainen <ccr@tnsp.org>
parents: 63
diff changeset
339 //
7019d87bc479 Improve/fix language selection support to store language cookie better.
Matti Hamalainen <ccr@tnsp.org>
parents: 63
diff changeset
340 // Check for "from" redirection
7019d87bc479 Improve/fix language selection support to store language cookie better.
Matti Hamalainen <ccr@tnsp.org>
parents: 63
diff changeset
341 //
7019d87bc479 Improve/fix language selection support to store language cookie better.
Matti Hamalainen <ccr@tnsp.org>
parents: 63
diff changeset
342 if (($from = stGetRequestItem("from", FALSE, TRUE)) !== FALSE &&
7019d87bc479 Improve/fix language selection support to store language cookie better.
Matti Hamalainen <ccr@tnsp.org>
parents: 63
diff changeset
343 preg_match("@^[a-z0-9/_.]+\$@i", $from))
7019d87bc479 Improve/fix language selection support to store language cookie better.
Matti Hamalainen <ccr@tnsp.org>
parents: 63
diff changeset
344 {
7019d87bc479 Improve/fix language selection support to store language cookie better.
Matti Hamalainen <ccr@tnsp.org>
parents: 63
diff changeset
345 header("Location: ".$from);
7019d87bc479 Improve/fix language selection support to store language cookie better.
Matti Hamalainen <ccr@tnsp.org>
parents: 63
diff changeset
346 exit;
7019d87bc479 Improve/fix language selection support to store language cookie better.
Matti Hamalainen <ccr@tnsp.org>
parents: 63
diff changeset
347 }
7019d87bc479 Improve/fix language selection support to store language cookie better.
Matti Hamalainen <ccr@tnsp.org>
parents: 63
diff changeset
348
7019d87bc479 Improve/fix language selection support to store language cookie better.
Matti Hamalainen <ccr@tnsp.org>
parents: 63
diff changeset
349
7019d87bc479 Improve/fix language selection support to store language cookie better.
Matti Hamalainen <ccr@tnsp.org>
parents: 63
diff changeset
350 //
0
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
351 // Get gallery settings
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
352 //
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
353 mgReadSettings();
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
354
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
355 $pageCSS = mgGetSetting("css");
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
356 $pageCSSSelect = mgGetSetting("css_select");
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
357 $galBasePath = mgGetSetting("base_path");
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
358 $galBaseURL = mgGetSetting("base_url");
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
359 $galImageURL = mgGetSetting("image_url", mgGetSetting("base_url"));
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
360
17
3f7bc4202df3 Add new configuration setting 'cover_images' to disable/enable sub-album
Matti Hamalainen <ccr@tnsp.org>
parents: 13
diff changeset
361 $galUseCoverImages = mgGetSetting("cover_images");
19
59075f5e7a62 Add configuration setting to enable and disable use of HTML table elements.
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
362 $galUseTables = mgGetSetting("use_tables");
17
3f7bc4202df3 Add new configuration setting 'cover_images' to disable/enable sub-album
Matti Hamalainen <ccr@tnsp.org>
parents: 13
diff changeset
363
0
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
364 $galAlbumIcon = mgGetSetting("album_icon");
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
365 $galCleanURLS = mgGetSetting("clean_urls");
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
366 $galTNPath = mgGetSetting("tn_path");
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
367 $galMedSuffix = mgGetSetting("med_suffix");
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
368 $galTitlePrefix = mgGetSetting("title_prefix");
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
369 $galTitleSep = mgGetSetting("title_sep");
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
370
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
371 $galMode = stGetRequestItem("mode", "view", TRUE);
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
372 $galPath = stGetRequestItem("path", ".", TRUE);
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
373 $galPageIndex = intval(stGetRequestItem("index", 0, TRUE));
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
374 $galImage = stGetRequestItem("image", FALSE, TRUE);
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
375
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
376 if (is_string($galImage))
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
377 $galImage = basename($galImage);
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
378
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
379
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
380 //
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
381 // Attempt to read the data cache file
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
382 //
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
383 $filename = mgGetPath(mgCleanPath(TRUE, $galBasePath, $galPath), "cache_file");
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
384 $filename2 = mgGetPath(mgCleanPath(FALSE, $galBasePath, $galPath), "cache_file");
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
385 if ($filename == $filename2 && file_exists($filename) && ($fp = @fopen($filename, "rb")) !== FALSE)
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
386 {
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
387 if (flock($fp, LOCK_SH))
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
388 {
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
389 require($filename);
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
390 flock($fp, LOCK_UN);
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
391 }
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
392 fclose($fp);
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
393 }
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
394
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
395
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
396 // If no data available, show an error page
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
397 if (!isset($galData) || !isset($galEntries) ||
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
398 !isset($galAlbumsIndex) || !isset($galImagesIndex))
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
399 {
63
1c32ece9acde Some residual array() => [] conversions.
Matti Hamalainen <ccr@tnsp.org>
parents: 49
diff changeset
400 cmPrintPageHeader(mgGetVal(["title_prefix", "title_sep"], "%1%2")."ERROR!");
0
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
401
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
402 echo
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
403 "<h1>Gallery error</h1>\n".
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
404 "<p>Gallery path <b>".chentities($galPath)."</b> does not exist or is invalid.</p>\n";
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
405
12
79987aa7ee9a Change some debugging (commented out).
Matti Hamalainen <ccr@tnsp.org>
parents: 7
diff changeset
406 //echo "<p>filename=: '".$filename."', X: galData=".intval(isset($galData)).", galEntries=".intval(isset($galEntries))."\n";
0
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
407
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
408 mgPrintPageInfoFooter();
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
409 cmPrintPageFooter(TRUE);
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
410 exit;
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
411 }
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
412
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
413
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
414 //
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
415 // Print page header, etc.
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
416 //
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
417 if (($index = array_search($galImage, $galImagesIndex)) !== FALSE)
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
418 {
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
419 //
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
420 // Single image mode
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
421 //
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
422 $naviFlags = mgGetSetting("image_navigation");
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
423 $data = $galEntries[$galImage];
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
424
66
be68b2d06674 Cleanup.
Matti Hamalainen <ccr@tnsp.org>
parents: 65
diff changeset
425 $list = [
be68b2d06674 Cleanup.
Matti Hamalainen <ccr@tnsp.org>
parents: 65
diff changeset
426 mgGetArr($data, ["width", "height"], "<span class=\"infoDimensions\"><b>%1</b> x <b>%2</b> px</span>", NULL),
be68b2d06674 Cleanup.
Matti Hamalainen <ccr@tnsp.org>
parents: 65
diff changeset
427 mgGetArr($data, "model", "<span class=\"infoModel\"><b>%1</b></span>", NULL),
be68b2d06674 Cleanup.
Matti Hamalainen <ccr@tnsp.org>
parents: 65
diff changeset
428 mgGetArr($data, "fnumber", "<span class=\"infoFNumber\"><b>f/%1</b></span>", NULL),
be68b2d06674 Cleanup.
Matti Hamalainen <ccr@tnsp.org>
parents: 65
diff changeset
429 mgGetArr($data, "exposure", "<span class=\"infoExposure\"><b>%1</b> sec</span>", NULL, NULL),
be68b2d06674 Cleanup.
Matti Hamalainen <ccr@tnsp.org>
parents: 65
diff changeset
430 mgGetArr($data, "iso", "<span class=\"infoISO\">ISO <b>%1</b></span>", NULL),
be68b2d06674 Cleanup.
Matti Hamalainen <ccr@tnsp.org>
parents: 65
diff changeset
431 mgGetArr($data, "focallength", "<span class=\"infoFocalLength\">F-L <b>%1</b>mm</span>", NULL),
be68b2d06674 Cleanup.
Matti Hamalainen <ccr@tnsp.org>
parents: 65
diff changeset
432 mgGetArr($data, "lensmodel", "<span class=\"infoLensModel\"><i>%1</i></span>", NULL),
be68b2d06674 Cleanup.
Matti Hamalainen <ccr@tnsp.org>
parents: 65
diff changeset
433 ];
be68b2d06674 Cleanup.
Matti Hamalainen <ccr@tnsp.org>
parents: 65
diff changeset
434
47
1e2b55775a84 Begin implementation of translated caption/title support.
Matti Hamalainen <ccr@tnsp.org>
parents: 44
diff changeset
435 $pageTitle = $galTitlePrefix.$galTitleSep.mgGetTrans($galData["caption"])." - ".$galImage;
0
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
436 cmPrintPageHeader($pageTitle);
44
bc9da3b71888 Implement imgur-style image zoom/de-zoom via image click/enter.
Matti Hamalainen <ccr@tnsp.org>
parents: 43
diff changeset
437 echo
48
5a2dd41ff7ad Initial implementation of language selector.
Matti Hamalainen <ccr@tnsp.org>
parents: 47
diff changeset
438 mgGetLanguageSelector().
44
bc9da3b71888 Implement imgur-style image zoom/de-zoom via image click/enter.
Matti Hamalainen <ccr@tnsp.org>
parents: 43
diff changeset
439 "<div id=\"imageLarge\"><img src=\"".
bc9da3b71888 Implement imgur-style image zoom/de-zoom via image click/enter.
Matti Hamalainen <ccr@tnsp.org>
parents: 43
diff changeset
440 $galImageURL.$galPath."/".$galImage."\" alt=\"".
bc9da3b71888 Implement imgur-style image zoom/de-zoom via image click/enter.
Matti Hamalainen <ccr@tnsp.org>
parents: 43
diff changeset
441 chentities($data["base"].$galMedSuffix.$data["ext"])."\" /></div>\n".
bc9da3b71888 Implement imgur-style image zoom/de-zoom via image click/enter.
Matti Hamalainen <ccr@tnsp.org>
parents: 43
diff changeset
442 "<h1>".chentities($pageTitle)."</h1>\n";
0
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
443
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
444 if ($naviFlags & GNAV_BREADCRUMBS)
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
445 mgPrintBreadCrumbs($galData);
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
446
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
447 if ($naviFlags & GNAV_TOP)
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
448 echo mgGetNaviControls($galImagesIndex, $index, $naviFlags);
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
449
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
450 echo
66
be68b2d06674 Cleanup.
Matti Hamalainen <ccr@tnsp.org>
parents: 65
diff changeset
451 "<div class=\"imageCBox\">\n".
be68b2d06674 Cleanup.
Matti Hamalainen <ccr@tnsp.org>
parents: 65
diff changeset
452 mgGetNaviControlImageBox($galImagesIndex, $index, "prev", -1).
be68b2d06674 Cleanup.
Matti Hamalainen <ccr@tnsp.org>
parents: 65
diff changeset
453 "<div class=\"imageBox\">\n".
be68b2d06674 Cleanup.
Matti Hamalainen <ccr@tnsp.org>
parents: 65
diff changeset
454 "<a id=\"imageLink\" target=\"_blank\" href=\"".$galImageURL.$galPath."/".$galImage."\">".
be68b2d06674 Cleanup.
Matti Hamalainen <ccr@tnsp.org>
parents: 65
diff changeset
455 "<img id=\"imageImage\" src=\"".mgGetImageURL($galTNPath, $data["base"].$galMedSuffix.$data["ext"])."\" alt=\"".chentities($data["base"].$galMedSuffix.$data["ext"])."\"></a>\n".
be68b2d06674 Cleanup.
Matti Hamalainen <ccr@tnsp.org>
parents: 65
diff changeset
456 "</div>\n".
be68b2d06674 Cleanup.
Matti Hamalainen <ccr@tnsp.org>
parents: 65
diff changeset
457 mgGetNaviControlImageBox($galImagesIndex, $index, "next", 1).
be68b2d06674 Cleanup.
Matti Hamalainen <ccr@tnsp.org>
parents: 65
diff changeset
458 "<div class=\"imageCaption\">".mgGetArr($data, "caption", "%1", "")."</div>\n".
0
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
459 "<div class=\"infoBox\">\n".
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
460 mgGetArr($data, "datetime", "<span class=\"infoDateTime\">%1</span>", "", "mgTimeStr").
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
461 implode(", ", array_filter($list, function($a) { return $a !== NULL; })).
67
fc4900455610 Slightly adjust gallery html structure.
Matti Hamalainen <ccr@tnsp.org>
parents: 66
diff changeset
462 "</div>\n".
0
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
463 "</div>\n";
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
464
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
465 if ($naviFlags & GNAV_BOTTOM)
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
466 echo mgGetNaviControls($galImagesIndex, $index, $naviFlags);
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
467
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
468 // Javascript navigation
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
469 if ($naviFlags & GNAV_JAVASCRIPT)
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
470 {
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
471 $prevActive = mgGetNaviActive($galImagesIndex, $index, -1, $res, $prevURL, FALSE);
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
472 $nextActive = mgGetNaviActive($galImagesIndex, $index, 1, $res, $nextURL, FALSE);
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
473 echo
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
474 "<script type=\"text/javascript\">\n".
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
475 "var mgalPrevURL = \"".($prevActive ? $prevURL : "")."\";\n".
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
476 "var mgalNextURL = \"".($nextActive ? $nextURL : "")."\";\n".
44
bc9da3b71888 Implement imgur-style image zoom/de-zoom via image click/enter.
Matti Hamalainen <ccr@tnsp.org>
parents: 43
diff changeset
477 "var mgalExpanded = false;\n".
0
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
478 "\n";
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
479 ?>
44
bc9da3b71888 Implement imgur-style image zoom/de-zoom via image click/enter.
Matti Hamalainen <ccr@tnsp.org>
parents: 43
diff changeset
480 function mgalExpandClose(force)
bc9da3b71888 Implement imgur-style image zoom/de-zoom via image click/enter.
Matti Hamalainen <ccr@tnsp.org>
parents: 43
diff changeset
481 {
bc9da3b71888 Implement imgur-style image zoom/de-zoom via image click/enter.
Matti Hamalainen <ccr@tnsp.org>
parents: 43
diff changeset
482 mgalExpanded = !mgalExpanded;
bc9da3b71888 Implement imgur-style image zoom/de-zoom via image click/enter.
Matti Hamalainen <ccr@tnsp.org>
parents: 43
diff changeset
483 if (!force)
bc9da3b71888 Implement imgur-style image zoom/de-zoom via image click/enter.
Matti Hamalainen <ccr@tnsp.org>
parents: 43
diff changeset
484 mgalExpanded = false;
bc9da3b71888 Implement imgur-style image zoom/de-zoom via image click/enter.
Matti Hamalainen <ccr@tnsp.org>
parents: 43
diff changeset
485
bc9da3b71888 Implement imgur-style image zoom/de-zoom via image click/enter.
Matti Hamalainen <ccr@tnsp.org>
parents: 43
diff changeset
486 var mlink = document.getElementById("imageLink");
bc9da3b71888 Implement imgur-style image zoom/de-zoom via image click/enter.
Matti Hamalainen <ccr@tnsp.org>
parents: 43
diff changeset
487 var mlarge = document.getElementById("imageLarge");
bc9da3b71888 Implement imgur-style image zoom/de-zoom via image click/enter.
Matti Hamalainen <ccr@tnsp.org>
parents: 43
diff changeset
488 if (mlink && mlarge)
bc9da3b71888 Implement imgur-style image zoom/de-zoom via image click/enter.
Matti Hamalainen <ccr@tnsp.org>
parents: 43
diff changeset
489 {
bc9da3b71888 Implement imgur-style image zoom/de-zoom via image click/enter.
Matti Hamalainen <ccr@tnsp.org>
parents: 43
diff changeset
490 mlink.style.visibility = mgalExpanded ? "hidden" : "visible";
bc9da3b71888 Implement imgur-style image zoom/de-zoom via image click/enter.
Matti Hamalainen <ccr@tnsp.org>
parents: 43
diff changeset
491 mlarge.style.display = mgalExpanded ? "block" : "none";
bc9da3b71888 Implement imgur-style image zoom/de-zoom via image click/enter.
Matti Hamalainen <ccr@tnsp.org>
parents: 43
diff changeset
492 }
bc9da3b71888 Implement imgur-style image zoom/de-zoom via image click/enter.
Matti Hamalainen <ccr@tnsp.org>
parents: 43
diff changeset
493 return false;
bc9da3b71888 Implement imgur-style image zoom/de-zoom via image click/enter.
Matti Hamalainen <ccr@tnsp.org>
parents: 43
diff changeset
494 }
bc9da3b71888 Implement imgur-style image zoom/de-zoom via image click/enter.
Matti Hamalainen <ccr@tnsp.org>
parents: 43
diff changeset
495
bc9da3b71888 Implement imgur-style image zoom/de-zoom via image click/enter.
Matti Hamalainen <ccr@tnsp.org>
parents: 43
diff changeset
496
bc9da3b71888 Implement imgur-style image zoom/de-zoom via image click/enter.
Matti Hamalainen <ccr@tnsp.org>
parents: 43
diff changeset
497 function mgalMouseExpandClose(event, force)
bc9da3b71888 Implement imgur-style image zoom/de-zoom via image click/enter.
Matti Hamalainen <ccr@tnsp.org>
parents: 43
diff changeset
498 {
bc9da3b71888 Implement imgur-style image zoom/de-zoom via image click/enter.
Matti Hamalainen <ccr@tnsp.org>
parents: 43
diff changeset
499 if (!event.ctrlKey)
bc9da3b71888 Implement imgur-style image zoom/de-zoom via image click/enter.
Matti Hamalainen <ccr@tnsp.org>
parents: 43
diff changeset
500 return mgalExpandClose(force);
bc9da3b71888 Implement imgur-style image zoom/de-zoom via image click/enter.
Matti Hamalainen <ccr@tnsp.org>
parents: 43
diff changeset
501 else
bc9da3b71888 Implement imgur-style image zoom/de-zoom via image click/enter.
Matti Hamalainen <ccr@tnsp.org>
parents: 43
diff changeset
502 return true;
bc9da3b71888 Implement imgur-style image zoom/de-zoom via image click/enter.
Matti Hamalainen <ccr@tnsp.org>
parents: 43
diff changeset
503 }
bc9da3b71888 Implement imgur-style image zoom/de-zoom via image click/enter.
Matti Hamalainen <ccr@tnsp.org>
parents: 43
diff changeset
504
bc9da3b71888 Implement imgur-style image zoom/de-zoom via image click/enter.
Matti Hamalainen <ccr@tnsp.org>
parents: 43
diff changeset
505
0
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
506 function mgalNavigateTo(url)
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
507 {
43
fc8e6a056016 Indentation fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 39
diff changeset
508 if (url != "")
fc8e6a056016 Indentation fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 39
diff changeset
509 window.location = url;
0
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
510 }
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
511
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
512
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
513 function mgalProcessKeyPress(ev)
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
514 {
43
fc8e6a056016 Indentation fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 39
diff changeset
515 ev = ev || window.event;
fc8e6a056016 Indentation fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 39
diff changeset
516 var key = ev.keyCode ? ev.keyCode : ev.which;
fc8e6a056016 Indentation fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 39
diff changeset
517 switch (key)
fc8e6a056016 Indentation fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 39
diff changeset
518 {
fc8e6a056016 Indentation fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 39
diff changeset
519 case 37:
fc8e6a056016 Indentation fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 39
diff changeset
520 case 65:
44
bc9da3b71888 Implement imgur-style image zoom/de-zoom via image click/enter.
Matti Hamalainen <ccr@tnsp.org>
parents: 43
diff changeset
521 case 52:
43
fc8e6a056016 Indentation fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 39
diff changeset
522 // left
fc8e6a056016 Indentation fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 39
diff changeset
523 mgalNavigateTo(mgalPrevURL);
fc8e6a056016 Indentation fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 39
diff changeset
524 break;
0
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
525
43
fc8e6a056016 Indentation fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 39
diff changeset
526 case 39:
fc8e6a056016 Indentation fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 39
diff changeset
527 case 68:
44
bc9da3b71888 Implement imgur-style image zoom/de-zoom via image click/enter.
Matti Hamalainen <ccr@tnsp.org>
parents: 43
diff changeset
528 case 54:
43
fc8e6a056016 Indentation fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 39
diff changeset
529 // right
fc8e6a056016 Indentation fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 39
diff changeset
530 mgalNavigateTo(mgalNextURL);
fc8e6a056016 Indentation fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 39
diff changeset
531 break;
44
bc9da3b71888 Implement imgur-style image zoom/de-zoom via image click/enter.
Matti Hamalainen <ccr@tnsp.org>
parents: 43
diff changeset
532
bc9da3b71888 Implement imgur-style image zoom/de-zoom via image click/enter.
Matti Hamalainen <ccr@tnsp.org>
parents: 43
diff changeset
533 case 13:
bc9da3b71888 Implement imgur-style image zoom/de-zoom via image click/enter.
Matti Hamalainen <ccr@tnsp.org>
parents: 43
diff changeset
534 case 48:
bc9da3b71888 Implement imgur-style image zoom/de-zoom via image click/enter.
Matti Hamalainen <ccr@tnsp.org>
parents: 43
diff changeset
535 mgalExpandClose(true);
bc9da3b71888 Implement imgur-style image zoom/de-zoom via image click/enter.
Matti Hamalainen <ccr@tnsp.org>
parents: 43
diff changeset
536 break;
bc9da3b71888 Implement imgur-style image zoom/de-zoom via image click/enter.
Matti Hamalainen <ccr@tnsp.org>
parents: 43
diff changeset
537
bc9da3b71888 Implement imgur-style image zoom/de-zoom via image click/enter.
Matti Hamalainen <ccr@tnsp.org>
parents: 43
diff changeset
538 case 27:
bc9da3b71888 Implement imgur-style image zoom/de-zoom via image click/enter.
Matti Hamalainen <ccr@tnsp.org>
parents: 43
diff changeset
539 mgalExpandClose(false);
bc9da3b71888 Implement imgur-style image zoom/de-zoom via image click/enter.
Matti Hamalainen <ccr@tnsp.org>
parents: 43
diff changeset
540 break;
bc9da3b71888 Implement imgur-style image zoom/de-zoom via image click/enter.
Matti Hamalainen <ccr@tnsp.org>
parents: 43
diff changeset
541
bc9da3b71888 Implement imgur-style image zoom/de-zoom via image click/enter.
Matti Hamalainen <ccr@tnsp.org>
parents: 43
diff changeset
542 default:
bc9da3b71888 Implement imgur-style image zoom/de-zoom via image click/enter.
Matti Hamalainen <ccr@tnsp.org>
parents: 43
diff changeset
543 return true;
43
fc8e6a056016 Indentation fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 39
diff changeset
544 }
44
bc9da3b71888 Implement imgur-style image zoom/de-zoom via image click/enter.
Matti Hamalainen <ccr@tnsp.org>
parents: 43
diff changeset
545
bc9da3b71888 Implement imgur-style image zoom/de-zoom via image click/enter.
Matti Hamalainen <ccr@tnsp.org>
parents: 43
diff changeset
546 ev.preventDefault();
bc9da3b71888 Implement imgur-style image zoom/de-zoom via image click/enter.
Matti Hamalainen <ccr@tnsp.org>
parents: 43
diff changeset
547 return false;
0
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
548 }
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
549
44
bc9da3b71888 Implement imgur-style image zoom/de-zoom via image click/enter.
Matti Hamalainen <ccr@tnsp.org>
parents: 43
diff changeset
550
bc9da3b71888 Implement imgur-style image zoom/de-zoom via image click/enter.
Matti Hamalainen <ccr@tnsp.org>
parents: 43
diff changeset
551 document.getElementById("imageLarge").onclick = function(event) { return mgalMouseExpandClose(event, false); }
bc9da3b71888 Implement imgur-style image zoom/de-zoom via image click/enter.
Matti Hamalainen <ccr@tnsp.org>
parents: 43
diff changeset
552 document.getElementById("imageLink").onclick = function(event) { return mgalMouseExpandClose(event, true); }
0
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
553 document.onkeypress = mgalProcessKeyPress;
44
bc9da3b71888 Implement imgur-style image zoom/de-zoom via image click/enter.
Matti Hamalainen <ccr@tnsp.org>
parents: 43
diff changeset
554
0
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
555 <?
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
556 echo
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
557 "</script>\n";
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
558 }
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
559 }
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
560 else
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
561 {
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
562 //
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
563 // Gallery mode
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
564 //
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
565 // - needs sub-modes / handling of order shit
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
566 // - Javascript stuff for picture data updates
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
567 //
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
568 $pageTitle = $galTitlePrefix.mgGetArr($galData, "caption", " - %1", "", "chentities");
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
569 cmPrintPageHeader($pageTitle);
48
5a2dd41ff7ad Initial implementation of language selector.
Matti Hamalainen <ccr@tnsp.org>
parents: 47
diff changeset
570 echo
5a2dd41ff7ad Initial implementation of language selector.
Matti Hamalainen <ccr@tnsp.org>
parents: 47
diff changeset
571 mgGetLanguageSelector().
5a2dd41ff7ad Initial implementation of language selector.
Matti Hamalainen <ccr@tnsp.org>
parents: 47
diff changeset
572 "<h1>".$pageTitle."</h1>\n";
0
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
573
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
574 $naviFlags = mgGetSetting("album_navigation");
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
575 if ($naviFlags & GNAV_BREADCRUMBS)
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
576 mgPrintBreadCrumbs($galData);
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
577
47
1e2b55775a84 Begin implementation of translated caption/title support.
Matti Hamalainen <ccr@tnsp.org>
parents: 44
diff changeset
578 if (isset($galData["header"]) && strlen($gheader = mgGetTrans($galData["header"])) > 0)
13
951752fb1c21 Add translation of relative URLs in header text blocks.
Matti Hamalainen <ccr@tnsp.org>
parents: 12
diff changeset
579 {
951752fb1c21 Add translation of relative URLs in header text blocks.
Matti Hamalainen <ccr@tnsp.org>
parents: 12
diff changeset
580 // Translate relative URLs in header, if needed
951752fb1c21 Add translation of relative URLs in header text blocks.
Matti Hamalainen <ccr@tnsp.org>
parents: 12
diff changeset
581 $baseURL = mgGetSetting("image_url");
951752fb1c21 Add translation of relative URLs in header text blocks.
Matti Hamalainen <ccr@tnsp.org>
parents: 12
diff changeset
582
951752fb1c21 Add translation of relative URLs in header text blocks.
Matti Hamalainen <ccr@tnsp.org>
parents: 12
diff changeset
583 $headerText = preg_replace_callback(
951752fb1c21 Add translation of relative URLs in header text blocks.
Matti Hamalainen <ccr@tnsp.org>
parents: 12
diff changeset
584 "@href\s*=\s*\"([^\"]+)\"@i",
951752fb1c21 Add translation of relative URLs in header text blocks.
Matti Hamalainen <ccr@tnsp.org>
parents: 12
diff changeset
585 function ($matches) use($galPath, $baseURL)
951752fb1c21 Add translation of relative URLs in header text blocks.
Matti Hamalainen <ccr@tnsp.org>
parents: 12
diff changeset
586 {
951752fb1c21 Add translation of relative URLs in header text blocks.
Matti Hamalainen <ccr@tnsp.org>
parents: 12
diff changeset
587 $mstmp = $matches[1];
951752fb1c21 Add translation of relative URLs in header text blocks.
Matti Hamalainen <ccr@tnsp.org>
parents: 12
diff changeset
588 if (preg_match("@^[a-z]+://@i", $mstmp) === 0)
951752fb1c21 Add translation of relative URLs in header text blocks.
Matti Hamalainen <ccr@tnsp.org>
parents: 12
diff changeset
589 {
951752fb1c21 Add translation of relative URLs in header text blocks.
Matti Hamalainen <ccr@tnsp.org>
parents: 12
diff changeset
590 if ($mstmp[0] != "/")
28
2d8112d6c3bc Fix relative links re-parsing.
Matti Hamalainen <ccr@tnsp.org>
parents: 27
diff changeset
591 $mstmp = $baseURL."/".$galPath."/".str_replace("//", "/", $mstmp);
13
951752fb1c21 Add translation of relative URLs in header text blocks.
Matti Hamalainen <ccr@tnsp.org>
parents: 12
diff changeset
592 }
28
2d8112d6c3bc Fix relative links re-parsing.
Matti Hamalainen <ccr@tnsp.org>
parents: 27
diff changeset
593 return "href=\"".$mstmp."\"";
13
951752fb1c21 Add translation of relative URLs in header text blocks.
Matti Hamalainen <ccr@tnsp.org>
parents: 12
diff changeset
594 },
47
1e2b55775a84 Begin implementation of translated caption/title support.
Matti Hamalainen <ccr@tnsp.org>
parents: 44
diff changeset
595 $gheader);
13
951752fb1c21 Add translation of relative URLs in header text blocks.
Matti Hamalainen <ccr@tnsp.org>
parents: 12
diff changeset
596
951752fb1c21 Add translation of relative URLs in header text blocks.
Matti Hamalainen <ccr@tnsp.org>
parents: 12
diff changeset
597 echo "<div class=\"albumHeaderText\">".$headerText."</div>\n";
951752fb1c21 Add translation of relative URLs in header text blocks.
Matti Hamalainen <ccr@tnsp.org>
parents: 12
diff changeset
598 }
0
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
599
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
600 mgPrintTable("albumTable", $galEntries, $galAlbumsIndex, 0, FALSE);
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
601 mgPrintTable("imageTable", $galEntries, $galImagesIndex, 0, FALSE);
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
602 }
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
603
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
604 mgPrintPageInfoFooter();
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
605 cmPrintPageFooter(TRUE);
ac688606ec4b Initial import of code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
606 ?>