2006-06-22 21:21:56 +02:00
|
|
|
<?php
|
|
|
|
// +-----------------------------------------------------------------------+
|
|
|
|
// | PhpWebGallery - a PHP based picture gallery |
|
|
|
|
// | Copyright (C) 2002-2003 Pierrick LE GALL - pierrick@phpwebgallery.net |
|
2008-03-01 14:12:07 +01:00
|
|
|
// | Copyright (C) 2003-2008 PhpWebGallery Team - http://phpwebgallery.net |
|
2006-06-22 21:21:56 +02:00
|
|
|
// +-----------------------------------------------------------------------+
|
2006-07-26 23:00:16 +02:00
|
|
|
// | file : $Id$
|
|
|
|
// | last update : $Date$
|
|
|
|
// | last modifier : $Author$
|
|
|
|
// | revision : $Revision$
|
2006-06-22 21:21:56 +02:00
|
|
|
// +-----------------------------------------------------------------------+
|
|
|
|
// | This program is free software; you can redistribute it and/or modify |
|
|
|
|
// | it under the terms of the GNU General Public License as published by |
|
|
|
|
// | the Free Software Foundation |
|
|
|
|
// | |
|
|
|
|
// | This program is distributed in the hope that it will be useful, but |
|
|
|
|
// | WITHOUT ANY WARRANTY; without even the implied warranty of |
|
|
|
|
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
|
|
|
|
// | General Public License for more details. |
|
|
|
|
// | |
|
|
|
|
// | You should have received a copy of the GNU General Public License |
|
|
|
|
// | along with this program; if not, write to the Free Software |
|
|
|
|
// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
|
|
|
|
// | USA. |
|
|
|
|
// +-----------------------------------------------------------------------+
|
|
|
|
|
|
|
|
/**
|
|
|
|
* This file is included by the main page to show the menu bar
|
|
|
|
*
|
2006-07-06 04:45:26 +02:00
|
|
|
*/
|
2006-06-22 21:21:56 +02:00
|
|
|
$template->set_filenames(
|
|
|
|
array(
|
|
|
|
'menubar' => 'menubar.tpl',
|
|
|
|
)
|
|
|
|
);
|
|
|
|
|
2006-11-07 01:55:36 +01:00
|
|
|
trigger_action('loc_begin_menubar');
|
|
|
|
|
2008-03-01 14:12:07 +01:00
|
|
|
$template->assign(
|
2006-06-22 21:21:56 +02:00
|
|
|
array(
|
|
|
|
'NB_PICTURE' => $user['nb_total_images'],
|
|
|
|
'MENU_CATEGORIES_CONTENT' => get_categories_menu(),
|
2007-02-08 00:08:04 +01:00
|
|
|
'U_CATEGORIES' => make_index_url(array('section' => 'categories')),
|
2006-06-22 21:21:56 +02:00
|
|
|
'U_LOST_PASSWORD' => get_root_url().'password.php',
|
|
|
|
)
|
|
|
|
);
|
|
|
|
|
|
|
|
//-------------------------------------------------------------- external links
|
2007-01-17 23:27:10 +01:00
|
|
|
foreach ($conf['links'] as $url => $url_data)
|
2006-06-22 21:21:56 +02:00
|
|
|
{
|
2007-01-17 23:27:10 +01:00
|
|
|
if (!is_array($url_data))
|
|
|
|
{
|
|
|
|
$url_data = array('label' => $url_data);
|
|
|
|
}
|
|
|
|
|
2008-03-01 14:12:07 +01:00
|
|
|
if
|
2007-01-17 23:27:10 +01:00
|
|
|
(
|
|
|
|
(!isset($url_data['eval_visible']))
|
|
|
|
or
|
|
|
|
(eval($url_data['eval_visible']))
|
|
|
|
)
|
|
|
|
{
|
2008-03-01 14:12:07 +01:00
|
|
|
$tpl_var = array(
|
2007-01-17 23:27:10 +01:00
|
|
|
'URL' => $url,
|
|
|
|
'LABEL' => $url_data['label']
|
|
|
|
);
|
2008-03-01 14:12:07 +01:00
|
|
|
|
2007-01-18 23:01:28 +01:00
|
|
|
if (!isset($url_data['new_window']) or $url_data['new_window'])
|
2007-01-17 23:27:10 +01:00
|
|
|
{
|
2008-03-01 14:12:07 +01:00
|
|
|
$tpl_var['new_window'] =
|
2007-01-22 23:06:17 +01:00
|
|
|
array(
|
2008-03-01 14:12:07 +01:00
|
|
|
'NAME' => (isset($url_data['nw_name']) ? $url_data['nw_name'] : ''),
|
|
|
|
'FEATURES' => (isset($url_data['nw_features']) ? $url_data['nw_features'] : '')
|
2007-01-22 23:06:17 +01:00
|
|
|
);
|
2007-01-17 23:27:10 +01:00
|
|
|
}
|
2008-03-01 14:12:07 +01:00
|
|
|
$template->append('links', $tpl_var);
|
2007-01-17 23:27:10 +01:00
|
|
|
}
|
2006-06-22 21:21:56 +02:00
|
|
|
}
|
2006-12-21 22:38:20 +01:00
|
|
|
|
|
|
|
//------------------------------------------------------------------------ filter
|
2007-01-15 01:09:14 +01:00
|
|
|
if (!empty($conf['filter_pages']) and get_filter_page_value('used'))
|
2006-12-21 22:38:20 +01:00
|
|
|
{
|
2007-01-15 01:09:14 +01:00
|
|
|
if ($filter['enabled'])
|
|
|
|
{
|
2008-03-01 14:12:07 +01:00
|
|
|
$template->assign(
|
|
|
|
'U_STOP_FILTER',
|
|
|
|
add_url_params(make_index_url(array()), array('filter' => 'stop'))
|
2007-01-15 01:09:14 +01:00
|
|
|
);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2008-03-01 14:12:07 +01:00
|
|
|
$template->assign(
|
|
|
|
'U_START_FILTER',
|
|
|
|
add_url_params(make_index_url(array()), array('filter' => 'start-recent-'.$user['recent_period']))
|
2007-01-15 01:09:14 +01:00
|
|
|
);
|
|
|
|
}
|
2006-12-21 22:38:20 +01:00
|
|
|
}
|
|
|
|
|
2006-06-22 21:21:56 +02:00
|
|
|
//------------------------------------------------------------------------ tags
|
2008-03-01 14:12:07 +01:00
|
|
|
if ('tags' == @$page['section'])
|
2006-06-22 21:21:56 +02:00
|
|
|
{
|
|
|
|
// display tags associated to currently tagged items, less current tags
|
|
|
|
$tags = array();
|
|
|
|
if ( !empty($page['items']) )
|
|
|
|
{
|
2006-08-15 04:06:06 +02:00
|
|
|
$tags = get_common_tags($page['items'],
|
|
|
|
$conf['menubar_tag_cloud_items_number'], $page['tag_ids']);
|
2006-06-22 21:21:56 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
$tags = add_level_to_tags($tags);
|
|
|
|
|
|
|
|
foreach ($tags as $tag)
|
|
|
|
{
|
2008-03-01 14:12:07 +01:00
|
|
|
$template->append(
|
|
|
|
'related_tags',
|
2006-06-22 21:21:56 +02:00
|
|
|
array(
|
2008-03-01 14:12:07 +01:00
|
|
|
'U_TAG' => make_index_url(
|
2006-06-22 21:21:56 +02:00
|
|
|
array(
|
2007-02-14 02:37:38 +01:00
|
|
|
'tags' => array($tag)
|
2006-06-22 21:21:56 +02:00
|
|
|
)
|
|
|
|
),
|
|
|
|
|
|
|
|
'NAME' => $tag['name'],
|
|
|
|
|
2008-03-01 14:12:07 +01:00
|
|
|
'CLASS' => 'tagLevel'.$tag['level'],
|
2006-06-22 21:21:56 +02:00
|
|
|
|
2008-03-01 14:12:07 +01:00
|
|
|
'add' => array(
|
2006-11-07 01:55:36 +01:00
|
|
|
|
2008-03-01 14:12:07 +01:00
|
|
|
'URL' => make_index_url(
|
|
|
|
array(
|
|
|
|
'tags' => array_merge(
|
|
|
|
$page['tags'],
|
|
|
|
array($tag)
|
|
|
|
)
|
|
|
|
)
|
|
|
|
),
|
|
|
|
'COUNTER' => $tag['counter'],
|
2006-11-07 01:55:36 +01:00
|
|
|
)
|
2006-06-22 21:21:56 +02:00
|
|
|
)
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
//---------------------------------------------------------- special categories
|
|
|
|
// favorites categories
|
2007-06-06 00:01:15 +02:00
|
|
|
if ( !is_a_guest() )
|
2006-06-22 21:21:56 +02:00
|
|
|
{
|
2008-03-01 14:12:07 +01:00
|
|
|
$template->append(
|
|
|
|
'special_categories',
|
2006-06-22 21:21:56 +02:00
|
|
|
array(
|
2006-07-26 23:00:16 +02:00
|
|
|
'URL' => make_index_url(array('section' => 'favorites')),
|
2008-01-30 23:07:07 +01:00
|
|
|
'TITLE' => l10n('favorite_cat_hint'),
|
|
|
|
'NAME' => l10n('favorite_cat')
|
2006-06-22 21:21:56 +02:00
|
|
|
));
|
|
|
|
}
|
|
|
|
// most visited
|
2008-03-01 14:12:07 +01:00
|
|
|
$template->append(
|
|
|
|
'special_categories',
|
2006-06-22 21:21:56 +02:00
|
|
|
array(
|
2006-07-26 23:00:16 +02:00
|
|
|
'URL' => make_index_url(array('section' => 'most_visited')),
|
2008-01-30 23:07:07 +01:00
|
|
|
'TITLE' => l10n('most_visited_cat_hint'),
|
|
|
|
'NAME' => l10n('most_visited_cat')
|
2006-06-22 21:21:56 +02:00
|
|
|
));
|
|
|
|
// best rated
|
|
|
|
if ($conf['rate'])
|
|
|
|
{
|
2008-03-01 14:12:07 +01:00
|
|
|
$template->append(
|
|
|
|
'special_categories',
|
2006-06-22 21:21:56 +02:00
|
|
|
array(
|
2006-07-26 23:00:16 +02:00
|
|
|
'URL' => make_index_url(array('section' => 'best_rated')),
|
2008-01-30 23:07:07 +01:00
|
|
|
'TITLE' => l10n('best_rated_cat_hint'),
|
|
|
|
'NAME' => l10n('best_rated_cat')
|
2006-06-22 21:21:56 +02:00
|
|
|
)
|
|
|
|
);
|
|
|
|
}
|
|
|
|
// random
|
2008-03-01 14:12:07 +01:00
|
|
|
$template->append(
|
|
|
|
'special_categories',
|
2006-06-22 21:21:56 +02:00
|
|
|
array(
|
|
|
|
'URL' => get_root_url().'random.php',
|
2008-01-30 23:07:07 +01:00
|
|
|
'TITLE' => l10n('random_cat_hint'),
|
|
|
|
'NAME' => l10n('random_cat'),
|
2007-01-09 02:30:02 +01:00
|
|
|
'REL'=> 'rel="nofollow"'
|
2006-06-22 21:21:56 +02:00
|
|
|
));
|
2006-12-10 23:48:32 +01:00
|
|
|
|
2006-12-12 07:17:53 +01:00
|
|
|
// recent pics
|
2008-03-01 14:12:07 +01:00
|
|
|
$template->append(
|
|
|
|
'special_categories',
|
2006-12-12 07:17:53 +01:00
|
|
|
array(
|
|
|
|
'URL' => make_index_url(array('section' => 'recent_pics')),
|
2008-01-30 23:07:07 +01:00
|
|
|
'TITLE' => l10n('recent_pics_cat_hint'),
|
|
|
|
'NAME' => l10n('recent_pics_cat'),
|
2006-12-12 07:17:53 +01:00
|
|
|
));
|
|
|
|
// recent cats
|
2008-03-01 14:12:07 +01:00
|
|
|
$template->append(
|
|
|
|
'special_categories',
|
2006-12-12 07:17:53 +01:00
|
|
|
array(
|
|
|
|
'URL' => make_index_url(array('section' => 'recent_cats')),
|
2008-01-30 23:07:07 +01:00
|
|
|
'TITLE' => l10n('recent_cats_cat_hint'),
|
|
|
|
'NAME' => l10n('recent_cats_cat'),
|
2006-12-12 07:17:53 +01:00
|
|
|
));
|
2006-06-22 21:21:56 +02:00
|
|
|
|
|
|
|
// calendar
|
2008-03-01 14:12:07 +01:00
|
|
|
$template->append(
|
|
|
|
'special_categories',
|
2006-06-22 21:21:56 +02:00
|
|
|
array(
|
|
|
|
'URL' =>
|
2006-07-26 23:00:16 +02:00
|
|
|
make_index_url(
|
2006-06-22 21:21:56 +02:00
|
|
|
array(
|
|
|
|
'chronology_field' => ($conf['calendar_datefield']=='date_available'
|
|
|
|
? 'posted' : 'created'),
|
|
|
|
'chronology_style'=> 'monthly',
|
|
|
|
'chronology_view' => 'calendar'
|
|
|
|
)
|
|
|
|
),
|
2008-01-30 23:07:07 +01:00
|
|
|
'TITLE' => l10n('calendar_hint'),
|
|
|
|
'NAME' => l10n('calendar'),
|
2007-01-09 02:30:02 +01:00
|
|
|
'REL'=> 'rel="nofollow"'
|
2006-06-22 21:21:56 +02:00
|
|
|
)
|
|
|
|
);
|
|
|
|
//--------------------------------------------------------------------- summary
|
|
|
|
|
2007-06-06 00:01:15 +02:00
|
|
|
if (is_a_guest())
|
2006-06-22 21:21:56 +02:00
|
|
|
{
|
2008-03-01 14:12:07 +01:00
|
|
|
$template->assign(
|
|
|
|
array(
|
|
|
|
'U_IDENTIFY' => get_root_url().'identification.php',
|
|
|
|
'AUTHORIZE_REMEMBERING' => $conf['authorize_remembering']
|
|
|
|
)
|
|
|
|
);
|
2006-06-22 21:21:56 +02:00
|
|
|
|
2006-12-13 02:05:38 +01:00
|
|
|
if ($conf['allow_user_registration'])
|
|
|
|
{
|
2008-03-01 14:12:07 +01:00
|
|
|
$template->assign( 'U_REGISTER', get_root_url().'register.php');
|
2006-12-13 02:05:38 +01:00
|
|
|
}
|
2006-06-22 21:21:56 +02:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2008-03-01 14:12:07 +01:00
|
|
|
$template->assign('USERNAME', $user['username']);
|
2006-06-22 21:21:56 +02:00
|
|
|
|
|
|
|
if (is_autorize_status(ACCESS_CLASSIC))
|
|
|
|
{
|
2008-03-01 14:12:07 +01:00
|
|
|
$template->assign('U_PROFILE', get_root_url().'profile.php');
|
2006-06-22 21:21:56 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
// the logout link has no meaning with Apache authentication : it is not
|
|
|
|
// possible to logout with this kind of authentication.
|
|
|
|
if (!$conf['apache_authentication'])
|
|
|
|
{
|
2008-03-01 14:12:07 +01:00
|
|
|
$template->assign('U_LOGOUT', get_root_url().'?act=logout');
|
2006-06-22 21:21:56 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
if (is_admin())
|
|
|
|
{
|
2008-03-01 14:12:07 +01:00
|
|
|
$template->assign('U_ADMIN', get_root_url().'admin.php');
|
2006-06-22 21:21:56 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// tags link
|
2008-03-01 14:12:07 +01:00
|
|
|
$template->append(
|
|
|
|
'summaries',
|
2006-06-22 21:21:56 +02:00
|
|
|
array(
|
|
|
|
'TITLE' => l10n('See available tags'),
|
|
|
|
'NAME' => l10n('Tags'),
|
|
|
|
'U_SUMMARY'=> get_root_url().'tags.php',
|
|
|
|
)
|
|
|
|
);
|
|
|
|
|
|
|
|
// search link
|
2008-03-01 14:12:07 +01:00
|
|
|
$template->append(
|
|
|
|
'summaries',
|
2006-06-22 21:21:56 +02:00
|
|
|
array(
|
2008-01-30 23:07:07 +01:00
|
|
|
'TITLE'=>l10n('hint_search'),
|
|
|
|
'NAME'=>l10n('search'),
|
2006-06-22 21:21:56 +02:00
|
|
|
'U_SUMMARY'=> get_root_url().'search.php',
|
|
|
|
'REL'=> 'rel="search"'
|
|
|
|
)
|
|
|
|
);
|
|
|
|
|
|
|
|
// comments link
|
2008-03-01 14:12:07 +01:00
|
|
|
$template->append(
|
|
|
|
'summaries',
|
2006-06-22 21:21:56 +02:00
|
|
|
array(
|
2008-01-30 23:07:07 +01:00
|
|
|
'TITLE'=>l10n('hint_comments'),
|
|
|
|
'NAME'=>l10n('comments'),
|
2006-06-22 21:21:56 +02:00
|
|
|
'U_SUMMARY'=> get_root_url().'comments.php',
|
|
|
|
)
|
|
|
|
);
|
|
|
|
|
|
|
|
// about link
|
2008-03-01 14:12:07 +01:00
|
|
|
$template->append(
|
|
|
|
'summaries',
|
2006-06-22 21:21:56 +02:00
|
|
|
array(
|
2008-01-30 23:07:07 +01:00
|
|
|
'TITLE' => l10n('about_page_title'),
|
|
|
|
'NAME' => l10n('About'),
|
2006-06-22 21:21:56 +02:00
|
|
|
'U_SUMMARY' => get_root_url().'about.php',
|
|
|
|
)
|
|
|
|
);
|
|
|
|
|
|
|
|
// notification
|
2008-03-01 14:12:07 +01:00
|
|
|
$template->append(
|
|
|
|
'summaries',
|
2006-06-22 21:21:56 +02:00
|
|
|
array(
|
2006-12-06 02:07:03 +01:00
|
|
|
'TITLE'=>l10n('RSS feed'),
|
2006-06-22 21:21:56 +02:00
|
|
|
'NAME'=>l10n('Notification'),
|
|
|
|
'U_SUMMARY'=> get_root_url().'notification.php',
|
|
|
|
'REL'=> 'rel="nofollow"'
|
|
|
|
)
|
|
|
|
);
|
2006-07-06 04:45:26 +02:00
|
|
|
|
2007-02-27 02:56:16 +01:00
|
|
|
if (isset($page['category']) and $page['category']['uploadable'] )
|
2006-07-06 04:45:26 +02:00
|
|
|
{ // upload a picture in the category
|
2007-02-27 02:56:16 +01:00
|
|
|
$url = get_root_url().'upload.php?cat='.$page['category']['id'];
|
2008-03-01 14:12:07 +01:00
|
|
|
$template->assign('U_UPLOAD', $url);
|
2006-07-06 04:45:26 +02:00
|
|
|
}
|
|
|
|
|
2006-11-07 01:55:36 +01:00
|
|
|
trigger_action('loc_end_menubar');
|
2006-06-22 21:21:56 +02:00
|
|
|
$template->assign_var_from_handle('MENUBAR', 'menubar');
|
|
|
|
?>
|