aboutsummaryrefslogtreecommitdiffstats
path: root/search.php
diff options
context:
space:
mode:
authorgweltas <gweltas@piwigo.org>2004-02-02 00:55:18 +0000
committergweltas <gweltas@piwigo.org>2004-02-02 00:55:18 +0000
commitbef4b3e3aa8e3d54cbf8b4962b9b5d4a89b55429 (patch)
tree647b2cf07ee8451a9314e1e8aebd11d9396cb32b /search.php
parenteea989f019f21fbd7ae4aa8e2f4a1503992c23bf (diff)
Merge of the 1.3.1 release
Creation of an unique include file (common.php) Creation of an unique define file (include/constants.php) Modification of the installation procedure git-svn-id: http://piwigo.org/svn/trunk@345 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to '')
-rw-r--r--search.php21
1 files changed, 14 insertions, 7 deletions
diff --git a/search.php b/search.php
index d12e8203a..9d3cd9180 100644
--- a/search.php
+++ b/search.php
@@ -17,8 +17,9 @@
* *
***************************************************************************/
-//----------------------------------------------------------- personnal include
-include_once( './include/init.inc.php' );
+//----------------------------------------------------------- include
+$phpwg_root_path = './';
+include_once( $phpwg_root_path.'common.php' );
//-------------------------------------------------- access authorization check
check_login_authorization();
//----------------------------------------------------------------- redirection
@@ -53,10 +54,14 @@ if ( isset( $_POST['search'] ) )
}
}
//----------------------------------------------------- template initialization
-$vtp = new VTemplate;
+//
+// Start output of page
+//
+$title= $lang['search_title'];
+include('include/page_header.php');
+
$handle = $vtp->Open( './template/'.$user['template'].'/search.vtp' );
initialize_template();
-
$tpl = array( 'search_title','search_return_main_page','submit',
'search_comments' );
templatize_array( $tpl, 'lang', $handle );
@@ -81,6 +86,7 @@ $vtp->setVar( $handle, 'line.name', $lang['search_field_search'].' *' );
$vtp->addSession( $handle, 'text' );
$vtp->setVar( $handle, 'text.size', '40' );
$vtp->setVar( $handle, 'text.name', 'search' );
+if (isset($_POST['search']))
$vtp->setVar( $handle, 'text.value', $_POST['search'] );
$vtp->closeSession( $handle, 'text' );
$vtp->closeSession( $handle, 'line' );
@@ -92,7 +98,7 @@ $vtp->addSession( $handle, 'radio' );
$vtp->setVar( $handle, 'radio.name', 'mode' );
$vtp->setVar( $handle, 'radio.value', 'OR' );
$vtp->setVar( $handle, 'radio.option', $lang['search_mode_or'] );
-if ( $_POST['mode'] == 'OR' or $_POST['mode'] == '' )
+if (!isset($_POST['mode']) || $_POST['mode'] == 'OR' )
{
$vtp->setVar( $handle, 'radio.checked', ' checked="checked"' );
}
@@ -102,7 +108,7 @@ $vtp->addSession( $handle, 'radio' );
$vtp->setVar( $handle, 'radio.name', 'mode' );
$vtp->setVar( $handle, 'radio.value', 'AND' );
$vtp->setVar( $handle, 'radio.option', $lang['search_mode_and'] );
-if ( $_POST['mode'] == 'AND' )
+if ( isset($_POST['mode']) && $_POST['mode'] == 'AND' )
{
$vtp->setVar( $handle, 'radio.checked', ' checked="checked"' );
}
@@ -116,6 +122,7 @@ $vtp->setGlobalVar( $handle, 'back_url', add_session_id( './category.php' ) );
$code = $vtp->Display( $handle, 0 );
echo $code;
//------------------------------------------------------------ log informations
-pwg_log( 'search', $page['title'] );
+pwg_log( 'search', $title );
mysql_close();
+include('include/page_tail.php');
?> \ No newline at end of file