Username: TestAmigoJack wrote:(Although this somehow goes beyond this topic) Give me a link to your board and a test account, so I have at least the ability to click on the "find member" when composing a PM.
Password: test123
Username: TestAmigoJack wrote:(Although this somehow goes beyond this topic) Give me a link to your board and a test account, so I have at least the ability to click on the "find member" when composing a PM.
Code: Select all
function refresh(f,l)
{
var urls= 'models.php';
var param = 'f='+f+'&selected_language='+l;
var myAjax = new Ajax.Request
(
urls,
{
method: 'post',
postBody: param,
onComplete: showResponse
};
);
};
Code: Select all
function refresh(f,l)
{
var urls= 'models.php';
var param = 'f='+f+'&selected_language='+l;
var myAjax = new Ajax.Request
(
urls,
{
method: 'post',
postBody: param,
onComplete: showResponse
}
);
};
That makes little sense.baller1234 wrote:a extra tab
So when viewing a forum you want to filter the list of topics to be displayed by keywords for the topic title? Then a textbox in MCP > Main > View forum would be better then.baller1234 wrote:search for posts/topics
Code: Select all
$limit_time_sql = ($sort_days) ? 'AND t.topic_last_post_time >= ' . (time() - ($sort_days * 86400)) : '';
Code: Select all
/*** 2012-03-04 BEGIN AmigoJack
Search within the forum by topic title ***/
$keywords= utf8_normalize_nfc( request_var( 'keywords', '', TRUE ) );
if( $keywords== $user-> lang['SEARCH_FORUM'] ) $keywords= '';
$sql_where = ''; // Used with the search only
$searchurl= $url; // Excludes keywords and start
if( $keywords&& request_var( 'search', '' ) ) {
$user-> add_lang( 'search' );
$search_forum= array( $forum_id ); // This forum only
$search_child= FALSE;
$url.= '&keywords=' . urlencode(htmlspecialchars_decode($keywords));
// Largely taken from /search.php
$ex_fid_ary = array_unique(array_merge(array_keys($auth->acl_getf('!f_read', true)), array_keys($auth->acl_getf('!f_search', true))));
$not_in_fid = (sizeof($ex_fid_ary)) ? 'WHERE ' . $db->sql_in_set('f.forum_id', $ex_fid_ary, true) . " OR (f.forum_password <> '' AND fa.user_id <> " . (int) $user->data['user_id'] . ')' : "";
$sql = 'SELECT f.forum_id, f.forum_name, f.parent_id, f.forum_type, f.right_id, f.forum_password, f.forum_flags, fa.user_id
FROM ' . FORUMS_TABLE . ' f
LEFT JOIN ' . FORUMS_ACCESS_TABLE . " fa ON (fa.forum_id = f.forum_id
AND fa.session_id = '" . $db->sql_escape($user->session_id) . "')
$not_in_fid
ORDER BY f.left_id";
$result = $db->sql_query($sql);
$right_id = 0;
$reset_search_forum = true;
while ($row = $db->sql_fetchrow($result))
{
if ($row['forum_password'] && $row['user_id'] != $user->data['user_id'])
{
$ex_fid_ary[] = (int) $row['forum_id'];
continue;
}
if (sizeof($search_forum))
{
if ($search_child)
{
if (in_array($row['forum_id'], $search_forum) && $row['right_id'] > $right_id)
{
$right_id = (int) $row['right_id'];
}
else if ($row['right_id'] < $right_id)
{
continue;
}
}
if (!in_array($row['forum_id'], $search_forum))
{
$ex_fid_ary[] = (int) $row['forum_id'];
$reset_search_forum = false;
}
}
}
$db->sql_freeresult($result);
// find out in which forums the user is allowed to view approved posts
if ($auth->acl_get('m_approve'))
{
$m_approve_fid_ary = array(-1);
$m_approve_fid_sql = '';
}
else if ($auth->acl_getf_global('m_approve'))
{
$m_approve_fid_ary = array_diff(array_keys($auth->acl_getf('!m_approve', true)), $ex_fid_ary);
$m_approve_fid_sql = ' AND (p.post_approved = 1' . ((sizeof($m_approve_fid_ary)) ? ' OR ' . $db->sql_in_set('p.forum_id', $m_approve_fid_ary, true) : '') . ')';
}
else
{
$m_approve_fid_ary = array();
$m_approve_fid_sql = ' AND p.post_approved = 1';
}
if ($reset_search_forum)
{
$search_forum = array();
}
// Select which method we'll use to obtain the post_id or topic_id information
$search_type = basename($config['search_type']);
if (!file_exists($phpbb_root_path . 'includes/search/' . $search_type . '.' . $phpEx))
{
trigger_error('NO_SUCH_SEARCH_MODULE');
}
require("{$phpbb_root_path}includes/search/$search_type.$phpEx");
// We do some additional checks in the module to ensure it can actually be utilised
$error = false;
$search = new $search_type($error);
if ($error)
{
trigger_error($error);
}
// let the search module split up the keywords
if ($keywords)
{
$correct_query = $search->split_keywords($keywords, 'all');
if (!$correct_query || (empty($search->search_query) && !sizeof($author_id_ary) && !$search_id))
{
$ignored = (sizeof($search->common_words)) ? sprintf($user->lang['IGNORED_TERMS_EXPLAIN'], implode(' ', $search->common_words)) . '<br />' : '';
trigger_error($ignored . sprintf($user->lang['NO_KEYWORDS'], $search->word_length['min'], $search->word_length['max']));
}
}
sort($ex_fid_ary);
sort($m_approve_fid_ary);
$forum_topics= $search-> keyword_search
( 'topics'
, 'titleonly' // Or 'firstpost' for post text also
, 'all'
, $sort_by_sql
, $sort_key
, $sort_dir
, $sort_days
, $ex_fid_ary
, $m_approve_fid_ary
, 0
, array()
, ''
, $id_ary
, $start
, $topics_per_page
);
// For some searches we need to print out the "no results" page directly to allow re-sorting/refining the search options.
if (!sizeof($id_ary))
{
trigger_error('NO_SEARCH_RESULTS');
}
if (sizeof($id_ary))
{
$sql_where .= 'AND '. $db->sql_in_set( 't.topic_id', $id_ary);
$sql_where .= (sizeof($ex_fid_ary)) ? ' AND (' . $db->sql_in_set('t.forum_id', $ex_fid_ary, true) . ' OR t.forum_id IS NULL)' : '';
$sql_where .= str_replace(array('p.post_approved', 'p.forum_id'), array('t.topic_approved', 't.forum_id'), $m_approve_fid_sql );
}
}
/*** 2012-03-04 END ***/
Code: Select all
'S_MCP_ACTION' => $url . "&i=$id&forum_action=$action&mode=$mode&start=$start" . (($merge_select) ? $selected_ids : ''),
Code: Select all
/*** 2012-03-04 BEGIN AmigoJack
Search within the forum by topic title ***/
'S_MCP_SEARCHACTION' => $searchurl . "&i=$id&forum_action=$action&mode=$mode",
/*** 2012-03-04 END ***/
Code: Select all
else
{
$read_tracking_join = $read_tracking_select = '';
}
Code: Select all
/*** 2012-03-04 BEGIN AmigoJack
Search within the forum by topic title ***/
if( $keywords&& request_var( 'search', '' ) ) {
$sql = "SELECT t.topic_id
FROM " . TOPICS_TABLE . " t
WHERE t.forum_id IN($forum_id, 0)
" . (($auth->acl_get('m_approve', $forum_id)) ? '' : 'AND t.topic_approved = 1') . "
$sql_where
$limit_time_sql
ORDER BY t.topic_type DESC, $sort_order_sql";
$result = $db->sql_query($sql);
} else {
/*** 2012-03-04 END ***/
Code: Select all
$topic_list = $topic_tracking_info = array();
Code: Select all
/*** 2012-03-04 BEGIN AmigoJack
Search within the forum by topic title ***/
}
/*** 2012-03-04 END ***/
Code: Select all
$quickmod = ($mode == 'quickmod') ? true : false;
Code: Select all
/*** 2013-07-08 BEGIN AmigoJack
http://www.phpbb.com/community/viewtopic.php?t=2151774 ***/
if( request_var( 'search', '' ) ) $action= '';
/*** 2013-07-08 END ***/
Code: Select all
<h2><a href="{U_VIEW_FORUM}">{L_FORUM}: {FORUM_NAME}</a></h2>
Code: Select all
<div class="search-box">
<form method="post" id="forum-search" action="{S_MCP_SEARCHACTION}">
<fieldset>
<input class="inputbox search tiny" type="text" name="keywords" id="search_keywords" size="20" value="{L_SEARCH_FORUM}" onclick="if (this.value == '{LA_SEARCH_FORUM}') this.value = '';" onblur="if (this.value == '') this.value = '{LA_SEARCH_FORUM}';" />
<input class="button2" type="submit" name="search" value="{L_SEARCH}" />
</fieldset>
</form>
</div>
'titleonly'
in my code and replace it according to the comment.That's to have a distinction wheather a forum has no topics or the search didn't match any topics (along with other possible error messages a search can give you).baller1234 wrote:when there are no topics anymore (from search results) i get the standard error that nothing is found
"it"? Do you click on a link or do you navigate one step back in your browser, looking at (the old state of) the previous site?baller1234 wrote:sometimes it goes back
The filter is working, but when searching, phpBB shows me this Debug error:AmigoJack wrote:Open /includes/mcp/mcp_forum.php
Roughly tested: it filters the topic list to those where my keywords are found in the title. Going beyond page 1 also works, aswell as submitting a new search while search results are already shown. If you also want to search within the text of the topic's first post, search for'titleonly'
in my code and replace it according to the comment.
Updated my post: open /includes/mcp/mcp_forum.php and find:theallzaz wrote:Debug error
Code: Select all
$correct_query = $search->split_keywords($keywords, $search_terms);
Code: Select all
$correct_query = $search->split_keywords($keywords, 'all');
Code: Select all
if( $keywords== $user-> lang['SEARCH_FORUM'] ) $keywords= '';
Works with 3.0.11. Your loose description doesn't help. What are you doing, what do you expect, what happens instead?baller1234 wrote:its not working with new version