http://mods.db9.dk/viewforum.php?f=66
oder
http://www.phpbbhacks.com/download/2204
Zuerst mal eine Grundsatzfrage:
In der search.php steht:
Code: Alles auswählen
if ( isset($HTTP_POST_VARS['search_fields']) )
{
$search_fields = ( $HTTP_POST_VARS['search_fields'] == 'all' ) ? 1 : 0;
}
else
{
$search_fields = 0;
}
Weiters:
Warum heisst die Zeile:
Code: Alles auswählen
$search_msg_only = ( !$search_fields ) ? "AND m.title_match = 0" : ( ( strstr($multibyte_charset, $lang['ENCODING']) ) ? '' : '' );
Code: Alles auswählen
$search_msg_only = ( !$search_fields ) ? "AND m.title_match = 0" : '' );
Meiner Meinung nach sind die Änderungen in der search.php falsch/nicht mehr aktuell: (habs nicht auf einem 2.0.6 getestet

Code: Alles auswählen
#
#-----[ OPEN ]------------------------------------------
#
search.php
#
#-----[ FIND ]------------------------------------------
#
$search_msg_only = ( !$search_fields ) ? "AND m.title_match = 0" : ( ( strstr($multibyte_charset, $lang['ENCODING']) ) ? '' : '' );
#
#-----[ REPLACE WITH ]------------------------------------------
#
$search_fields = ( $HTTP_POST_VARS['search_fields'] == 'all' ) ? 1 : ( ( $HTTP_POST_VARS['search_fields'] == 'subjonly' ) ? 2 : 0);
#
#-----[ FIND ]------------------------------------------
#
$search_msg_only = ( !$search_fields ) ? "AND m.title_match = 0" : "";
#
#-----[ REPLACE WITH ]------------------------------------------
#
switch ($search_fields)
{
case 0: $search_msg_only = "AND m.title_match = 0";
break;
case 1: $search_msg_only = "";
break;
case 2: $search_msg_only = "AND m.title_match > 0";
break;
default:
$search_msg_only = "AND m.title_match = 0";
}
Ich denke das muss so aussehen:
Code: Alles auswählen
#
#-----[ OPEN ]------------------------------------------
#
search.php
#
#-----[ FIND ]------------------------------------------
#
$search_fields = ( $HTTP_POST_VARS['search_fields'] == 'all' ) ? 1 : 0;
#
#-----[ REPLACE WITH ]------------------------------------------
#
$search_fields = ( $HTTP_POST_VARS['search_fields'] == 'all' ) ? 1 : ( ( $HTTP_POST_VARS['search_fields'] == 'subjonly' ) ? 2 : 0);
#
#-----[ FIND ]------------------------------------------
#
$search_msg_only = ( !$search_fields ) ? "AND m.title_match = 0" : ( ( strstr($multibyte_charset, $lang['ENCODING']) ) ? '' : '' );
#
#-----[ REPLACE WITH ]------------------------------------------
#
switch ($search_fields)
{
case 0: $search_msg_only = "AND m.title_match = 0";
break;
case 1: $search_msg_only = "";
break;
case 2: $search_msg_only = "AND m.title_match > 0";
break;
default:
$search_msg_only = "AND m.title_match = 0";
}
Ich stell mir wieder die Frage warum 0 default ist und nicht 1...
Ab viel wichtiger:
Was mach ich mit diesen Zeilen?
Code: Alles auswählen
$search_msg_only = ( $search_fields ) ? "OR post_subject LIKE '$match_word'" : '';
$sql = "SELECT post_id
FROM " . POSTS_TEXT_TABLE . "
WHERE post_text LIKE '$match_word'
$search_msg_only";
Code: Alles auswählen
switch ($search_fields)
{
case 0: $search_msg_only = "post_text LIKE '$match_word'";
break;
case 1: $search_msg_only = "post_text LIKE '$match_word' OR post_subject LIKE '$match_word'";
break;
case 2: $search_msg_only = "post_subject LIKE '$match_word'";
break;
default:
$search_msg_only = "post_text LIKE '$match_word' OR post_subject LIKE '$match_word'";
}
$sql = "SELECT post_id
FROM " . POSTS_TEXT_TABLE . "
WHERE $search_msg_only";
Der komplette Teil mit Änderungen an der search.php wär also:
Code: Alles auswählen
#
#-----[ OPEN ]------------------------------------------
#
search.php
#
#-----[ FIND ]------------------------------------------
#
$search_fields = ( $HTTP_POST_VARS['search_fields'] == 'all' ) ? 1 : 0;
#
#-----[ REPLACE WITH ]------------------------------------------
#
$search_fields = ( $HTTP_POST_VARS['search_fields'] == 'all' ) ? 1 : ( ( $HTTP_POST_VARS['search_fields'] == 'subjonly' ) ? 2 : 0);
#
#-----[ FIND ]------------------------------------------
#
$search_msg_only = ( !$search_fields ) ? "AND m.title_match = 0" : ( ( strstr($multibyte_charset, $lang['ENCODING']) ) ? '' : '' );
#
#-----[ REPLACE WITH ]------------------------------------------
#
switch ($search_fields)
{
case 0: $search_msg_only = "AND m.title_match = 0";
break;
case 1: $search_msg_only = "";
break;
case 2: $search_msg_only = "AND m.title_match > 0";
break;
default:
$search_msg_only = "AND m.title_match = 0";
}
#
#-----[ FIND ]------------------------------------------
#
$search_msg_only = ( $search_fields ) ? "OR post_subject LIKE '$match_word'" : '';
$sql = "SELECT post_id
FROM " . POSTS_TEXT_TABLE . "
WHERE post_text LIKE '$match_word'
$search_msg_only";
#
#-----[ REPLACE WITH ]------------------------------------------
#
switch ($search_fields)
{
case 0: $search_msg_only = "post_text LIKE '$match_word'";
break;
case 1: $search_msg_only = "post_text LIKE '$match_word' OR post_subject LIKE '$match_word'";
break;
case 2: $search_msg_only = "post_subject LIKE '$match_word'";
break;
default:
$search_msg_only = "post_text LIKE '$match_word' OR post_subject LIKE '$match_word'";
}
$sql = "SELECT post_id
FROM " . POSTS_TEXT_TABLE . "
WHERE $search_msg_only";
Könnte ich soetwas auch validieren lassen als MOD für die DB?