source: trunk/category.php @ 1846

Revision 1846, 2.4 KB checked in by rvelices, 13 years ago (diff)
  • added check in redirect to see if headers have been sent before doing a redirect_http
  • old category.php uses redirect_http whenever possible
  • replaced some old {L_xxx} in picture.tpl
  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
Line 
1<?php
2// +-----------------------------------------------------------------------+
3// | PhpWebGallery - a PHP based picture gallery                           |
4// | Copyright (C) 2003-2006 PhpWebGallery Team - http://phpwebgallery.net |
5// +-----------------------------------------------------------------------+
6// | branch        : BSF (Best So Far)
7// | file          : $Id$
8// | last update   : $Date$
9// | last modifier : $Author$
10// | revision      : $Revision$
11// +-----------------------------------------------------------------------+
12// | This program is free software; you can redistribute it and/or modify  |
13// | it under the terms of the GNU General Public License as published by  |
14// | the Free Software Foundation                                          |
15// |                                                                       |
16// | This program is distributed in the hope that it will be useful, but   |
17// | WITHOUT ANY WARRANTY; without even the implied warranty of            |
18// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU      |
19// | General Public License for more details.                              |
20// |                                                                       |
21// | You should have received a copy of the GNU General Public License     |
22// | along with this program; if not, write to the Free Software           |
23// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
24// | USA.                                                                  |
25// +-----------------------------------------------------------------------+
26
27/*
28This file contains now only code to ensure backward url compatibility with
29versions before 1.6
30*/
31
32define('PHPWG_ROOT_PATH','./');
33include_once( PHPWG_ROOT_PATH.'include/common.inc.php' );
34
35$url_params=array();
36if ( isset($_GET['cat']) )
37{
38  if ( is_numeric($_GET['cat']) )
39  {
40    $url_params['section'] = 'categories';
41    $url_params['category'] = $_GET['cat'];
42    $result = get_cat_info($url_params['category']);
43    if ( !empty($result) )
44      $url_params['cat_name'] = $result['name'];
45  }
46  elseif ( in_array($_GET['cat'],
47              array('best_rated','most_visited','recent_pics','recent_cats')
48                  )
49         )
50  {
51    $url_params['section'] = $_GET['cat'];
52  }
53  else
54  {
55    page_not_found('');
56  }
57}
58
59$url = make_index_url($url_params);
60if (!headers_sent())
61{
62  set_status_header(302);
63  redirect_http( $url );
64}
65redirect ( $url );
66
67?>
Note: See TracBrowser for help on using the repository browser.