aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/search.php
diff options
context:
space:
mode:
authorNils Adermann <naderman@naderman.de>2006-12-27 00:06:39 +0000
committerNils Adermann <naderman@naderman.de>2006-12-27 00:06:39 +0000
commitb41365fcd41fc185fe197667d2f0bec13f6c30c2 (patch)
treee7746c0e1e870e82a62bb52f08cdb10977059d56 /phpBB/search.php
parent677dc5d2e11c3209fcaf798e4b44588a9305328f (diff)
downloadforums-b41365fcd41fc185fe197667d2f0bec13f6c30c2.tar
forums-b41365fcd41fc185fe197667d2f0bec13f6c30c2.tar.gz
forums-b41365fcd41fc185fe197667d2f0bec13f6c30c2.tar.bz2
forums-b41365fcd41fc185fe197667d2f0bec13f6c30c2.tar.xz
forums-b41365fcd41fc185fe197667d2f0bec13f6c30c2.zip
- display search type as page title for premade searches [Bug #6508]
- flash enabled on user side by default, so that admins can actually change anything by activating it (still disabled by default) - properly implemented password complexity check [Bug #6584] - do not ldap_escape paramaters for the bind function [Bug #6208] - deleted words in edited post subjects weren't getting there search cache refreshed [Bug #6288] - made common word threshold configurable [Bug #6168] - recreated word match table entries after installation, side effect of bug #6060 - option to only allow ASCII usernames - adjusted search page pagination [Bug #6424] - correctly calculate unformatted search result extract length git-svn-id: file:///svn/phpbb/trunk@6814 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/search.php')
-rw-r--r--phpBB/search.php34
1 files changed, 20 insertions, 14 deletions
diff --git a/phpBB/search.php b/phpBB/search.php
index e86e1bea68..642b54b53e 100644
--- a/phpBB/search.php
+++ b/phpBB/search.php
@@ -250,13 +250,14 @@ if ($keywords || $author || $author_id || $search_id || $submit)
$sort_by_sql = array('a' => 'u.username_clean', 't' => (($show_results == 'posts') ? 'p.post_time' : 't.topic_last_post_time'), 'f' => 'f.forum_id', 'i' => 't.topic_title', 's' => (($show_results == 'posts') ? 'p.post_subject' : 't.topic_title'));
// pre-made searches
- $sql = $field = '';
+ $sql = $field = $l_search_title = '';
if ($search_id)
{
switch ($search_id)
{
// Oh holy Bob, bring us some activity...
case 'active_topics':
+ $l_search_title = $user->lang['SEARCH_ACTIVE_TOPICS'];
$show_results = 'topics';
$sort_key = 't';
$sort_dir = 'd';
@@ -279,6 +280,7 @@ if ($keywords || $author || $author_id || $search_id || $submit)
break;
case 'unanswered':
+ $l_search_title = $user->lang['SEARCH_UNANSWERED'];
$show_results = request_var('sr', 'topics');
$show_results = ($show_results == 'posts') ? 'posts' : 'topics';
$sort_by_sql['t'] = ($show_results == 'posts') ? 'p.post_time' : 't.topic_last_post_time';
@@ -331,6 +333,7 @@ if ($keywords || $author || $author_id || $search_id || $submit)
break;
case 'newposts':
+ $l_search_title = $user->lang['SEARCH_NEW'];
// force sorting
$show_results = (request_var('sr', 'topics') == 'posts') ? 'posts' : 'topics';
$sort_key = 't';
@@ -363,6 +366,10 @@ if ($keywords || $author || $author_id || $search_id || $submit)
$field = 'topic_id';
}
break;
+
+ case 'egosearch':
+ $l_search_title = $user->lang['SEARCH_SELF'];
+ break;
}
}
@@ -464,6 +471,7 @@ if ($keywords || $author || $author_id || $search_id || $submit)
$u_search .= ($return_chars != 200) ? '&amp;ch=' . $return_chars : '';
$template->assign_vars(array(
+ 'SEARCH_TITLE' => $l_search_title,
'SEARCH_MATCHES' => $l_search_matches,
'SEARCH_WORDS' => preg_replace('#&amp;(\#[0-9]+;)#', '&$1', htmlspecialchars($search->search_query)),
'IGNORED_WORDS' => (sizeof($search->common_words)) ? htmlspecialchars(implode(' ', $search->common_words)) : '',
@@ -794,26 +802,23 @@ if ($keywords || $author || $author_id || $search_id || $submit)
// Replace naughty words such as farty pants
$row['post_subject'] = censor_text($row['post_subject']);
- $message = $row['post_text'];
-
- if ($return_chars != -1 && utf8_strlen($message) >= ($return_chars + 3))
- {
- $message = censor_text($message);
-
- // make list items visible as such
- $message = str_replace('[*:' . $row['bbcode_uid'] . ']', '&sdot;&nbsp;', $message);
+ $message = censor_text($row['post_text']);
- // do not display raw bbcode
- strip_bbcode($message, $row['bbcode_uid']);
+ $text_only_message = $message;
+ // make list items visible as such
+ $text_only_message = str_replace('[*:' . $row['bbcode_uid'] . ']', '&sdot;&nbsp;', $message);
+ // no BBCode in text only message
+ strip_bbcode($text_only_message, $row['bbcode_uid']);
+ if ($return_chars != -1 && utf8_strlen($text_only_message) >= ($return_chars + 3))
+ {
// now find context for the searched words
- $message = get_context($message, array_filter(explode('|', $hilit), 'strlen'), $return_chars);
+ $message = get_context($text_only_message, array_filter(explode('|', $hilit), 'strlen'), $return_chars);
$message = str_replace("\n", '<br />', $message);
}
else
{
- $message = censor_text($message);
$message = str_replace("\n", '<br />', $message);
// Second parse bbcode here
@@ -833,6 +838,7 @@ if ($keywords || $author || $author_id || $search_id || $submit)
// Always process smilies after parsing bbcodes
$message = smiley_text($message);
}
+ unset($text_only_message);
if ($hilit)
{
@@ -878,7 +884,7 @@ if ($keywords || $author || $author_id || $search_id || $submit)
}
unset($rowset);
- page_header($user->lang['SEARCH']);
+ page_header(($l_search_title) ? $l_search_title : $user->lang['SEARCH']);
$template->set_filenames(array(
'body' => 'search_results.html')