2003-05-09 14:42:42 +02:00
|
|
|
<?php
|
2004-02-07 12:50:26 +01:00
|
|
|
// +-----------------------------------------------------------------------+
|
2004-11-06 22:12:59 +01:00
|
|
|
// | PhpWebGallery - a PHP based picture gallery |
|
|
|
|
// | Copyright (C) 2002-2003 Pierrick LE GALL - pierrick@phpwebgallery.net |
|
2006-02-28 02:13:16 +01:00
|
|
|
// | Copyright (C) 2003-2006 PhpWebGallery Team - http://phpwebgallery.net |
|
2004-02-07 12:50:26 +01:00
|
|
|
// +-----------------------------------------------------------------------+
|
2004-11-06 22:12:59 +01:00
|
|
|
// | branch : BSF (Best So Far)
|
2004-02-07 12:50:26 +01:00
|
|
|
// | file : $RCSfile$
|
|
|
|
// | last update : $Date$
|
|
|
|
// | last modifier : $Author$
|
|
|
|
// | revision : $Revision$
|
|
|
|
// +-----------------------------------------------------------------------+
|
|
|
|
// | 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 |
|
2004-02-07 16:31:01 +01:00
|
|
|
// | 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. |
|
2004-02-07 12:50:26 +01:00
|
|
|
// +-----------------------------------------------------------------------+
|
|
|
|
|
2004-02-07 16:31:01 +01:00
|
|
|
//--------------------------------------------------------------------- include
|
2004-02-19 01:31:09 +01:00
|
|
|
define('PHPWG_ROOT_PATH','./');
|
|
|
|
include_once( PHPWG_ROOT_PATH.'include/common.inc.php' );
|
2003-07-27 10:24:10 +02:00
|
|
|
//---------------------------------------------------------------------- logout
|
2004-02-02 01:55:18 +01:00
|
|
|
if ( isset( $_GET['act'] )
|
|
|
|
and $_GET['act'] == 'logout'
|
2006-01-15 14:45:42 +01:00
|
|
|
and isset( $_COOKIE[session_name()] ) )
|
2003-07-27 10:24:10 +02:00
|
|
|
{
|
|
|
|
// cookie deletion if exists
|
2006-01-15 14:45:42 +01:00
|
|
|
$_SESSION = array();
|
|
|
|
session_unset();
|
|
|
|
session_destroy();
|
2006-02-08 02:17:07 +01:00
|
|
|
setcookie(session_name(),'',0, cookie_path() );
|
2003-07-27 10:24:10 +02:00
|
|
|
$url = 'category.php';
|
2004-03-31 22:43:09 +02:00
|
|
|
redirect( $url );
|
2003-07-27 10:24:10 +02:00
|
|
|
}
|
2006-02-12 22:52:16 +01:00
|
|
|
//---------------------------------------------- change of image display order
|
|
|
|
if (isset($_GET['image_order']))
|
2004-11-23 23:31:24 +01:00
|
|
|
{
|
2006-02-12 22:52:16 +01:00
|
|
|
setcookie(
|
|
|
|
'pwg_image_order',
|
|
|
|
$_GET['image_order'] > 0 ? $_GET['image_order'] : '',
|
|
|
|
0
|
|
|
|
);
|
|
|
|
|
|
|
|
redirect(
|
|
|
|
PHPWG_ROOT_PATH
|
|
|
|
.'category.php'
|
|
|
|
.get_query_string_diff(array('image_order'))
|
|
|
|
);
|
2006-02-01 23:56:17 +01:00
|
|
|
}
|
2003-05-09 14:42:42 +02:00
|
|
|
//-------------------------------------------------------------- initialization
|
2004-02-02 01:55:18 +01:00
|
|
|
// detection of the start picture to display
|
|
|
|
if ( !isset( $_GET['start'] )
|
|
|
|
or !is_numeric( $_GET['start'] )
|
|
|
|
or ( is_numeric( $_GET['start'] ) and $_GET['start'] < 0 ) )
|
2004-09-04 10:07:33 +02:00
|
|
|
{
|
2004-02-02 01:55:18 +01:00
|
|
|
$page['start'] = 0;
|
2004-09-04 10:07:33 +02:00
|
|
|
}
|
2004-02-02 01:55:18 +01:00
|
|
|
else
|
2004-09-04 10:07:33 +02:00
|
|
|
{
|
2004-02-02 01:55:18 +01:00
|
|
|
$page['start'] = $_GET['start'];
|
2004-09-04 10:07:33 +02:00
|
|
|
}
|
|
|
|
|
2006-02-12 22:52:16 +01:00
|
|
|
include(PHPWG_ROOT_PATH.'include/section_init.inc.php');
|
|
|
|
|
|
|
|
// access authorization check
|
|
|
|
if (isset($page['cat']) and is_numeric($page['cat']))
|
|
|
|
{
|
|
|
|
check_restrictions($page['cat']);
|
|
|
|
}
|
|
|
|
|
2006-02-20 05:39:37 +01:00
|
|
|
if ( isset($page['cat_nb_images'])
|
2006-02-12 22:52:16 +01:00
|
|
|
and $page['cat_nb_images'] > $user['nb_image_page'])
|
|
|
|
{
|
|
|
|
// $nav_url is used to create the navigation bar
|
2006-02-20 05:39:37 +01:00
|
|
|
$nav_url = PHPWG_ROOT_PATH.'category.php?';
|
|
|
|
if ( isset($page['cat']) )
|
|
|
|
{
|
|
|
|
$nav_url .= 'cat='.$page['cat'].'&';
|
2006-02-12 22:52:16 +01:00
|
|
|
|
2006-02-24 02:16:30 +01:00
|
|
|
switch ($page['cat'])
|
2006-02-12 22:52:16 +01:00
|
|
|
{
|
2006-02-24 02:16:30 +01:00
|
|
|
case 'search':
|
|
|
|
{
|
|
|
|
$nav_url.= 'search='.$_GET['search'].'&';
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
case 'list':
|
|
|
|
{
|
|
|
|
$nav_url.= 'list='.$_GET['list'].'&';
|
|
|
|
break;
|
|
|
|
}
|
2006-02-12 22:52:16 +01:00
|
|
|
}
|
|
|
|
}
|
2006-02-24 02:16:30 +01:00
|
|
|
|
2006-02-20 05:39:37 +01:00
|
|
|
if ( isset($_GET['calendar']) )
|
|
|
|
{
|
|
|
|
$nav_url.= 'calendar='.$_GET['calendar'];
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
$nav_url = preg_replace('/&$/', '', $nav_url);
|
|
|
|
}
|
2006-02-12 22:52:16 +01:00
|
|
|
|
|
|
|
$page['navigation_bar'] = create_navigation_bar(
|
|
|
|
$nav_url,
|
|
|
|
$page['cat_nb_images'],
|
|
|
|
$page['start'],
|
|
|
|
$user['nb_image_page'],
|
|
|
|
'back'
|
|
|
|
);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
$page['navigation_bar'] = '';
|
|
|
|
}
|
2004-02-02 01:55:18 +01:00
|
|
|
|
2005-03-25 23:10:55 +01:00
|
|
|
// caddie filling :-)
|
|
|
|
if (isset($_GET['caddie']))
|
|
|
|
{
|
2006-02-12 22:52:16 +01:00
|
|
|
fill_caddie($page['items']);
|
2005-03-25 23:10:55 +01:00
|
|
|
}
|
|
|
|
|
2003-05-09 14:42:42 +02:00
|
|
|
//----------------------------------------------------- template initialization
|
2004-02-02 01:55:18 +01:00
|
|
|
//
|
|
|
|
// Start output of page
|
|
|
|
//
|
|
|
|
$title = $page['title'];
|
- new : HTML BODY identifier to let CSS stylesheets manage specific
behaviour.
- deletion : admin/search useless
- improvement : in admin/user_list, special behaviour for true/false fields
(expand, show_comments)
- new : gallery_title and gallery_description are displayed at the top of
each page.
- improvement : simplification in HTML for categories menu.
- improvement : standardization of presentation in all public pages
(identification, registration, search, profile, notification, comments,
etc.)
(not in ChangeLog, below this line)
- add forgotten notification.php (should have been added in a previous
commit)
- [template cclear] deletion of useless class .bouton
- [template cclear] for test purpose, new presentation of register page
(using FORM.filter)
- [template cclear] adaptation of admin/group_list from template default
- [template cclear] deletion of obsolete admin/infos_images
- [template cclear] deletion of obsolete admin/search_username
- [template cclear] new icon register.png
git-svn-id: http://piwigo.org/svn/trunk@850 68402e56-0260-453c-a942-63ccdbb3a9ee
2005-08-26 00:43:47 +02:00
|
|
|
$page['body_id'] = 'theCategoryPage';
|
2004-02-22 03:43:13 +01:00
|
|
|
include(PHPWG_ROOT_PATH.'include/page_header.php');
|
2004-02-02 01:55:18 +01:00
|
|
|
|
2004-02-07 12:50:26 +01:00
|
|
|
$template->set_filenames( array('category'=>'category.tpl') );
|
|
|
|
//-------------------------------------------------------------- category title
|
2004-12-28 20:33:52 +01:00
|
|
|
if (isset($page['cat']) and is_numeric($page['cat']))
|
2004-12-25 20:33:36 +01:00
|
|
|
{
|
|
|
|
$template_title = get_cat_display_name($page['cat_name'],
|
|
|
|
'category.php?cat=',
|
|
|
|
false);
|
|
|
|
}
|
2004-12-28 20:33:52 +01:00
|
|
|
else
|
|
|
|
{
|
|
|
|
$template_title = $page['title'];
|
|
|
|
}
|
2004-12-25 20:33:36 +01:00
|
|
|
|
2004-06-15 22:00:40 +02:00
|
|
|
if ( isset( $page['cat_nb_images'] ) and $page['cat_nb_images'] > 0 )
|
|
|
|
{
|
|
|
|
$template_title.= ' ['.$page['cat_nb_images'].']';
|
2004-02-07 12:50:26 +01:00
|
|
|
}
|
|
|
|
|
2004-07-09 23:00:00 +02:00
|
|
|
$icon_recent = get_icon(date('Y-m-d'));
|
2004-06-19 01:23:29 +02:00
|
|
|
|
2006-02-20 05:39:37 +01:00
|
|
|
$calendar_view_link = PHPWG_ROOT_PATH.'category.php'
|
|
|
|
.get_query_string_diff(array('start','calendar'));
|
|
|
|
if ( ! isset($_GET['calendar']) )
|
|
|
|
{
|
|
|
|
$calendar_view_link .= (empty($_GET)? '?':'&' ) . 'calendar=';
|
2006-02-22 02:00:39 +01:00
|
|
|
$template->assign_block_vars(
|
|
|
|
'calendar_view',
|
|
|
|
array( 'URL' => $calendar_view_link )
|
|
|
|
);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
$template->assign_block_vars(
|
|
|
|
'normal_view',
|
|
|
|
array( 'URL' => $calendar_view_link )
|
|
|
|
);
|
2006-02-20 05:39:37 +01:00
|
|
|
}
|
|
|
|
|
- new : HTML BODY identifier to let CSS stylesheets manage specific
behaviour.
- deletion : admin/search useless
- improvement : in admin/user_list, special behaviour for true/false fields
(expand, show_comments)
- new : gallery_title and gallery_description are displayed at the top of
each page.
- improvement : simplification in HTML for categories menu.
- improvement : standardization of presentation in all public pages
(identification, registration, search, profile, notification, comments,
etc.)
(not in ChangeLog, below this line)
- add forgotten notification.php (should have been added in a previous
commit)
- [template cclear] deletion of useless class .bouton
- [template cclear] for test purpose, new presentation of register page
(using FORM.filter)
- [template cclear] adaptation of admin/group_list from template default
- [template cclear] deletion of obsolete admin/infos_images
- [template cclear] deletion of obsolete admin/search_username
- [template cclear] new icon register.png
git-svn-id: http://piwigo.org/svn/trunk@850 68402e56-0260-453c-a942-63ccdbb3a9ee
2005-08-26 00:43:47 +02:00
|
|
|
$template->assign_vars(
|
|
|
|
array(
|
2004-02-07 12:50:26 +01:00
|
|
|
'NB_PICTURE' => count_user_total_images(),
|
2004-06-15 22:00:40 +02:00
|
|
|
'TITLE' => $template_title,
|
2004-02-07 12:50:26 +01:00
|
|
|
'USERNAME' => $user['username'],
|
2004-08-31 00:00:46 +02:00
|
|
|
'TOP_NUMBER'=>$conf['top_number'],
|
2004-11-23 23:31:24 +01:00
|
|
|
'MENU_CATEGORIES_CONTENT'=>get_categories_menu(),
|
2004-02-07 12:50:26 +01:00
|
|
|
|
|
|
|
'L_CATEGORIES' => $lang['categories'],
|
|
|
|
'L_HINT_CATEGORY' => $lang['hint_category'],
|
|
|
|
'L_SUBCAT' => $lang['sub-cat'],
|
|
|
|
'L_IMG_AVAILABLE' => $lang['images_available'],
|
|
|
|
'L_TOTAL' => $lang['total'],
|
2004-06-15 22:00:40 +02:00
|
|
|
'L_SPECIAL_CATEGORIES' => $lang['special_categories'],
|
2004-02-07 12:50:26 +01:00
|
|
|
'L_SUMMARY' => $lang['title_menu'],
|
|
|
|
'L_UPLOAD' => $lang['upload_picture'],
|
|
|
|
'L_COMMENT' => $lang['comments'],
|
2005-01-06 17:33:04 +01:00
|
|
|
'L_IDENTIFY' => $lang['identification'],
|
2004-02-26 19:33:45 +01:00
|
|
|
'L_PASSWORD' => $lang['password'],
|
|
|
|
'L_HELLO' => $lang['hello'],
|
2004-12-23 13:30:03 +01:00
|
|
|
'L_REGISTER' => $lang['ident_register'],
|
2004-02-26 19:33:45 +01:00
|
|
|
'L_LOGOUT' => $lang['logout'],
|
|
|
|
'L_ADMIN' => $lang['admin'],
|
|
|
|
'L_ADMIN_HINT' => $lang['hint_admin'],
|
|
|
|
'L_PROFILE' => $lang['customize'],
|
|
|
|
'L_PROFILE_HINT' => $lang['hint_customize'],
|
2004-10-03 01:12:50 +02:00
|
|
|
'L_REMEMBER_ME' => $lang['remember_me'],
|
2004-02-26 19:33:45 +01:00
|
|
|
|
2006-01-15 14:45:42 +01:00
|
|
|
'F_IDENTIFY' => PHPWG_ROOT_PATH.'identification.php',
|
2004-07-09 23:00:00 +02:00
|
|
|
'T_RECENT' => $icon_recent,
|
2004-02-07 12:50:26 +01:00
|
|
|
|
2006-01-15 14:45:42 +01:00
|
|
|
'U_HOME' => PHPWG_ROOT_PATH.'category.php',
|
|
|
|
'U_REGISTER' => PHPWG_ROOT_PATH.'register.php',
|
|
|
|
'U_LOST_PASSWORD' => PHPWG_ROOT_PATH.'password.php',
|
2004-03-20 01:52:37 +01:00
|
|
|
'U_LOGOUT' => PHPWG_ROOT_PATH.'category.php?act=logout',
|
2006-01-15 14:45:42 +01:00
|
|
|
'U_ADMIN'=> PHPWG_ROOT_PATH.'admin.php',
|
2006-02-20 05:39:37 +01:00
|
|
|
'U_PROFILE'=> PHPWG_ROOT_PATH.'profile.php',
|
2004-02-07 12:50:26 +01:00
|
|
|
)
|
|
|
|
);
|
2006-01-27 23:40:51 +01:00
|
|
|
|
|
|
|
if (isset($page['cat']) and 'search' == $page['cat'])
|
|
|
|
{
|
|
|
|
$template->assign_block_vars(
|
|
|
|
'search_rules',
|
|
|
|
array(
|
|
|
|
'URL' => PHPWG_ROOT_PATH.'/search_rules.php?search_id='.$_GET['search'],
|
|
|
|
)
|
|
|
|
);
|
|
|
|
}
|
2005-06-25 19:09:01 +02:00
|
|
|
//-------------------------------------------------------------- external links
|
|
|
|
if (count($conf['links']) > 0)
|
|
|
|
{
|
|
|
|
$template->assign_block_vars('links', array());
|
|
|
|
|
|
|
|
foreach ($conf['links'] as $url => $label)
|
|
|
|
{
|
|
|
|
$template->assign_block_vars(
|
|
|
|
'links.link',
|
|
|
|
array(
|
|
|
|
'URL' => $url,
|
|
|
|
'LABEL' => $label
|
|
|
|
));
|
|
|
|
}
|
|
|
|
}
|
2004-09-01 23:39:29 +02:00
|
|
|
//---------------------------------------------------------- special categories
|
|
|
|
// favorites categories
|
2003-05-09 14:42:42 +02:00
|
|
|
if ( !$user['is_the_guest'] )
|
|
|
|
{
|
2004-02-19 01:31:09 +01:00
|
|
|
$template->assign_block_vars('username', array());
|
2004-09-01 23:39:29 +02:00
|
|
|
|
|
|
|
$template->assign_block_vars(
|
|
|
|
'special_cat',
|
|
|
|
array(
|
2006-01-15 14:45:42 +01:00
|
|
|
'URL' => PHPWG_ROOT_PATH.'category.php?cat=fav',
|
2004-09-01 23:39:29 +02:00
|
|
|
'TITLE' => $lang['favorite_cat_hint'],
|
|
|
|
'NAME' => $lang['favorite_cat']
|
|
|
|
));
|
2003-05-09 14:42:42 +02:00
|
|
|
}
|
2004-09-01 23:39:29 +02:00
|
|
|
// most visited
|
|
|
|
$template->assign_block_vars(
|
|
|
|
'special_cat',
|
|
|
|
array(
|
2006-01-15 14:45:42 +01:00
|
|
|
'URL' => PHPWG_ROOT_PATH.'category.php?cat=most_visited',
|
2004-09-01 23:39:29 +02:00
|
|
|
'TITLE' => $lang['most_visited_cat_hint'],
|
2005-02-09 22:47:21 +01:00
|
|
|
'NAME' => $lang['most_visited_cat']
|
2004-09-01 23:39:29 +02:00
|
|
|
));
|
|
|
|
// best rated
|
2005-09-19 00:29:17 +02:00
|
|
|
if ($conf['rate'])
|
|
|
|
{
|
|
|
|
$template->assign_block_vars(
|
|
|
|
'special_cat',
|
|
|
|
array(
|
2006-01-15 14:45:42 +01:00
|
|
|
'URL' => PHPWG_ROOT_PATH.'category.php?cat=best_rated',
|
2005-09-19 00:29:17 +02:00
|
|
|
'TITLE' => $lang['best_rated_cat_hint'],
|
|
|
|
'NAME' => $lang['best_rated_cat']
|
|
|
|
)
|
|
|
|
);
|
|
|
|
}
|
2004-09-01 23:39:29 +02:00
|
|
|
// random
|
|
|
|
$template->assign_block_vars(
|
|
|
|
'special_cat',
|
|
|
|
array(
|
2006-01-15 14:45:42 +01:00
|
|
|
'URL' => PHPWG_ROOT_PATH.'random.php',
|
2004-09-01 23:39:29 +02:00
|
|
|
'TITLE' => $lang['random_cat_hint'],
|
|
|
|
'NAME' => $lang['random_cat']
|
|
|
|
));
|
|
|
|
// recent pics
|
|
|
|
$template->assign_block_vars(
|
|
|
|
'special_cat',
|
|
|
|
array(
|
2006-01-15 14:45:42 +01:00
|
|
|
'URL' => PHPWG_ROOT_PATH.'category.php?cat=recent_pics',
|
2004-09-01 23:39:29 +02:00
|
|
|
'TITLE' => $lang['recent_pics_cat_hint'],
|
|
|
|
'NAME' => $lang['recent_pics_cat']
|
|
|
|
));
|
|
|
|
// recent cats
|
|
|
|
$template->assign_block_vars(
|
|
|
|
'special_cat',
|
|
|
|
array(
|
2006-01-15 14:45:42 +01:00
|
|
|
'URL' => PHPWG_ROOT_PATH.'category.php?cat=recent_cats',
|
2004-09-01 23:39:29 +02:00
|
|
|
'TITLE' => $lang['recent_cats_cat_hint'],
|
|
|
|
'NAME' => $lang['recent_cats_cat']
|
|
|
|
));
|
|
|
|
// calendar
|
|
|
|
$template->assign_block_vars(
|
|
|
|
'special_cat',
|
|
|
|
array(
|
2006-02-24 06:58:48 +01:00
|
|
|
'URL' => PHPWG_ROOT_PATH.'category.php?calendar=monthly-c',
|
2004-09-01 23:39:29 +02:00
|
|
|
'TITLE' => $lang['calendar_hint'],
|
|
|
|
'NAME' => $lang['calendar']
|
|
|
|
));
|
2003-05-09 14:42:42 +02:00
|
|
|
//--------------------------------------------------------------------- summary
|
2004-02-26 19:33:45 +01:00
|
|
|
|
2005-07-17 17:06:39 +02:00
|
|
|
if ($user['is_the_guest'])
|
2003-05-09 14:42:42 +02:00
|
|
|
{
|
2005-07-17 17:06:39 +02:00
|
|
|
$template->assign_block_vars('register', array());
|
|
|
|
$template->assign_block_vars('login', array());
|
|
|
|
|
|
|
|
$template->assign_block_vars('quickconnect', array());
|
|
|
|
if ($conf['authorize_remembering'])
|
2004-02-26 19:33:45 +01:00
|
|
|
{
|
2005-07-17 17:06:39 +02:00
|
|
|
$template->assign_block_vars('quickconnect.remember_me', array());
|
2004-02-26 19:33:45 +01:00
|
|
|
}
|
2003-05-09 14:42:42 +02:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2005-07-17 17:06:39 +02:00
|
|
|
$template->assign_block_vars('hello', array());
|
|
|
|
$template->assign_block_vars('profile', array());
|
|
|
|
|
|
|
|
// the logout link has no meaning with Apache authentication : it is not
|
|
|
|
// possible to logout with this kind of authentication.
|
|
|
|
if (!$conf['apache_authentication'])
|
|
|
|
{
|
|
|
|
$template->assign_block_vars('logout', array());
|
|
|
|
}
|
|
|
|
|
|
|
|
if ('admin' == $user['status'])
|
2004-10-07 00:48:48 +02:00
|
|
|
{
|
2005-07-17 17:06:39 +02:00
|
|
|
$template->assign_block_vars('admin', array());
|
2004-10-07 00:48:48 +02:00
|
|
|
}
|
2003-05-09 14:42:42 +02:00
|
|
|
}
|
2004-02-07 12:50:26 +01:00
|
|
|
|
2003-05-09 14:42:42 +02:00
|
|
|
// search link
|
2004-02-07 12:50:26 +01:00
|
|
|
$template->assign_block_vars('summary', array(
|
|
|
|
'TITLE'=>$lang['hint_search'],
|
|
|
|
'NAME'=>$lang['search'],
|
2006-01-15 14:45:42 +01:00
|
|
|
'U_SUMMARY'=> 'search.php',
|
2006-02-10 03:10:41 +01:00
|
|
|
'REL'=> 'rel="search"'
|
2004-02-07 12:50:26 +01:00
|
|
|
));
|
|
|
|
|
2003-10-04 18:08:53 +02:00
|
|
|
// comments link
|
2004-02-07 12:50:26 +01:00
|
|
|
$template->assign_block_vars('summary', array(
|
|
|
|
'TITLE'=>$lang['hint_comments'],
|
|
|
|
'NAME'=>$lang['comments'],
|
2006-01-15 14:45:42 +01:00
|
|
|
'U_SUMMARY'=> 'comments.php',
|
2004-02-07 12:50:26 +01:00
|
|
|
));
|
|
|
|
|
2003-05-09 14:42:42 +02:00
|
|
|
// about link
|
2004-02-07 12:50:26 +01:00
|
|
|
$template->assign_block_vars('summary', array(
|
2005-10-15 23:47:19 +02:00
|
|
|
'TITLE'=>$lang['about_page_title'],
|
|
|
|
'NAME'=>$lang['About'],
|
2006-01-15 14:45:42 +01:00
|
|
|
'U_SUMMARY'=> 'about.php?'.str_replace( '&', '&', $_SERVER['QUERY_STRING'] )
|
2004-02-07 12:50:26 +01:00
|
|
|
));
|
|
|
|
|
2005-08-19 15:54:40 +02:00
|
|
|
// notification
|
2005-07-16 16:29:35 +02:00
|
|
|
$template->assign_block_vars(
|
|
|
|
'summary',
|
|
|
|
array(
|
2005-08-19 15:54:40 +02:00
|
|
|
'TITLE'=>l10n('notification'),
|
|
|
|
'NAME'=>l10n('Notification'),
|
2006-02-10 03:10:41 +01:00
|
|
|
'U_SUMMARY'=> PHPWG_ROOT_PATH.'notification.php',
|
|
|
|
'REL'=> 'rel="nofollow"'
|
2005-07-16 16:29:35 +02:00
|
|
|
));
|
|
|
|
|
2005-08-19 19:00:20 +02:00
|
|
|
if (isset($page['cat'])
|
|
|
|
and is_numeric($page['cat'])
|
|
|
|
and 'admin' == $user['status'])
|
|
|
|
{
|
|
|
|
$template->assign_block_vars(
|
|
|
|
'edit',
|
|
|
|
array(
|
|
|
|
'URL' =>
|
|
|
|
PHPWG_ROOT_PATH.'admin.php?page=cat_modify'
|
|
|
|
.'&cat_id='.$page['cat']
|
|
|
|
)
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
2004-06-25 22:29:51 +02:00
|
|
|
//------------------------------------------------------ main part : thumbnails
|
2006-02-20 05:39:37 +01:00
|
|
|
if ( isset($page['thumbnails_include']) )
|
|
|
|
{
|
|
|
|
include(PHPWG_ROOT_PATH.$page['thumbnails_include']);
|
|
|
|
}
|
2003-05-09 14:42:42 +02:00
|
|
|
//------------------------------------------------------- category informations
|
2006-02-20 05:39:37 +01:00
|
|
|
if ( $page['navigation_bar'] != ''
|
|
|
|
or ( isset( $page['comment'] ) and $page['comment'] != '' ) )
|
|
|
|
{
|
|
|
|
$template->assign_block_vars('cat_infos',array());
|
|
|
|
}
|
|
|
|
// navigation bar
|
|
|
|
if ( $page['navigation_bar'] != '' )
|
|
|
|
{
|
|
|
|
$template->assign_block_vars(
|
|
|
|
'cat_infos.navigation',
|
|
|
|
array('NAV_BAR' => $page['navigation_bar'])
|
|
|
|
);
|
|
|
|
}
|
2006-02-23 03:30:19 +01:00
|
|
|
|
2006-02-24 02:16:30 +01:00
|
|
|
if ( ( isset($page['cat_nb_images']) and $page['cat_nb_images']>0 )
|
|
|
|
and
|
2006-02-23 03:30:19 +01:00
|
|
|
( !isset($page['cat'])
|
|
|
|
or ($page['cat'] != 'most_visited' and $page['cat'] != 'best_rated') )
|
|
|
|
)
|
|
|
|
{
|
|
|
|
// image order
|
|
|
|
$template->assign_block_vars( 'preferred_image_order', array() );
|
|
|
|
|
|
|
|
$order_idx = isset($_COOKIE['pwg_image_order']) ?
|
|
|
|
$_COOKIE['pwg_image_order'] : 0;
|
|
|
|
|
|
|
|
$orders = get_category_preferred_image_orders();
|
|
|
|
for ( $i = 0; $i < count($orders); $i++)
|
|
|
|
{
|
|
|
|
if ($orders[$i][2])
|
|
|
|
{
|
|
|
|
$url = PHPWG_ROOT_PATH.'category.php'
|
|
|
|
.get_query_string_diff(array('image_order'));
|
|
|
|
$url .= '&image_order='.$i;
|
|
|
|
$template->assign_block_vars( 'preferred_image_order.order', array(
|
|
|
|
'DISPLAY' => $orders[$i][0],
|
|
|
|
'URL' => $url,
|
|
|
|
'SELECTED_OPTION' => ($order_idx==$i ? 'SELECTED' : '' ),
|
|
|
|
) );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2003-05-09 14:42:42 +02:00
|
|
|
if ( isset ( $page['cat'] ) )
|
|
|
|
{
|
2004-03-26 18:08:09 +01:00
|
|
|
// upload a picture in the category
|
2004-11-13 14:43:53 +01:00
|
|
|
if (is_numeric($page['cat'])
|
2006-02-28 02:13:16 +01:00
|
|
|
// and $page['cat_site_id'] == 1
|
2004-11-13 14:43:53 +01:00
|
|
|
and $page['cat_dir'] != ''
|
|
|
|
and $page['cat_uploadable'])
|
2003-05-09 14:42:42 +02:00
|
|
|
{
|
2004-03-26 18:08:09 +01:00
|
|
|
$url = PHPWG_ROOT_PATH.'upload.php?cat='.$page['cat'];
|
2004-06-15 22:00:40 +02:00
|
|
|
$template->assign_block_vars(
|
|
|
|
'upload',
|
2006-01-15 14:45:42 +01:00
|
|
|
array('U_UPLOAD'=> $url )
|
2004-06-15 22:00:40 +02:00
|
|
|
);
|
2003-05-09 14:42:42 +02:00
|
|
|
}
|
2004-02-07 12:50:26 +01:00
|
|
|
// category comment
|
|
|
|
if ( isset( $page['comment'] ) and $page['comment'] != '' )
|
|
|
|
{
|
2004-06-15 22:00:40 +02:00
|
|
|
$template->assign_block_vars(
|
|
|
|
'cat_infos.comment',
|
|
|
|
array('COMMENTS' => $page['comment'])
|
|
|
|
);
|
2003-05-09 14:42:42 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
//------------------------------------------------------------ log informations
|
|
|
|
pwg_log( 'category', $page['title'] );
|
2004-02-02 01:55:18 +01:00
|
|
|
|
2005-01-13 11:18:49 +01:00
|
|
|
$template->parse('category');
|
2004-02-22 03:43:13 +01:00
|
|
|
include(PHPWG_ROOT_PATH.'include/page_tail.php');
|
2004-02-12 00:20:38 +01:00
|
|
|
?>
|