source: branches/1.7/qsearch.php @ 16277

Last change on this file since 16277 was 2094, checked in by rvelices, 17 years ago
  • fix: quick search error if the query term contained " or '
  • optimized sql query in sync_users (called every time on admin page) - a lot faster when #user_cache_categories is big
  • added function Template->delete_block_vars (opposite of assign_block_vars)
  • Property svn:eol-style set to LF
  • Property svn:keywords set to Author Date Id Revision
File size: 2.3 KB
Line 
1<?php
2// +-----------------------------------------------------------------------+
3// | PhpWebGallery - a PHP based picture gallery                           |
4// | Copyright (C) 2003-2007 PhpWebGallery Team - http://phpwebgallery.net |
5// +-----------------------------------------------------------------------+
6// | file          : $Id: qsearch.php 2094 2007-09-19 03:06:16Z rvelices $
7// | last update   : $Date: 2007-09-19 03:06:16 +0000 (Wed, 19 Sep 2007) $
8// | last modifier : $Author: rvelices $
9// | revision      : $Revision: 2094 $
10// +-----------------------------------------------------------------------+
11// | This program is free software; you can redistribute it and/or modify  |
12// | it under the terms of the GNU General Public License as published by  |
13// | the Free Software Foundation                                          |
14// |                                                                       |
15// | This program is distributed in the hope that it will be useful, but   |
16// | WITHOUT ANY WARRANTY; without even the implied warranty of            |
17// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU      |
18// | General Public License for more details.                              |
19// |                                                                       |
20// | You should have received a copy of the GNU General Public License     |
21// | along with this program; if not, write to the Free Software           |
22// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
23// | USA.                                                                  |
24// +-----------------------------------------------------------------------+
25
26define('PHPWG_ROOT_PATH','./');
27include_once( PHPWG_ROOT_PATH.'include/common.inc.php' );
28
29// +-----------------------------------------------------------------------+
30// | Check Access and exit when user status is not ok                      |
31// +-----------------------------------------------------------------------+
32check_status(ACCESS_GUEST);
33
34if (empty($_GET['q']))
35{
36  redirect( make_index_url() );
37}
38
39$search = array();
40$search['q']=$_GET['q'];
41
42$query ='
43INSERT INTO '.SEARCH_TABLE.'
44  (rules, last_seen)
45  VALUES
46  (\''.addslashes(serialize($search)).'\', NOW() )
47;';
48pwg_query($query);
49
50$search_id = mysql_insert_id();
51
52redirect(
53  make_index_url(
54    array(
55      'section' => 'search',
56      'search'  => $search_id,
57      )
58    )
59  );
60?>
Note: See TracBrowser for help on using the repository browser.