Dragonfly CMS logo Server sponsored and hosted by
DedicatedNOW
CVS logo  
.:: Home :: Dev. Resources :: Forums ::.
Dragonfly CMS CVS Repository
 Location: / cvs / themes / reDesign / coppermine / theme.inc
This is a web interface to the Dragonfly CMS CVS tree. You can browse the file hierarchy by picking directories. If you pick a file, you will see the revision history for that file.
Selecting a revision number will show that revision of the file. There are links at each revision to display diffs, annotate and download.
Note: Info about CVS and our commits can be found at our CVS Info Forum
File name: themes/reDesign/coppermine/theme.inc
Revision : 1.12 (5 years 2 months 1 weeks 1 days 15 hours 22 minutes 18 seconds ago) by estlane
Changed : +7 -4 lines
Comment: theme.php checks now only for existancee of variable $no_border to disable any styling for OpenTable()


# Author Rev Line
1 nanocaio 1.1 <?php
2 nanocaio 1.1 /***************************************************************************
3 nanocaio 1.1 Coppermine Photo Gallery 1.3.1 for CPG-Nuke
4 nanocaio 1.1 **************************************************************************
5 estlane 1.6 Port Copyright (C) 2004-2008 Coppermine/CPG-Nuke Dev Team
6 estlane 1.6 http://dragonflycms.org
7 nanocaio 1.1 **************************************************************************
8 nanocaio 1.1 v1.1 originally written by Grégory Demar
9 nanocaio 1.1 Copyright (C) 2002,2003 http://coppermine.sf.net/team/
10 nanocaio 1.1 This program is free software; you can redistribute it and/or modify
11 nanocaio 1.1 it under the terms of the GNU General Public License as published by
12 nanocaio 1.1 the Free Software Foundation; either version 2 of the License, or
13 nanocaio 1.1 (at your option) any later version.
14 nanocaio 1.1 **************************************************************************
15 nanocaio 1.1 Last modification notes:
16 estlane 1.3 $Source: /cvs/themes/reDesign/coppermine/theme.inc,v $
17 estlane 1.12 $Revision: 1.11 $
18 estlane 1.3 $Author: estlane $
19 estlane 1.12 $Date: 2009/02/07 19:08:37 $
20 nanocaio 1.1 ****************************************************************************/
21 nanocaio 1.1 if (!defined('IN_COPPERMINE')) die('Not in Coppermine...');
22 estlane 1.12 global $cpgtpl, $template, $template_display_picture, $template_image_comments,
23 estlane 1.12 $template_add_your_comment, $modheader, $no_border;
24 estlane 1.3  
25 estlane 1.12 /*Disable border for OpenTable*/
26 estlane 1.12 global $no_border;
27 estlane 1.12 $no_border = 1;
28 estlane 1.5  
29 estlane 1.3 $rD_path = 'themes/'.$CPG_SESS['theme'];//reDesign path
30 estlane 1.3 $cop_templ = $rD_path.'/template/coppermine';//coppermine templatespath
31 estlane 1.3 $cop_imag = $rD_path.'/images/coppermine';//coppermine imagespath
32 estlane 1.3  
33 estlane 1.7 define('_ALBUMS', ALBUMS);
34 estlane 1.7 //define('_CATEGORY', CATEGORY); //Already defined in main.php
35 estlane 1.7 define('_PICTURES', PICTURES);
36 estlane 1.5  
37 estlane 1.5  
38 estlane 1.5  
39 estlane 1.3 function tmpl_to_var($file, $load = true) {
40 estlane 1.4 global $cop_templ, $CPG_M_DIR, $CPG_URL;
41 estlane 1.4 if ($load)
42 estlane 1.4 $thefile = implode('', file($cop_templ.'/'.$file));
43 estlane 1.4 else
44 estlane 1.4 $thefile = $file;
45 estlane 1.4 $var = eval("return '".preg_replace("/'/", "\'", $thefile)."';");
46 estlane 1.4 if (!$var) {
47 estlane 1.4 cpg_error('There occured an error while processing '.$cop_templ.'/'.$file);
48 estlane 1.4 }
49 estlane 1.4 return $var;
50 estlane 1.3 }
51 estlane 1.3  
52 estlane 1.8 $modheader .= '<link rel="stylesheet" type="text/css" href="'.$rD_path.'/style/coppermine.css" />
53 estlane 1.8 <script type="text/javascript" src="'.$CPG_M_DIR.'/scripts.js"></script>
54 estlane 1.8 <script type="text/javascript" src="'.$CPG_M_DIR.'/jspw.js"></script>
55 nanocaio 1.1 <script type="text/javascript" src="includes/javascript/MM_funcs.js"></script>
56 estlane 1.8 ';
57 estlane 1.3  
58 nanocaio 1.1 // HTML template for the USER info box in the user list view
59 estlane 1.3 require($cop_templ.'/user_list_info_box.inc'); //$template_user_list_info_box index.php
60 nanocaio 1.1  
61 nanocaio 1.1 // HTML template for the ALBUM admin menu displayed in the album list
62 estlane 1.3 require($cop_templ.'/album_admin_menu.inc'); //$template_album_admin_menu index.php
63 nanocaio 1.1  
64 nanocaio 1.1 // HTML template for the image navigation bar
65 estlane 1.3 require($cop_templ.'/display_image/img_navbar.inc'); //$template_img_navbar displayimage.php
66 nanocaio 1.1 // HTML template for intermediate image display
67 estlane 1.8 //require($cop_templ.'/display_image/display_picture.inc'); //$template_display_picture displayimage.php
68 estlane 1.8 $template_display_picture = tmpl_to_var('display_image/display_picture.html'); // displayimage.php
69 nanocaio 1.1 // HTML template for the image rating box
70 estlane 1.8  
71 estlane 1.8 $cpgtpl->assign_vars(array(
72 estlane 1.8 'VOTES' => '{VOTES}',
73 estlane 1.8 'PID' => '{PID}',
74 estlane 1.8 'CURRENTPAGE' => '{CURRENTPAGE}',
75 estlane 1.8 'RUBBISH' => RUBBISH,
76 estlane 1.8 'POOR' => POOR,
77 estlane 1.8 'FAIR' => FAIR,
78 estlane 1.8 'GOOD' => GOOD,
79 estlane 1.8 'EXCELLENT' => EXCELLENT,
80 estlane 1.8 'GREAT' => GREAT,
81 estlane 1.8 'RATE_THIS_PIC' => RATE_THIS_PIC,
82 estlane 1.8 'COP_IMAG' => $cop_imag,
83 estlane 1.8 'U_RATE_PIC' => getlink('&amp;file=ratepic')
84 estlane 1.8 ));
85 estlane 1.8 $cpgtpl->set_filenames(array(
86 estlane 1.8 'image_rating' => 'coppermine/display_image/image_rating.html'
87 estlane 1.8 ));
88 estlane 1.8 //Dragonfly 10 has a new method to_string for cpgtpl object, so we use it
89 estlane 1.8 if (version_compare(CPG_NUKE, '10.0.0', '>=')) {
90 estlane 1.8 $template_image_rating = $cpgtpl->to_string('image_rating');
91 estlane 1.8 //We use the alternative for Dragonfly 9 (the idea is exactly the same actually)
92 estlane 1.8 } else {
93 estlane 1.8 ob_start();
94 estlane 1.8 $cpgtpl->display('image_rating');
95 estlane 1.8 $template_image_rating = ob_get_clean();
96 estlane 1.8 }
97 estlane 1.8  
98 estlane 1.8  
99 nanocaio 1.1 // HTML template for the display of comments
100 estlane 1.3 $template_image_comments = tmpl_to_var('display_image/image_comments.html'); // displayimage.php
101 nanocaio 1.1  
102 estlane 1.3 $template_add_your_comment = tmpl_to_var('display_image/add_your_comment.html'); // displayimage.php
103 nanocaio 1.1  
104 nanocaio 1.1 // HTML template used by the msg_box function
105 estlane 1.3 $template_msg_box = tmpl_to_var('msg_box.html'); // functions.inc
106 nanocaio 1.1  
107 nanocaio 1.1 // HTML template for e-cards
108 estlane 1.3 $template_ecard = tmpl_to_var('ecard.html'); // displayecard.php
109 estlane 1.3  
110 nanocaio 1.1  
111 estlane 1.3 // HTML template used by the cpg_die function
112 estlane 1.3 $template_cpg_die = 'cpg_die.html'; // functions.inc
113 nanocaio 1.1 // HTML template for One picture editing
114 estlane 1.3 $template_edit_one_pic = 'editonepic.inc'; // editDesc.inc
115 estlane 1.3  
116 nanocaio 1.1  
117 nanocaio 1.1 // Template used for tabbed display
118 nanocaio 1.1 $template_tab_display = array(
119 estlane 1.8 'left_text' => '<div style="float:left;">{LEFT_TEXT}</div>',
120 estlane 1.8 'tab_header' => '<div class="pagination" style="float:right;"><ul>',
121 estlane 1.8 'tab_trailer' => '</ul></div><div class="clear"></div>',
122 estlane 1.8 'active_tab' => '<li><a class="currentpage">%d</a></li>&nbsp;',
123 estlane 1.8 'inactive_tab' => '<li><a href="{LINK}">%d</a></li>&nbsp;'
124 nanocaio 1.1 );
125 nanocaio 1.1  
126 estlane 1.8  
127 nanocaio 1.1 // Function to start a 'standard' table
128 nanocaio 1.1 function starttable($width = '-1', $title='', $title_colspan='1') {
129 estlane 1.4 global $cpgtpl;
130 estlane 1.8  
131 estlane 1.8 $cpgtpl->assign_vars(array(
132 estlane 1.8 'STARTTABLE' => 1
133 estlane 1.8 ));
134 nanocaio 1.1 if ($title!='') {
135 estlane 1.4 $cpgtpl->assign_vars(array(
136 estlane 1.4 'TITLE_COLSPAN' => $title_colspan,
137 estlane 1.4 'ST_TITLE' => $title
138 estlane 1.4 ));
139 nanocaio 1.1 }
140 estlane 1.3 $cpgtpl->set_filenames(array('standard_table' => 'coppermine/standard_table.html'));
141 estlane 1.4 $cpgtpl->display('standard_table',false);
142 nanocaio 1.1 }
143 nanocaio 1.1  
144 estlane 1.3 function endtable() {
145 estlane 1.4 global $cpgtpl;
146 estlane 1.8  
147 estlane 1.4 $cpgtpl->assign_vars(array(
148 estlane 1.4 'STARTTABLE' => 0,
149 estlane 1.4 'ENDTABLE' => 1
150 estlane 1.4 ));
151 estlane 1.4 $cpgtpl->set_filenames(array('standard_table' => 'coppermine/standard_table.html'));
152 estlane 1.4 $cpgtpl->display('standard_table',false);
153 nanocaio 1.1 }
154 nanocaio 1.1  
155 nanocaio 1.1 function theme_main_menu()
156 nanocaio 1.1 {
157 estlane 1.3 global $MAIN_CFG, $CONFIG, $CPG_M_DIR, $CPG_M_URL, $CPG_URL, $album, $meta_link, $cat, $cop_templ, $cpgtpl;
158 nanocaio 1.1  
159 nanocaio 1.1 $meta_link = META_LNK;
160 nanocaio 1.1 $my_gallery_id = FIRST_USER_CAT + USER_ID;
161 nanocaio 1.1  
162 estlane 1.3 $cpgtpl->assign_block_vars('meta_links',array(
163 estlane 1.4 'LASTUP_URL' => getlink('&amp;file=thumbnails&amp;meta=lastup'.META_LNK),
164 estlane 1.4 'LASTUP_NAME' => LASTUP_LNK,
165 estlane 1.4 'LASTCOM_URL' => getlink('&amp;file=thumbnails&amp;meta=lastcom'.META_LNK),
166 estlane 1.4 'LASTCOM_NAME' => LASTCOM_LNK,
167 estlane 1.4 'TOPN_URL' => getlink('&amp;file=thumbnails&amp;meta=topn'.META_LNK),
168 estlane 1.4 'TOPN_NAME' => TOPN_LNK,
169 estlane 1.4 'TOPRATED_URL' => getlink('&amp;file=thumbnails&amp;meta=toprated'.META_LNK),
170 estlane 1.4 'TOPRATED_NAME' => TOPRATED_LNK,
171 estlane 1.4 'FAV_URL' => getlink('&amp;file=thumbnails&amp;meta=favpics'.META_LNK),
172 estlane 1.4 'FAV_NAME' => FAV_LNK,
173 estlane 1.4 'SEARCH_URL' => getlink('&amp;file=search'),
174 estlane 1.4 'SEARCH_NAME' => SEARCH_LNK,
175 estlane 1.4 'HELP_URL' => getlink('&amp;file=thumbnails&amp;meta=favpics'.META_LNK),
176 estlane 1.4 'HELP_TITLE' => HELP_TITLE,
177 estlane 1.4 'HELP_NAME' => HELP_LNK
178 estlane 1.4 ));
179 estlane 1.3  
180 estlane 1.3 $cpgtpl->assign_block_vars('album_list',array(
181 estlane 1.4 'URL' => getlink(),
182 estlane 1.4 'TITLE' => ALB_LIST_TITLE,
183 estlane 1.4 'NAME' => _coppermineLANG.' '._HOME
184 estlane 1.4 ));
185 estlane 1.3  
186 estlane 1.3 $cpgtpl->assign_block_vars('my_profile',array(
187 estlane 1.4 'URL' => USERPROF_URL,
188 estlane 1.4 'TITLE' => MY_PROF_TITLE,
189 estlane 1.4 'NAME' => MY_PROF_LNK
190 estlane 1.4 ));
191 estlane 1.3  
192 estlane 1.3 $cpgtpl->assign_block_vars('my_gallery',array(
193 estlane 1.4 'URL' => getlink('&amp;cat='.$my_gallery_id),
194 estlane 1.4 'TITLE' => MY_GAL_TITLE,
195 estlane 1.4 'NAME' => MY_GAL_LNK
196 estlane 1.4 ));
197 nanocaio 1.1  
198 nanocaio 1.1 if (USER_ID || !USER_CAN_UPLOAD_PICTURES) {
199 estlane 1.3 $cpgtpl->assign_block_vars('upload_pic',array(
200 estlane 1.4 'URL' => getlink('&amp;file=upload'),
201 estlane 1.4 'TITLE' => UPLOAD_PIC_TITLE,
202 estlane 1.4 'NAME' => UPLOAD_PIC_LNK
203 estlane 1.4 ));
204 nanocaio 1.1 }
205 nanocaio 1.1  
206 estlane 1.3 $cpgtpl->set_filenames(array('main_menu' => 'coppermine/main_menu.html'));
207 nanocaio 1.1  
208 estlane 1.4 if (version_compare(CPG_NUKE, '10.0.0', '>=')) {
209 estlane 1.4 return $cpgtpl->to_string('main_menu');
210 estlane 1.4 } else {
211 estlane 1.4 ob_start();
212 estlane 1.4 $cpgtpl->display('main_menu');
213 estlane 1.4 return ob_get_clean();
214 estlane 1.4 }
215 nanocaio 1.1 }
216 nanocaio 1.1  
217 nanocaio 1.1 function theme_admin_mode_menu()
218 nanocaio 1.1 {
219 estlane 1.3 global $CPG_URL, $cat, $album, $cat_l, $cop_templ;
220 nanocaio 1.1  
221 nanocaio 1.1 $cat_l = is_numeric($album) ? "&album=$album" : (is_numeric($cat) ? "&cat=$cat" :'');
222 nanocaio 1.1 //$cat_l = (is_numeric($cat)) ? "&cat=$cat" :'';
223 nanocaio 1.1 $html = '';
224 nanocaio 1.1 $userhtml ='';
225 nanocaio 1.1  
226 nanocaio 1.1 if (GALLERY_ADMIN_MODE) {
227 estlane 1.3 require($cop_templ.'/admin_menu.inc');
228 estlane 1.3 } elseif (USER_ADMIN_MODE) {
229 estlane 1.3 require($cop_templ.'/admin_menu_user.inc');
230 nanocaio 1.1 }
231 nanocaio 1.1 return $html;
232 nanocaio 1.1 }
233 nanocaio 1.1  
234 nanocaio 1.1  
235 estlane 1.3 function theme_display_cat_list($breadcrumb, &$cat_data, $statistics) {
236 estlane 1.3 global $cpgtpl;
237 estlane 1.3  
238 estlane 1.3 $cpgtpl->assign_vars(array(
239 estlane 1.3 'CATEGORY' => CATEGORY,
240 estlane 1.3 'ALBUMS' => ALBUMS,
241 estlane 1.3 'PICTURES' => PICTURES
242 estlane 1.4 ));
243 nanocaio 1.1  
244 estlane 1.4 $i=0;
245 nanocaio 1.1 foreach($cat_data as $category) {
246 estlane 1.11 $i++;
247 estlane 1.11  
248 estlane 1.4 if (count($category) == 2) {
249 estlane 1.4 $cpgtpl->assign_block_vars('catrow_noalb', array(
250 estlane 1.4 'CAT_TITLE' => $category[0],
251 estlane 1.4 'CAT_DESC' => $category[1],
252 estlane 1.4 'ROW_CLASS' => ($i%2)?'1':'2'
253 estlane 1.4 ));
254 estlane 1.3 } elseif (isset($category['cat_albums']) && ($category['cat_albums'] != '')) {
255 estlane 1.4 //Show category album
256 estlane 1.3 $cpgtpl->assign_block_vars('catrow', array(
257 estlane 1.4 'CAT_TITLE' => $category[0],
258 estlane 1.4 'CAT_DESC' => $category[1],
259 estlane 1.4 'CAT_ALBUMS' => $category['cat_albums'],
260 estlane 1.4 'ALB_COUNT' => $category[2],
261 estlane 1.4 'PIC_COUNT' => $category[3],
262 estlane 1.4 'ROW_CLASS' => ($i%2)?'1':'2'
263 estlane 1.4 ));
264 estlane 1.3 } else {
265 estlane 1.3 //Empty category
266 estlane 1.3 $cpgtpl->assign_block_vars('catrow_empty', array(
267 estlane 1.4 'CAT_TITLE' => $category[0],
268 estlane 1.4 'CAT_DESC' => $category[1],
269 estlane 1.4 'CAT_ALBUMS' => '',
270 estlane 1.4 'ALB_COUNT' => $category[2],
271 estlane 1.4 'PIC_COUNT' => $category[3],
272 estlane 1.4 'ROW_CLASS' => ($i%2)?'1':'2'
273 estlane 1.4 ));
274 estlane 1.3 }
275 estlane 1.11  
276 nanocaio 1.1 }
277 nanocaio 1.1  
278 nanocaio 1.1 if ($statistics && count($cat_data)>0) {
279 estlane 1.8 $cpgtpl->assign_vars(array(
280 estlane 1.4 'STATISTICS' => $statistics
281 estlane 1.4 ));
282 nanocaio 1.1 }
283 nanocaio 1.1  
284 estlane 1.3 $cpgtpl->set_filenames(array('cat_list' => 'coppermine/cat_list.html'));
285 estlane 1.4 $cpgtpl->display('cat_list',false);
286 nanocaio 1.1 }
287 nanocaio 1.1  
288 nanocaio 1.1  
289 estlane 1.3 function theme_display_breadcrumb($breadcrumb, &$cat_data) {
290 estlane 1.4 global $cpgtpl;
291 estlane 1.4 if ($breadcrumb) {
292 estlane 1.4 $cpgtpl->assign_vars(array(
293 estlane 1.4 'BREADCRUMB' => $breadcrumb
294 estlane 1.4 ));
295 estlane 1.4 $cpgtpl->set_filenames(array('breadcrumb' => 'coppermine/breadcrumb.html'));
296 estlane 1.4 $cpgtpl->display('breadcrumb');
297 estlane 1.3 }
298 nanocaio 1.1 }
299 nanocaio 1.1  
300 nanocaio 1.1 function theme_display_album_list(&$alb_list,$nbAlb, $cat, $page, $total_pages)
301 nanocaio 1.1 {
302 estlane 1.3 global $CONFIG, $STATS_IN_ALB_LIST, $CPG_URL, $CPG_M_URL, $statistics, $template_tab_display, $cpgtpl;
303 nanocaio 1.1  
304 nanocaio 1.1 $theme_alb_list_tab_tmpl = $template_tab_display;
305 nanocaio 1.1 $theme_alb_list_tab_tmpl['left_text'] = strtr($theme_alb_list_tab_tmpl['left_text'],array('{LEFT_TEXT}' => ALBUM_ON_PAGE));
306 nanocaio 1.1 $theme_alb_list_tab_tmpl['inactive_tab'] = strtr($theme_alb_list_tab_tmpl['inactive_tab'],array('{LINK}' => $CPG_M_URL.'&cat='.$cat.'&page=%d'));
307 nanocaio 1.1 $tabs = create_tabs($nbAlb, $page, $total_pages, $theme_alb_list_tab_tmpl);
308 nanocaio 1.1  
309 nanocaio 1.1 $count = 0;
310 nanocaio 1.1  
311 nanocaio 1.1 $columns = $CONFIG['album_list_cols'];
312 estlane 1.10 $column_width = floor(100/$columns);
313 nanocaio 1.1 $thumb_cell_width = $CONFIG['alb_list_thumb_size']+2;
314 nanocaio 1.1  
315 nanocaio 1.1 if ($STATS_IN_ALB_LIST) {
316 estlane 1.4 $cpgtpl->assign_block_vars('stat_row', array(
317 estlane 1.4 'STATISTICS' => $statistics,
318 estlane 1.4 'COLUMNS' => $columns
319 estlane 1.4 ));
320 nanocaio 1.1 }
321 nanocaio 1.1  
322 nanocaio 1.1 if (is_array($alb_list)) {
323 estlane 1.4 foreach($alb_list as $album) {
324 estlane 1.8 $count++;
325 estlane 1.3 $cpgtpl->assign_block_vars('album_cell', array(
326 estlane 1.4 'COL_WIDTH' => $column_width,
327 estlane 1.4 'ALBUM_TITLE' => $album['album_title'],
328 estlane 1.4 'THUMB_CELL_WIDTH' => $thumb_cell_width,
329 estlane 1.5 'ALB_LINK_TGT' => getlink('&amp;file=thumbnails&amp;album='.$album['aid']),
330 estlane 1.4 'ALB_LINK_PIC' => $album['thumb_pic'],
331 estlane 1.4 'ADMIN_MENU' => $album['album_adm_menu'],
332 estlane 1.4 'ALB_DESC' => $album['album_desc'],
333 estlane 1.8 'ALB_INFOS' => $album['album_info'],
334 estlane 1.8 'NEW_LINE' => ($count>1 && (($count-1) % $columns) == 0)
335 estlane 1.4 ));
336 estlane 1.3 }
337 nanocaio 1.1 }
338 nanocaio 1.1  
339 nanocaio 1.1 while ($count++ % $columns != 0) {
340 estlane 1.4 $cpgtpl->assign_block_vars('empty_cell', array(
341 estlane 1.4 'COL_WIDTH' => $column_width
342 estlane 1.4 ));
343 nanocaio 1.1 }
344 nanocaio 1.1  
345 estlane 1.3  
346 estlane 1.3 //Tab display
347 estlane 1.3 $cpgtpl->assign_block_vars('tabs', array(
348 estlane 1.3 'COLUMNS' => $columns,
349 estlane 1.3 'TABS' => $tabs,
350 estlane 1.4 ));
351 estlane 1.3  
352 estlane 1.4 $cpgtpl->assign_block_vars('spacer',array());
353 nanocaio 1.1  
354 estlane 1.3 $cpgtpl->set_filenames(array('album_list' => 'coppermine/album_list.html'));
355 estlane 1.4 $cpgtpl->display('album_list',false);
356 estlane 1.9 $cpgtpl->unset_block('album_cell');//So that the albums wont start repeating
357 nanocaio 1.1 }
358 nanocaio 1.1  
359 nanocaio 1.1 // Function to display Albums
360 nanocaio 1.1 function theme_display_album_list_cat(&$alb_list, $nbAlb, $cat, $page, $total_pages)
361 nanocaio 1.1 {
362 estlane 1.3 global $CONFIG, $STATS_IN_ALB_LIST, $CPG_URL, $CPG_M_URL, $statistics, $template_tab_display, $cpgtpl;
363 nanocaio 1.1 if (!$CONFIG['first_level']) {
364 nanocaio 1.1 return;
365 nanocaio 1.1 }
366 nanocaio 1.1  
367 nanocaio 1.1 $theme_alb_list_tab_tmpl = $template_tab_display;
368 nanocaio 1.1 $theme_alb_list_tab_tmpl['left_text'] = strtr($theme_alb_list_tab_tmpl['left_text'], array('{LEFT_TEXT}' => ALBUM_ON_PAGE));
369 nanocaio 1.1 $theme_alb_list_tab_tmpl['inactive_tab'] = strtr($theme_alb_list_tab_tmpl['inactive_tab'], array('{LINK}' => $CPG_M_URL.'&cat=' . $cat . '&page=%d'));
370 nanocaio 1.1 $tabs = create_tabs($nbAlb, $page, $total_pages, $theme_alb_list_tab_tmpl);
371 nanocaio 1.1  
372 nanocaio 1.1 $count = 0;
373 nanocaio 1.1  
374 nanocaio 1.1 $columns = $CONFIG['album_list_cols'];
375 estlane 1.10 $column_width = floor(100 / $columns);
376 nanocaio 1.1 $thumb_cell_width = $CONFIG['alb_list_thumb_size'] + 2;
377 nanocaio 1.1  
378 nanocaio 1.1 if ($STATS_IN_ALB_LIST) {
379 estlane 1.8 $cpgtpl->assign_vars(array(
380 estlane 1.8 'STATISTICS' => $statistics
381 estlane 1.4 ));
382 nanocaio 1.1 }
383 nanocaio 1.1  
384 nanocaio 1.1 if (is_array($alb_list)) {
385 estlane 1.4 foreach($alb_list as $album) {
386 estlane 1.8 $count++;
387 estlane 1.3 $cpgtpl->assign_block_vars('c_album_cell', array(
388 estlane 1.3 'COL_WIDTH' => $column_width,
389 estlane 1.3 'ALBUM_TITLE' => $album['album_title'],
390 estlane 1.3 'THUMB_CELL_WIDTH' => $thumb_cell_width,
391 estlane 1.6 'ALB_LINK_TGT' => getlink('&amp;file=thumbnails&amp;album='.$album['aid']),
392 estlane 1.3 'ALB_LINK_PIC' => $album['thumb_pic'],
393 estlane 1.3 'ADMIN_MENU' => $album['album_adm_menu'],
394 estlane 1.3 'ALB_DESC' => $album['album_desc'],
395 estlane 1.8 'ALB_INFOS' => $album['album_info'],
396 estlane 1.8 'NEW_LINE' => ($count>1 && (($count-1) % $columns) == 0)
397 estlane 1.4 ));
398 estlane 1.3 }
399 nanocaio 1.1 }
400 nanocaio 1.1  
401 nanocaio 1.1 while ($count++ % $columns != 0) {
402 estlane 1.4 $cpgtpl->assign_block_vars('c_empty_cell', array(
403 estlane 1.4 'COL_WIDTH' => $column_width
404 estlane 1.4 ));
405 nanocaio 1.1 }
406 nanocaio 1.1  
407 estlane 1.3 //Tab display
408 estlane 1.3 $cpgtpl->assign_block_vars('c_tabs', array(
409 estlane 1.4 'COLUMNS' => $columns,
410 estlane 1.4 'TABS' => $tabs,
411 estlane 1.4 ));
412 nanocaio 1.1  
413 estlane 1.3 $cpgtpl->set_filenames(array('album_list_cat' => 'coppermine/album_list_cat.html'));
414 estlane 1.4 $cpgtpl->display('album_list_cat',false);
415 estlane 1.9  
416 estlane 1.9 $cpgtpl->unset_block('c_album_cell');//So that albums wont start repeating
417 estlane 1.3 }
418 estlane 1.3  
419 estlane 1.3 function sort_selected($method) {
420 estlane 1.4 return (isset($_GET['sort']) && $_GET['sort']==$method)? ' selected="selected"':'';
421 nanocaio 1.1 }
422 nanocaio 1.1  
423 nanocaio 1.1 function theme_display_thumbnails(&$thumb_list, $nbThumb, $album_name, $page_link, $page, $total_pages, $sort_options, $display_tabs, $mode='thumb')
424 nanocaio 1.1 {
425 estlane 1.8 global $CONFIG, $CPG_URL, $CPG_M_URL, $template_tab_display, $cop_templ, $cpgtpl, $module_name, $file;
426 nanocaio 1.1  
427 estlane 1.3 $theme_thumb_tab_tmpl = $template_tab_display;
428 nanocaio 1.1  
429 nanocaio 1.1 if ($mode == 'thumb') {
430 estlane 1.4 $theme_thumb_tab_tmpl['left_text'] = strtr($theme_thumb_tab_tmpl['left_text'],array('{LEFT_TEXT}' => PIC_ON_PAGE));
431 nanocaio 1.1 } else {
432 estlane 1.3 $theme_thumb_tab_tmpl['left_text'] = strtr($theme_thumb_tab_tmpl['left_text'],array('{LEFT_TEXT}' => USER_ON_PAGE));
433 nanocaio 1.1 }
434 estlane 1.8  
435 nanocaio 1.1 $theme_thumb_tab_tmpl['inactive_tab'] = strtr($theme_thumb_tab_tmpl['inactive_tab'],array('{LINK}' => $page_link));
436 nanocaio 1.1  
437 nanocaio 1.1 $thumbcols = $CONFIG['thumbcols'];
438 estlane 1.10 $cell_width = floor(100/$CONFIG['thumbcols']).'%';
439 nanocaio 1.1  
440 nanocaio 1.1 $tabs_html = $display_tabs ? create_tabs($nbThumb, $page, $total_pages, $theme_thumb_tab_tmpl) : '';
441 nanocaio 1.1  
442 estlane 1.8  
443 nanocaio 1.1 // The sort order options are not available for meta albums
444 estlane 1.3 if ($mode == 'thumb') {
445 estlane 1.4 $cpgtpl->assign_vars(array(
446 estlane 1.4 'TITLE' => $album_name,
447 estlane 1.4 'THUMBCOLS' => $thumbcols,
448 estlane 1.4 'SORT_OPTIONS' => 0,
449 estlane 1.4 ));
450 estlane 1.3 } else {
451 estlane 1.4 $cpgtpl->assign_vars(array(
452 estlane 1.4 'TITLE' => '',
453 estlane 1.4 'THUMBCOLS' => '',
454 estlane 1.4 'SORT_OPTIONS' => 0,
455 estlane 1.4 ));
456 estlane 1.4 }
457 estlane 1.4  
458 estlane 1.4 if ($sort_options) {
459 estlane 1.4 $hidden_input = '<input type="hidden" name="name" value="'.$module_name.'" />
460 estlane 1.4 <input type="hidden" name="file" value="thumbnails" />
461 estlane 1.4 <input type="hidden" name="album" value="'.intval($_GET['album']).'" />
462 estlane 1.4 <input type="hidden" name="page" value="'.(isset($_GET['page']) ? intval($_GET['page']) : '1').'" />';
463 estlane 1.4  
464 estlane 1.4 $cpgtpl->assign_vars(array(
465 estlane 1.4 'SORT_OPTIONS' => 1,
466 estlane 1.4 'HIDDEN_INPUT' => $hidden_input,
467 estlane 1.4 'TA_SELECTED' => sort_selected('ta'),
468 estlane 1.4 'NA_SELECTED' => sort_selected('na'),
469 estlane 1.4 'ND_SELECTED' => sort_selected('nd'),
470 estlane 1.4 'DA_SELECTED' => sort_selected('da'),
471 estlane 1.4 'DD_SELECTED' => sort_selected('dd'),
472 estlane 1.4 'RA_SELECTED' => sort_selected('ra'),
473 estlane 1.4 'RD_SELECTED' => sort_selected('rd'),
474 estlane 1.4 'SORT_TA' => SORT_TA,
475 estlane 1.4 'SORT_NA' => SORT_NA,
476 estlane 1.4 'SORT_ND' => SORT_ND,
477 estlane 1.4 'SORT_DA' => SORT_DA,
478 estlane 1.4 'SORT_DD' => SORT_DD,
479 estlane 1.4 'SORT_RA' => SORT_RA,
480 estlane 1.4 'SORT_RD' => SORT_RD
481 estlane 1.4 ));
482 estlane 1.4 }
483 estlane 1.3  
484 nanocaio 1.1 $i = 0;
485 estlane 1.3 foreach($thumb_list as $thumb) {
486 estlane 1.4 $i++;
487 estlane 1.3 $cpgtpl->assign_block_vars('thumb_cell', array(
488 estlane 1.8 'CELL_WIDTH' => $cell_width,
489 estlane 1.8 'LINK_TGT' => $thumb['url'],
490 estlane 1.8 'THUMB' => $thumb['image'],
491 estlane 1.8 'CAPTION' => $thumb['caption'],
492 estlane 1.8 'ADMIN_MENU' => ($mode == 'thumb') ? $thumb['admin_menu'] : '',
493 estlane 1.8 'NEW_LINE' => ($i>1 && ((($i-1) % $thumbcols) == 0))
494 estlane 1.4 ));
495 estlane 1.3  
496 nanocaio 1.1 }
497 estlane 1.3  
498 estlane 1.3 for (;($i % $thumbcols); $i++) {
499 estlane 1.4 $cpgtpl->assign_block_vars('empty_cell',array());
500 nanocaio 1.1 }
501 estlane 1.3  
502 nanocaio 1.1 if ($display_tabs) {
503 estlane 1.8 $cpgtpl->assign_vars(array(
504 estlane 1.8 'TABS_THUMBS' => $tabs_html
505 estlane 1.4 ));
506 nanocaio 1.1 }
507 nanocaio 1.1  
508 estlane 1.3 $cpgtpl->set_filenames(array('thumbnail_view' => 'coppermine/thumbnail_view.html'));
509 estlane 1.4 $cpgtpl->display('thumbnail_view',false);
510 estlane 1.3  
511 estlane 1.3 $cpgtpl->unset_block('thumb_cell');//So that the images wont start repeating
512 nanocaio 1.1 }
513 nanocaio 1.1  
514 estlane 1.3  
515 nanocaio 1.1 // Added to display film_strip
516 estlane 1.3 function theme_display_film_strip(&$thumb_list) {
517 estlane 1.5 global $CONFIG, $CPG_URL, $CPG_M_URL, $cop_imag, $cpgtpl, $pos, $pic_count;
518 estlane 1.3  
519 estlane 1.3  
520 estlane 1.5 $thumbcols = $CONFIG['thumbcols'];
521 estlane 1.10 $cell_width = floor(100 / $CONFIG['max_film_strip_items']) . '%';
522 estlane 1.5 $i = 0;
523 estlane 1.5 $thumb_strip = '';
524 estlane 1.5  
525 estlane 1.5 foreach($thumb_list as $thumb) {
526 estlane 1.5 $i++;
527 estlane 1.5 $cpgtpl->assign_block_vars('thumb_cell',array(
528 estlane 1.5 'CELL_WIDTH' => $cell_width,
529 estlane 1.5 'LINK_TGT' => $thumb['url'],
530 estlane 1.5 'THUMB' => $thumb['image'],
531 estlane 1.5 'CAPTION' => $thumb['caption'],
532 estlane 1.5 'ADMIN_MENU' => $thumb['admin_menu'],
533 estlane 1.5 'CURRENT' => ($thumb['pos']==$pos)?' class="currentpic"':'',
534 estlane 1.5 'PIC_POSITION'=> sprintf(PIC_POS, $thumb['pos']+1, $pic_count)
535 estlane 1.4 ));
536 estlane 1.5 }
537 estlane 1.5  
538 estlane 1.5 $cpgtpl->assign_vars(array(
539 estlane 1.5 //'COLS' => $i,
540 estlane 1.5 'TILE_IMAGE' => $cop_imag.'/tile.gif'
541 estlane 1.5 ));
542 estlane 1.3  
543 estlane 1.5 $cpgtpl->set_filenames(array('film_strip' => 'coppermine/display_image/film_strip.html'));
544 estlane 1.3  
545 estlane 1.5 if (version_compare(CPG_NUKE, '10.0.0', '>=')) {
546 estlane 1.5 return $cpgtpl->to_string('film_strip');
547 estlane 1.5 } else {
548 estlane 1.5 ob_start();
549 estlane 1.5 $cpgtpl->display('film_strip');
550 estlane 1.5 return ob_get_clean();
551 estlane 1.5 }
552 nanocaio 1.1 }
553 nanocaio 1.1  
554 estlane 1.3 function theme_no_img_to_display($album_name) {
555 estlane 1.4 global $cpgtpl;
556 estlane 1.3  
557 estlane 1.3 $cpgtpl->assign_vars(array(
558 estlane 1.4 'ALBUM_NAME' => $album_name,
559 estlane 1.4 'NO_IMG_TO_DISPLAY' => NO_IMG_TO_DISPLAY
560 estlane 1.3 ));
561 estlane 1.3  
562 estlane 1.3 $cpgtpl->set_filenames(array('no_img_to_display' => 'coppermine/no_img_to_display.html'));
563 estlane 1.3 $cpgtpl->display('no_img_to_display');
564 nanocaio 1.1 }
565 nanocaio 1.1  
566 estlane 1.3 function theme_display_image($nav_menu, $picture, $votes, $pic_info, $comments, $film_strip) {
567 estlane 1.4 global $CONFIG, $cpgtpl;
568 nanocaio 1.1  
569 estlane 1.3 $cpgtpl->assign_vars(array(
570 estlane 1.4 'NAV_MENU' => $nav_menu,
571 estlane 1.4 'PICTURE' => $picture,
572 estlane 1.4 'FILM_STRIP' => ($CONFIG['display_film_strip'] == 1)? $film_strip : '',
573 estlane 1.4 'VOTES' => $votes,
574 estlane 1.4 'PIC_INFO' => $pic_info,
575 estlane 1.4 'COMMENTS' => $comments,
576 estlane 1.3 ));
577 nanocaio 1.1  
578 estlane 1.3 $cpgtpl->set_filenames(array('display_image' => 'coppermine/display_image.html'));
579 estlane 1.3 $cpgtpl->display('display_image');
580 estlane 1.3 }
581 nanocaio 1.1  
582 estlane 1.3 function theme_html_picinfo(&$info) {
583 estlane 1.4 global $HTTP_COOKIE_VARS, $CONFIG, $cpgtpl;
584 nanocaio 1.1  
585 estlane 1.3 $infovisible = isset($HTTP_COOKIE_VARS['picinfo']) ? $HTTP_COOKIE_VARS['picinfo'] : ($CONFIG['display_pic_info'] ? 'block' : 'none');
586 nanocaio 1.1  
587 estlane 1.3 $cpgtpl->assign_vars(array(
588 estlane 1.4 'PIC_INF_TITLE' => PIC_INF_TITLE,
589 estlane 1.4 'INFOVISIBLE' => $infovisible
590 estlane 1.3 ));
591 nanocaio 1.1  
592 estlane 1.3 foreach ($info as $key => $value) {
593 estlane 1.3 $cpgtpl->assign_block_vars('info',array(
594 estlane 1.4 'KEY' => $key,
595 estlane 1.4 'VALUE' => $value
596 estlane 1.4 ));
597 estlane 1.3 }
598 nanocaio 1.1  
599 estlane 1.3 $cpgtpl->set_filenames(array('pic_info' => 'coppermine/display_image/pic_info.html'));
600 estlane 1.3  
601 estlane 1.4 if (version_compare(CPG_NUKE, '10.0.0', '>=')) {
602 estlane 1.4 return $cpgtpl->to_string('pic_info');
603 estlane 1.4 } else {
604 estlane 1.4 ob_start();
605 estlane 1.4 $cpgtpl->display('pic_info');
606 estlane 1.4 return ob_get_clean();
607 estlane 1.4 }
608 nanocaio 1.1 }


Code Credits - Privacy Policy