aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorz0rglub <z0rglub@piwigo.org>2003-05-27 20:56:13 +0000
committerz0rglub <z0rglub@piwigo.org>2003-05-27 20:56:13 +0000
commit0b6204e5fbebb7dc14bfe47e598f53d241c21b97 (patch)
tree4e457a986c6b177b6c0202b8571f9eda93afa88e /include
parent4ac5b8f83f3b27b508be0cdf907eb8b083c251e5 (diff)
*** empty log message ***
git-svn-id: http://piwigo.org/svn/trunk@19 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to 'include')
-rw-r--r--include/config.inc.php28
-rw-r--r--include/functions_category.inc.php7
2 files changed, 17 insertions, 18 deletions
diff --git a/include/config.inc.php b/include/config.inc.php
index 25566bd79..aabbd5ac0 100644
--- a/include/config.inc.php
+++ b/include/config.inc.php
@@ -53,7 +53,7 @@ database_connection();
// Each field becomes an information of the array $conf.
// Example :
// prefixe_thumbnail --> $conf['prefixe_thumbnail']
-$infos = array( 'prefixe_thumbnail', 'webmaster', 'mail_webmaster', 'acces',
+$infos = array( 'prefix_thumbnail', 'webmaster', 'mail_webmaster', 'access',
'session_id_size', 'session_keyword', 'session_time',
'max_user_listbox', 'show_comments', 'nb_comment_page',
'upload_available', 'upload_maxfilesize', 'upload_maxwidth',
@@ -61,32 +61,24 @@ $infos = array( 'prefixe_thumbnail', 'webmaster', 'mail_webmaster', 'acces',
'upload_maxheight_thumbnail' );
$query = 'SELECT';
-for ( $i = 0; $i < sizeof( $infos ); $i++ )
-{
- if ( $i > 0 )
- {
- $query.= ',';
- }
- else
- {
- $query.= ' ';
- }
- $query.= $infos[$i];
+foreach ( $infos as $i => $info ) {
+ if ( $i > 0 ) $query.= ',';
+ else $query.= ' ';
+ $query.= $info;
}
-$query .= ' FROM '.PREFIX_TABLE.'config;';
+$query.= ' FROM '.PREFIX_TABLE.'config;';
$row = mysql_fetch_array( mysql_query( $query ) );
// affectation of each field of the table "config" to an information of the
// array $conf.
-for ( $i = 0; $i < sizeof( $infos ); $i++ )
-{
- $conf[$infos[$i]] = $row[$infos[$i]];
+foreach ( $infos as $info ) {
+ $conf[$info] = $row[$info];
// If the field is true or false, the variable is transformed into a boolean
// value.
- if ( $row[$infos[$i]] == 'true' || $row[$infos[$i]] == 'false' )
+ if ( $row[$info] == 'true' or $row[$info] == 'false' )
{
- $conf[$infos[$i]] = get_boolean( $row[$infos[$i]] );
+ $conf[$info] = get_boolean( $row[$info] );
}
}
$conf['log'] = false;
diff --git a/include/functions_category.inc.php b/include/functions_category.inc.php
index aa4e277dc..21de2ad71 100644
--- a/include/functions_category.inc.php
+++ b/include/functions_category.inc.php
@@ -405,6 +405,10 @@ function initialize_category( $calling_page = 'category' )
$words = explode( ',', $_GET['search'] );
$sql_search = array();
foreach ( $words as $i => $word ) {
+ // if the user searchs any of the words, the where statement must
+ // be :
+ // field1 LIKE '%$word1%' OR field2 LIKE '%$word1%' ...
+ // OR field1 LIKE '%$word2%' OR field2 LIKE '%$word2%' ...
if ( $_GET['mode'] == 'OR' )
{
if ( $i != 0 ) $page['where'].= ' OR';
@@ -413,6 +417,9 @@ function initialize_category( $calling_page = 'category' )
$page['where'].= ' '.$field." LIKE '%".$word."%'";
}
}
+ // if the user searchs all the words :
+ // ( field1 LIKE '%$word1%' OR field2 LIKE '%$word1%' )
+ // AND ( field1 LIKE '%$word2%' OR field2 LIKE '%$word2%' )
else if ( $_GET['mode'] == 'AND' )
{
if ( $i != 0 ) $page['where'].= ' AND';