|
14.04.2006, 14:59
Открываем modules/Forums/search.php
Находим (161):
PHP код:
$search_results = ''; // // Search ID Limiter, decrease this value if you experience further timeout problems with searching forums $limiter = 5000;
Ниже добавляем:
Находим (169):
PHP код:
// // Cycle through options ... // if ( $search_id == 'newposts' || $search_id == 'egosearch' || $search_id == 'unanswered' || $search_keywords != '' || $search_author != '' ) {
Ниже добавляем:
PHP код:
// // Flood control // $where_sql = ($userdata['user_id'] == ANONYMOUS) ? "se.session_ip = '$user_ip'" : 'se.session_user_id = ' . $userdata['user_id']; $sql = 'SELECT MAX(sr.search_time) AS last_search_time FROM ' . SEARCH_TABLE . ' sr, ' . SESSIONS_TABLE . " se WHERE sr.session_id = se.session_id AND $where_sql"; if ($result = $db->sql_query($sql)) { if ($row = $db->sql_fetchrow($result)) { if (intval($row['last_search_time']) > 0 && ($current_time - intval($row['last_search_time'])) < intval($board_config['search_flood_interval'])) { message_die(GENERAL_MESSAGE, $lang['Search_Flood_Error']); } } }
Находим (231):
PHP код:
if (preg_match('#^[\*%]+$#', trim($search_author)) || preg_match('#^[^\*]{1,2}$#', str_replace(array('*', '%'), '', trim($search_author)))) { $search_author = ''; } $search_author = str_replace('*', '%', trim($search_author));
Заменяем на:
PHP код:
$search_author = str_replace('*', '%', trim($search_author)); if( ( strpos($search_author, '%') !== false ) && ( strlen(str_replace('%', '', $search_author)) < 3 ) ) { $search_author = ''; }
Находим (455):
PHP код:
if (preg_match('#^[\*%]+$#', trim($search_author)) || preg_match('#^[^\*]{1,2}$#', str_replace(array('*', '%'), '', trim($search_author)))) { $search_author = ''; } $search_author = str_replace('*', '%', trim(str_replace("\'", "''", $search_author)));
Заменяем на:
PHP код:
$search_author = str_replace('*', '%', trim($search_author)); if( ( strpos($search_author, '%') !== false ) && ( strlen(str_replace('%', '', $search_author)) < 3 ) ) { $search_author = ''; }
Находим (665):
PHP код:
// Finish building query (for all combinations) // and run it ... // $sql = "SELECT session_id FROM " . SESSIONS_TABLE; if ( $result = $db->sql_query($sql) ) { $delete_search_ids = array(); while( $row = $db->sql_fetchrow($result) ) { $delete_search_ids[] = "'" . $row['session_id'] . "'"; } if ( count($delete_search_ids) ) { $sql = "DELETE FROM " . SEARCH_TABLE . " WHERE session_id NOT IN (" . implode(", ", $delete_search_ids) . ")"; if ( !$result = $db->sql_query($sql) ) { message_die(GENERAL_ERROR, 'Could not delete old search id sessions', '', __LINE__, __FILE__, $sql); } }
Заменяем на:
PHP код:
// Delete old data from the search result table // $sql = 'DELETE FROM ' . SEARCH_TABLE . ' WHERE search_time < ' . ($current_time - (int) $board_config['session_length']); if ( !$result = $db->sql_query($sql) ) { message_die(GENERAL_ERROR, 'Could not delete old search id sessions', '', __LINE__, __FILE__, $sql);
Находим (713):
PHP код:
SET search_id = $search_id, search_array = '" . str_replace("\'", "''", $result_array) . "' WHERE session_id = '" . $userdata['session_id'] . "'"; if ( !($result = $db->sql_query($sql)) || !$db->sql_affectedrows() ) { $sql = "INSERT INTO " . SEARCH_TABLE . " (search_id, session_id, search_array) VALUES('$search_id', '" . $userdata['session_id'] . "', '" . str_replace("\'", "''", $result_array) . "')";
Заменяем на:
PHP код:
SET search_id = $search_id, search_time = $current_time, search_array = '" . str_replace("\'", "''", $result_array) . "' WHERE session_id = '" . $userdata['session_id'] . "'"; if ( !($result = $db->sql_query($sql)) || !$db->sql_affectedrows() ) { $sql = "INSERT INTO " . SEARCH_TABLE . " (search_id, session_id, search_time, search_array) VALUES($search_id, '" . $userdata['session_id'] . "', $current_time, '" . str_replace("\'", "''", $result_array) . "')";
Открываем modules/Forums/templates/subSilver/admin/board_config_body.tpl
Находим (52):
Код HTML:
<td class="row2"><input type="radio" name="board_email_form" value="1" {BOARD_EMAIL_FORM_ENABLE} /> {L_ENABLED} <input type="radio" name="board_email_form" value="0" {BOARD_EMAIL_FORM_DISABLE} /> {L_DISABLED}</td>
</tr>
<tr>
<td class="row1">{L_FLOOD_INTERVAL} <br /><span class="gensmall">{L_FLOOD_INTERVAL_EXPLAIN}</span></td>
<td class="row2"><input class="post" type="text" size="3" maxlength="4" name="flood_interval" value="{FLOOD_INTERVAL}" /></td>
Ниже добавляем:
Код HTML:
</tr>
<tr>
<td class="row1">{L_SEARCH_FLOOD_INTERVAL} <br /><span class="gensmall">{L_SEARCH_FLOOD_INTERVAL_EXPLAIN}</span></td>
<td class="row2"><input class="post" type="text" size="3" maxlength="4" name="search_flood_interval" value="{SEARCH_FLOOD_INTERVAL}" /></td>
Открываем modules/Forums/templates/subSilver/confirm_body.tpl
Находим (10):
Код HTML:
<th class="thHead" height="25" valign="middle"><span class="tableTitle">{MESSAGE_TITLE}</span></th>
Заменяем на:
Код HTML:
<th class="thHead" height="25" valign="middle">{MESSAGE_TITLE}</th>
|
|