Quindi il problema potrebbe benissimo stare nelle mods installate.. ecco intanto quanto ricavo dal file search.php, dopo le parole "Look up data.."
Codice:
//
// Look up data ...
//
if ( $search_results != '' )
{
if ( $show_results == 'posts' )
{
$sql = "SELECT pt.post_text, pt.bbcode_uid, pt.post_subject, p.*, f.forum_id, f.forum_name, t.*, u.username, u.user_id, u.user_sig, u.user_sig_bbcode_uid
FROM " . FORUMS_TABLE . " f, " . TOPICS_TABLE . " t, " . USERS_TABLE . " u, " . POSTS_TABLE . " p, " . POSTS_TEXT_TABLE . " pt
WHERE p.post_id IN ($search_results)
AND pt.post_id = p.post_id
AND f.forum_id = p.forum_id
AND p.topic_id = t.topic_id
AND p.poster_id = u.user_id";
}
else
{
$sql = "SELECT t.*, f.forum_id, f.forum_name, u.username, u.user_id, u2.username as user2, u2.user_id as id2, p.post_username, p2.post_username AS post_username2, p2.post_time
FROM " . TOPICS_TABLE . " t, " . FORUMS_TABLE . " f, " . USERS_TABLE . " u, " . POSTS_TABLE . " p, " . POSTS_TABLE . " p2, " . USERS_TABLE . " u2
WHERE t.topic_id IN ($search_results)
AND t.topic_poster = u.user_id
AND f.forum_id = t.forum_id
AND p.post_id = t.topic_first_post_id
AND p2.post_id = t.topic_last_post_id
AND u2.user_id = p2.poster_id";
}
$per_page = ( $show_results == 'posts' ) ? $board_config['posts_per_page'] : $board_config['topics_per_page'];
$sql .= " ORDER BY ";
switch ( $sort_by )
{
case 1:
$sql .= ( $show_results == 'posts' ) ? 'pt.post_subject' : 't.topic_title';
break;
case 2:
$sql .= 't.topic_title';
break;
case 3:
$sql .= 'u.username';
break;
case 4:
$sql .= 'f.forum_id';
break;
default:
$sql .= ( $show_results == 'posts' ) ? 'p.post_time' : 'p2.post_time';
break;
}
$sql .= " $sort_dir LIMIT $start, " . $per_page;
if ( !$result = $db->sql_query($sql) )
{
message_die(GENERAL_ERROR, 'Could not obtain search results', '', __LINE__, __FILE__, $sql);
}
$searchset = array();
while( $row = $db->sql_fetchrow($result) )
{
$searchset[] = $row;
}
$db->sql_freeresult($result);
//
// Define censored word matches
//
$orig_word = array();
$replacement_word = array();
obtain_word_list($orig_word, $replacement_word);
Edit
Ho scaricato una versione "pura" di phpbb2.0.21 dal sito ufficiale, e questa è la query corrispondente su search.php
Codice:
//
// Look up data ...
//
if ( $search_results != '' )
{
if ( $show_results == 'posts' )
{
$sql = "SELECT pt.post_text, pt.bbcode_uid, pt.post_subject, p.*, f.forum_id, f.forum_name, t.*, u.username, u.user_id, u.user_sig, u.user_sig_bbcode_uid
FROM " . FORUMS_TABLE . " f, " . TOPICS_TABLE . " t, " . USERS_TABLE . " u, " . POSTS_TABLE . " p, " . POSTS_TEXT_TABLE . " pt
WHERE p.post_id IN ($search_results)
AND pt.post_id = p.post_id
AND f.forum_id = p.forum_id
AND p.topic_id = t.topic_id
AND p.poster_id = u.user_id";
}
else
{
$sql = "SELECT t.*, f.forum_id, f.forum_name, u.username, u.user_id, u2.username as user2, u2.user_id as id2, p.post_username, p2.post_username AS post_username2, p2.post_time
FROM " . TOPICS_TABLE . " t, " . FORUMS_TABLE . " f, " . USERS_TABLE . " u, " . POSTS_TABLE . " p, " . POSTS_TABLE . " p2, " . USERS_TABLE . " u2
WHERE t.topic_id IN ($search_results)
AND t.topic_poster = u.user_id
AND f.forum_id = t.forum_id
AND p.post_id = t.topic_first_post_id
AND p2.post_id = t.topic_last_post_id
AND u2.user_id = p2.poster_id";
}
$per_page = ( $show_results == 'posts' ) ? $board_config['posts_per_page'] : $board_config['topics_per_page'];
$sql .= " ORDER BY ";
switch ( $sort_by )
{
case 1:
$sql .= ( $show_results == 'posts' ) ? 'pt.post_subject' : 't.topic_title';
break;
case 2:
$sql .= 't.topic_title';
break;
case 3:
$sql .= 'u.username';
break;
case 4:
$sql .= 'f.forum_id';
break;
default:
$sql .= ( $show_results == 'posts' ) ? 'p.post_time' : 'p2.post_time';
break;
}
$sql .= " $sort_dir LIMIT $start, " . $per_page;
if ( !$result = $db->sql_query($sql) )
{
message_die(GENERAL_ERROR, 'Could not obtain search results', '', __LINE__, __FILE__, $sql);
}
$searchset = array();
while( $row = $db->sql_fetchrow($result) )
{
$searchset[] = $row;
}
$db->sql_freeresult($result);