source: tags/build-A01/include/menubar.inc.php @ 12409

Last change on this file since 12409 was 1703, checked in by rvelices, 17 years ago

feature 606: search engine spider restrictions (meta robots)

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 8.9 KB
Line 
1<?php
2// +-----------------------------------------------------------------------+
3// | PhpWebGallery - a PHP based picture gallery                           |
4// | Copyright (C) 2002-2003 Pierrick LE GALL - pierrick@phpwebgallery.net |
5// | Copyright (C) 2003-2007 PhpWebGallery Team - http://phpwebgallery.net |
6// +-----------------------------------------------------------------------+
7// | branch        : BSF (Best So Far)
8// | file          : $Id: menubar.inc.php 1703 2007-01-09 01:30:02Z rvelices $
9// | last update   : $Date: 2007-01-09 01:30:02 +0000 (Tue, 09 Jan 2007) $
10// | last modifier : $Author: rvelices $
11// | revision      : $Revision: 1703 $
12// +-----------------------------------------------------------------------+
13// | This program is free software; you can redistribute it and/or modify  |
14// | it under the terms of the GNU General Public License as published by  |
15// | the Free Software Foundation                                          |
16// |                                                                       |
17// | This program is distributed in the hope that it will be useful, but   |
18// | WITHOUT ANY WARRANTY; without even the implied warranty of            |
19// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU      |
20// | General Public License for more details.                              |
21// |                                                                       |
22// | You should have received a copy of the GNU General Public License     |
23// | along with this program; if not, write to the Free Software           |
24// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
25// | USA.                                                                  |
26// +-----------------------------------------------------------------------+
27
28/**
29 * This file is included by the main page to show the menu bar
30 *
31 */
32$template->set_filenames(
33  array(
34    'menubar' => 'menubar.tpl',
35    )
36  );
37
38trigger_action('loc_begin_menubar');
39
40$template->assign_vars(
41  array(
42    'NB_PICTURE' => $user['nb_total_images'],
43    'USERNAME' => $user['username'],
44    'MENU_CATEGORIES_CONTENT' => get_categories_menu(),
45    'F_IDENTIFY' => get_root_url().'identification.php',
46    'U_HOME' => make_index_url(),
47    'U_REGISTER' => get_root_url().'register.php',
48    'U_LOST_PASSWORD' => get_root_url().'password.php',
49    'U_LOGOUT' => get_root_url().'?act=logout',
50    'U_ADMIN'=> get_root_url().'admin.php',
51    'U_PROFILE'=> get_root_url().'profile.php',
52    )
53  );
54
55//-------------------------------------------------------------- external links
56foreach ($conf['links'] as $url => $label)
57{
58  $template->assign_block_vars(
59    'links.link',
60    array(
61      'URL' => $url,
62      'LABEL' => $label
63      )
64    );
65}
66
67//------------------------------------------------------------------------ filter
68if ($filter['enabled'])
69{
70  $template->assign_block_vars(
71    'stop_filter',
72    array(
73      'URL' => add_url_params(make_index_url(array()), array('filter' => 'stop'))
74      )
75    );
76}
77else
78{
79  $template->assign_block_vars(
80    'start_filter',
81    array(
82      'URL' => add_url_params(make_index_url(array()), array('filter' => 'start'))
83      )
84    );
85}
86
87
88//------------------------------------------------------------------------ tags
89if ('tags' == $page['section'])
90{
91  // display tags associated to currently tagged items, less current tags
92  $tags = array();
93  if ( !empty($page['items']) )
94  {
95    $tags = get_common_tags($page['items'],
96        $conf['menubar_tag_cloud_items_number'], $page['tag_ids']);
97  }
98
99  $tags = add_level_to_tags($tags);
100
101  foreach ($tags as $tag)
102  {
103    $template->assign_block_vars(
104      'tags.tag',
105      array(
106        'URL' => make_index_url(
107          array(
108            'tags' => array(
109              array(
110                'id' => $tag['tag_id'],
111                'url_name' => $tag['url_name'],
112                ),
113              )
114            )
115          ),
116
117        'NAME' => $tag['name'],
118
119        'TITLE' => l10n('See pictures linked to this tag only'),
120
121        'CLASS' => 'tagLevel'.$tag['level']
122        )
123      );
124
125    $template->assign_block_vars(
126      'tags.tag.add',
127      array(
128        'URL' => make_index_url(
129          array(
130            'tags' => array_merge(
131              $page['tags'],
132              array(
133                array(
134                  'id' => $tag['tag_id'],
135                  'url_name' => $tag['url_name'],
136                  ),
137                )
138              )
139            )
140          ),
141        'TITLE' => sprintf(
142          l10n('%d pictures are also linked to current tags'),
143          $tag['counter']
144          ),
145        )
146      );
147
148  }
149}
150//---------------------------------------------------------- special categories
151// favorites categories
152if ( !$user['is_the_guest'] )
153{
154  $template->assign_block_vars('username', array());
155
156  $template->assign_block_vars(
157    'special_cat',
158    array(
159      'URL' => make_index_url(array('section' => 'favorites')),
160      'TITLE' => $lang['favorite_cat_hint'],
161      'NAME' => $lang['favorite_cat']
162      ));
163}
164// most visited
165$template->assign_block_vars(
166  'special_cat',
167  array(
168    'URL' => make_index_url(array('section' => 'most_visited')),
169    'TITLE' => $lang['most_visited_cat_hint'],
170    'NAME' => $lang['most_visited_cat']
171    ));
172// best rated
173if ($conf['rate'])
174{
175  $template->assign_block_vars(
176    'special_cat',
177    array(
178      'URL' => make_index_url(array('section' => 'best_rated')),
179      'TITLE' => $lang['best_rated_cat_hint'],
180      'NAME' => $lang['best_rated_cat']
181      )
182    );
183}
184// random
185$template->assign_block_vars(
186  'special_cat',
187  array(
188    'URL' => get_root_url().'random.php',
189    'TITLE' => $lang['random_cat_hint'],
190    'NAME' => $lang['random_cat'],
191    'REL'=> 'rel="nofollow"'
192    ));
193
194// recent pics
195$template->assign_block_vars(
196  'special_cat',
197  array(
198    'URL' => make_index_url(array('section' => 'recent_pics')),
199    'TITLE' => $lang['recent_pics_cat_hint'],
200    'NAME' => $lang['recent_pics_cat'],
201    ));
202// recent cats
203$template->assign_block_vars(
204  'special_cat',
205  array(
206    'URL' => make_index_url(array('section' => 'recent_cats')),
207    'TITLE' => $lang['recent_cats_cat_hint'],
208    'NAME' => $lang['recent_cats_cat'],
209    ));
210
211// calendar
212$template->assign_block_vars(
213  'special_cat',
214  array(
215    'URL' =>
216      make_index_url(
217        array(
218          'chronology_field' => ($conf['calendar_datefield']=='date_available'
219                                  ? 'posted' : 'created'),
220           'chronology_style'=> 'monthly',
221           'chronology_view' => 'calendar'
222        )
223      ),
224    'TITLE' => $lang['calendar_hint'],
225    'NAME' => $lang['calendar'],
226    'REL'=> 'rel="nofollow"'
227    )
228  );
229//--------------------------------------------------------------------- summary
230
231if ($user['is_the_guest'])
232{
233  $template->assign_block_vars('login', array());
234
235  $template->assign_block_vars('quickconnect', array());
236  if ($conf['authorize_remembering'])
237  {
238    $template->assign_block_vars('quickconnect.remember_me', array());
239  }
240  if ($conf['allow_user_registration'])
241  {
242    $template->assign_block_vars('register', array());
243    $template->assign_block_vars('quickconnect.register', array());
244  }
245}
246else
247{
248  $template->assign_block_vars('hello', array());
249
250  if (is_autorize_status(ACCESS_CLASSIC))
251  {
252    $template->assign_block_vars('profile', array());
253  }
254
255  // the logout link has no meaning with Apache authentication : it is not
256  // possible to logout with this kind of authentication.
257  if (!$conf['apache_authentication'])
258  {
259    $template->assign_block_vars('logout', array());
260  }
261
262  if (is_admin())
263  {
264    $template->assign_block_vars('admin', array());
265  }
266}
267
268// tags link
269$template->assign_block_vars(
270  'summary',
271  array(
272    'TITLE' => l10n('See available tags'),
273    'NAME' => l10n('Tags'),
274    'U_SUMMARY'=> get_root_url().'tags.php',
275    )
276  );
277
278// search link
279$template->assign_block_vars(
280  'summary',
281  array(
282    'TITLE'=>$lang['hint_search'],
283    'NAME'=>$lang['search'],
284    'U_SUMMARY'=> get_root_url().'search.php',
285    'REL'=> 'rel="search"'
286    )
287  );
288$template->assign_block_vars( 'summary.quick_search',  array() );
289
290// comments link
291$template->assign_block_vars(
292  'summary',
293  array(
294    'TITLE'=>$lang['hint_comments'],
295    'NAME'=>$lang['comments'],
296    'U_SUMMARY'=> get_root_url().'comments.php',
297    )
298  );
299
300// about link
301$template->assign_block_vars(
302  'summary',
303  array(
304    'TITLE'     => $lang['about_page_title'],
305    'NAME'      => $lang['About'],
306    'U_SUMMARY' => get_root_url().'about.php',
307    )
308  );
309
310// notification
311$template->assign_block_vars(
312  'summary',
313  array(
314    'TITLE'=>l10n('RSS feed'),
315    'NAME'=>l10n('Notification'),
316    'U_SUMMARY'=> get_root_url().'notification.php',
317    'REL'=> 'rel="nofollow"'
318    )
319  );
320
321if (isset($page['category']) and $page['cat_uploadable'] )
322{ // upload a picture in the category
323  $url = get_root_url().'upload.php?cat='.$page['category'];
324  $template->assign_block_vars(
325    'upload',
326    array(
327      'U_UPLOAD'=> $url
328      )
329    );
330}
331
332trigger_action('loc_end_menubar');
333$template->assign_var_from_handle('MENUBAR', 'menubar');
334?>
Note: See TracBrowser for help on using the repository browser.