News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

Help to solve the problem of searching for board

Started by tectonny, July 23, 2015, 07:38:16 AM

Previous topic - Next topic

tectonny

The SMF 2.1 search system does not work properly.

Just search around the forum, search for board does not.

Test the link below and search for "Palhada", you will not find, despite the term.
http://www.tectonny.com.br/forum/index.php?board=88.0

And moreover it searches in all forums instead of the active board.

Illori

considering you dont allow guests to search your forum there is very little we can do with that link.

Shambles

Are you expecting the search function to locate words inside your actual board titles?

tectonny

Sorry, I forgot to enable search to visitors.

The problem is this, if you do a search by choosing board, he finds nothing.

margarett

In his forum it seems to be true. Still need to try to reproduce it locally (my current 2.1 test setup is all messed :P )

Searches inside a board don't get all the results which a full forum search do.
Se forem conduzir, não bebam. Se forem beber... CHAMEM-ME!!!! :D

QuoteOver 90% of all computer problems can be traced back to the interface between the keyboard and the chair

Illori

maybe an issue with what type of search index is being used?

tectonny

I'm not content, but I've tried to index and it is the same problem.

Kindred

searches from within a board definitely will NOT get the board description as a search result....  I believe that searches within a board ONLY searches the threads/messages inside that board...

(same as 'search withing a topic' only gets the results within that specific topic)
\Since a board does not exist "within itself" it seems correct and logical that it would not return the board name/description as a result.


However, after a few tests, I have to wonder...   I do not get BOARD names or descriptions in search results - EVER... not in 1.1.x, not in 2.0.x and not in 2.1

So, I don't think this is a bug -- I believe that search results ONLY return matching results in MESSAGES.
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

tectonny

Yes, what I seek is the message, and still does not.

margarett

Yeah, the user is correct (I'm just need to reproduce it to be sure if it's a problem or not)

In his example, the TOPIC has the following subject
"Assistência Técnica na Estrada da Palhada, 651 - Palhada - Nova iguaçu - RJ"
And if you use the quick search above to search for "palhada" in that board ("Neste Quadro" for Portuguese) it finds only "atrapalhada" in a post's BODY an in another board (incidentally board #1). But if you choose full forum then it finds the referred topic.

So the behavior the user describes is buggy but we still need to be sure if it can be reproduced ;)
Se forem conduzir, não bebam. Se forem beber... CHAMEM-ME!!!! :D

QuoteOver 90% of all computer problems can be traced back to the interface between the keyboard and the chair

margarett

I was trying to come back to this and noticed something

You should be running a very outdated version of 2.1's code (even if it says Beta2 at the bottom)

Your "signup" action is still "register"
http://www.tectonny.com.br/forum/index.php?action=register

And that change was performed *ages* ago. It's not "register" anymore for over a year...
https://github.com/SimpleMachines/SMF2.1/pull/1849

That suggests that your index.template.php (at least) is heavily outdated. Some fixes were made to the quick search also a long time ago, which might or not be the cause to your problem... Yet you need to be running the latest code so that we can count this as an issue (or not...)
Se forem conduzir, não bebam. Se forem beber... CHAMEM-ME!!!! :D

QuoteOver 90% of all computer problems can be traced back to the interface between the keyboard and the chair

tectonny

Strange, I found that reported, and appears is exactly the same as reported example.

My index.php

<?php
/**
 * This, as you have probably guessed, is the crux on which SMF functions.
 * Everything should start here, so all the setup and security is done
 * properly.  The most interesting part of this file is the action array in
 * the smf_main() function.  It is formatted as so:
 *  'action-in-url' => array('Source-File.php', 'FunctionToCall'),
 *
 * Then, you can access the FunctionToCall() function from Source-File.php
 * with the URL index.php?action=action-in-url.  Relatively simple, no?
 *
 * Simple Machines Forum (SMF)
 *
 * @package SMF
 * @author Simple Machines http://www.simplemachines.org
 * @copyright 2015 Simple Machines and individual contributors
 * @license http://www.simplemachines.org/about/smf/license.php BSD
 *
 * @version 2.1 Beta 2
 */

$forum_version 'SMF 2.1 Beta 2';
$software_year '2015';

// Get everything started up...
define('SMF'1);
if (
function_exists('set_magic_quotes_runtime'))
@set_magic_quotes_runtime(0);
error_reporting(defined('E_STRICT') ? E_ALL E_STRICT E_ALL);
$time_start microtime();

// This makes it so headers can be sent!
ob_start();

// Do some cleaning, just in case.
foreach (array('db_character_set''cachedir') as $variable)
if (isset($GLOBALS[$variable]))
unset($GLOBALS[$variable], $GLOBALS[$variable]);

// Load the settings...
require_once(dirname(__FILE__) . '/Settings.php');

// Make absolutely sure the cache directory is defined.
if ((empty($cachedir) || !file_exists($cachedir)) && file_exists($boarddir '/cache'))
$cachedir $boarddir '/cache';

// Without those we can't go anywhere
require_once($sourcedir '/QueryString.php');
require_once(
$sourcedir '/Subs.php');
require_once(
$sourcedir '/Subs-Auth.php');
require_once(
$sourcedir '/Errors.php');
require_once(
$sourcedir '/Load.php');

// If $maintenance is set specifically to 2, then we're upgrading or something.
if (!empty($maintenance) && $maintenance == 2)
display_maintenance_message();

// Create a variable to store some SMF specific functions in.
$smcFunc = array();

// Initiate the database connection and define some database functions to use.
loadDatabase();

// Load the settings from the settings table, and perform operations like optimizing.
$context = array();
reloadSettings();
// Clean the request variables, add slashes, etc.
cleanRequest();

// Seed the random generator.
if (empty($modSettings['rand_seed']) || mt_rand(1250) == 69)
smf_seed_generator();

// Before we get carried away, are we doing a scheduled task? If so save CPU cycles by jumping out!
if (isset($_GET['scheduled']))
{
require_once($sourcedir '/ScheduledTasks.php');
AutoTask();
}

// Displaying attached avatars, legacy.
elseif (isset($_GET['action']) && $_GET['action'] == 'dlattach' && isset($_GET['type']) && $_GET['type'] == 'avatar')
{
require_once($sourcedir'/Avatar.php');
showAvatar();
}

// And important includes.
require_once($sourcedir '/Session.php');
require_once(
$sourcedir '/Errors.php');
require_once(
$sourcedir '/Logging.php');
require_once(
$sourcedir '/Security.php');
require_once(
$sourcedir '/Subs-Portal.php');
require_once(
$sourcedir '/Class-BrowserDetect.php');

// Check if compressed output is enabled, supported, and not already being done.
if (!empty($modSettings['enableCompressedOutput']) && !headers_sent())
{
// If zlib is being used, turn off output compression.
if (ini_get('zlib.output_compression') >=  || ini_get('output_handler') == 'ob_gzhandler')
$modSettings['enableCompressedOutput'] = '0';
else
{
ob_end_clean();
ob_start('ob_gzhandler');
}
}

// Register an error handler.
set_error_handler('error_handler');

// Start the session. (assuming it hasn't already been.)
loadSession();

// Determine if this is using WAP, WAP2, or imode.  Technically, we should check that wap comes before application/xhtml or text/html, but this doesn't work in practice as much as it should.
if (isset($_REQUEST['wap']) || isset($_REQUEST['wap2']) || isset($_REQUEST['imode']))
unset($_SESSION['nowap']);
elseif (isset(
$_REQUEST['nowap']))
$_SESSION['nowap'] = true;
elseif (!isset(
$_SESSION['nowap']))
{
if (isset($_SERVER['HTTP_ACCEPT']) && strpos($_SERVER['HTTP_ACCEPT'], 'application/vnd.wap.xhtml+xml') !== false)
$_REQUEST['wap2'] = 1;
elseif (isset($_SERVER['HTTP_ACCEPT']) && strpos($_SERVER['HTTP_ACCEPT'], 'text/vnd.wap.wml') !== false)
{
if (strpos($_SERVER['HTTP_USER_AGENT'], 'DoCoMo/') !== false || strpos($_SERVER['HTTP_USER_AGENT'], 'portalmmm/') !== false)
$_REQUEST['imode'] = 1;
else
$_REQUEST['wap'] = 1;
}
}

if (!
defined('WIRELESS'))
define('WIRELESS', isset($_REQUEST['wap']) || isset($_REQUEST['wap2']) || isset($_REQUEST['imode']));

// Some settings and headers are different for wireless protocols.
if (WIRELESS)
{
define('WIRELESS_PROTOCOL', isset($_REQUEST['wap']) ? 'wap' : (isset($_REQUEST['wap2']) ? 'wap2' : (isset($_REQUEST['imode']) ? 'imode' '')));

// Some cellphones can't handle output compression...
// @todo shouldn't the phone handle that?
$modSettings['enableCompressedOutput'] = '0';
// @todo Do we want these hard coded?
$modSettings['defaultMaxMessages'] = 5;
$modSettings['defaultMaxTopics'] = 9;

// Wireless protocol header.
if (WIRELESS_PROTOCOL == 'wap')
header('Content-Type: text/vnd.wap.wml');
}

// What function shall we execute? (done like this for memory's sake.)
call_user_func(smf_main());

// Call obExit specially; we're coming from the main area ;).
obExit(nullnulltrue);

/**
 * The main dispatcher.
 * This delegates to each area.
 */
function smf_main()
{
global $modSettings$settings$user_info$board$topic;
global $board_info$maintenance$sourcedir;

// Special case: session keep-alive, output a transparent pixel.
if (isset($_GET['action']) && $_GET['action'] == 'keepalive')
{
header('Content-Type: image/gif');
die("\x47\x49\x46\x38\x39\x61\x01\x00\x01\x00\x80\x00\x00\x00\x00\x00\x00\x00\x00\x21\xF9\x04\x01\x00\x00\x00\x00\x2C\x00\x00\x00\x00\x01\x00\x01\x00\x00\x02\x02\x44\x01\x00\x3B");
}

// We should set our security headers now.
frameOptionsHeader();

// Load the user's cookie (or set as guest) and load their settings.
loadUserSettings();

// Load the current board's information.
loadBoard();

// Load the current user's permissions.
loadPermissions();

// Attachments don't require the entire theme to be loaded.
if (isset($_REQUEST['action']) && $_REQUEST['action'] == 'dlattach')
detectBrowser();
// Load the current theme.  (note that ?theme=1 will also work, may be used for guest theming.)
else
loadTheme();

// Check if the user should be disallowed access.
is_not_banned();

// If we are in a topic and don't have permission to approve it then duck out now.
if (!empty($topic) && empty($board_info['cur_topic_approved']) && !allowedTo('approve_posts') && ($user_info['id'] != $board_info['cur_topic_starter'] || $user_info['is_guest']))
fatal_lang_error('not_a_topic'false);

$no_stat_actions = array('clock''dlattach''findmember''jsoption''likes''loadeditorlocale''modifycat''requestmembers''smstats''suggest''about:unknown''.xml''xmlhttp''verificationcode''viewquery''viewsmfile');
call_integration_hook('integrate_pre_log_stats', array(&$no_stat_actions));
// Do some logging, unless this is an attachment, avatar, toggle of editor buttons, theme option, XML feed etc.
if (empty($_REQUEST['action']) || !($_REQUEST['action'] == 'portal' && isset($_GET['xml'])) && !in_array($_REQUEST['action'], $no_stat_actions))
{
// Log this user as online.
writeLog();

// Track forum statistics and hits...?
if (!empty($modSettings['hitStats']))
trackStats(array('hits' => '+'));
}
unset($no_stat_actions);

// Load SimplePortal.
sportal_init();

// Is the forum in maintenance mode? (doesn't apply to administrators.)
if (!empty($maintenance) && !allowedTo('admin_forum'))
{
// You can only login.... otherwise, you're getting the "maintenance mode" display.
if (isset($_REQUEST['action']) && ($_REQUEST['action'] == 'login2' || $_REQUEST['action'] == 'logout'))
{
require_once($sourcedir '/LogInOut.php');
return $_REQUEST['action'] == 'login2' 'Login2' 'Logout';
}
// Don't even try it, sonny.
else
return 'InMaintenance';
}
// If guest access is off, a guest can only do one of the very few following actions.
elseif (empty($modSettings['allow_guestAccess']) && $user_info['is_guest'] && (!isset($_REQUEST['action']) || !in_array($_REQUEST['action'], array('coppa''login''login2''register''register2''reminder''activate''help''helpadmin''smstats''verificationcode''openidreturn''signup''signup2'))))
return 'KickGuest';
elseif (empty($_REQUEST['action']))
{
// Go catch it boy! Catch it!
$sp_action sportal_catch_action();
if ($sp_action)
return $sp_action;

// Action and board are both empty... BoardIndex! Unless someone else wants to do something different.
if (empty($board) && empty($topic))
{
$defaultAction false;

if (!empty($modSettings['integrate_default_action']))
{
$defaultAction explode(','$modSettings['integrate_default_action']);

// Sorry, only one default action is needed.
$defaultAction $defaultAction[0];

$call call_helper($defaultActiontrue);

if (!empty($call))
return $call;
}

// No default action huh? then go to our good old BoardIndex.
else
{
require_once($sourcedir '/BoardIndex.php');

return 'BoardIndex';
}
}

// Topic is empty, and action is empty.... MessageIndex!
elseif (empty($topic))
{
require_once($sourcedir '/MessageIndex.php');
return 'MessageIndex';
}

// Board is not empty... topic is not empty... action is empty.. Display!
else
{
require_once($sourcedir '/Display.php');
return 'Display';
}
}

// Here's the monstrous $_REQUEST['action'] array - $_REQUEST['action'] => array($file, $function).
$actionArray = array(
'activate' => array('Register.php''Activate'),
'admin' => array('Admin.php''AdminMain'),
'announce' => array('Post.php''AnnounceTopic'),
'attachapprove' => array('ManageAttachments.php''ApproveAttach'),
'buddy' => array('Subs-Members.php''BuddyListToggle'),
'calendar' => array('Calendar.php''CalendarMain'),
'clock' => array('Calendar.php''clock'),
'coppa' => array('Register.php''CoppaForm'),
'credits' => array('Who.php''Credits'),
'deletemsg' => array('RemoveTopic.php''DeleteMessage'),
'dlattach' => array('Display.php''Download'),
'editpoll' => array('Poll.php''EditPoll'),
'editpoll2' => array('Poll.php''EditPoll2'),
'findmember' => array('Subs-Auth.php''JSMembers'),
'forum' => array('BoardIndex.php''BoardIndex'),
'portal' => array('PortalMain.php''sportal_main'),
'groups' => array('Groups.php''Groups'),
'help' => array('Help.php''ShowHelp'),
'helpadmin' => array('Help.php''ShowAdminHelp'),
'jsmodify' => array('Post.php''JavaScriptModify'),
'jsoption' => array('Themes.php''SetJavaScript'),
'likes' => array('Likes.php''Likes::call#'),
'loadeditorlocale' => array('Subs-Editor.php''loadLocale'),
'lock' => array('Topic.php''LockTopic'),
'lockvoting' => array('Poll.php''LockVoting'),
'login' => array('LogInOut.php''Login'),
'login2' => array('LogInOut.php''Login2'),
'logintfa' => array('LogInOut.php''LoginTFA'),
'logout' => array('LogInOut.php''Logout'),
'markasread' => array('Subs-Boards.php''MarkRead'),
'mergetopics' => array('SplitTopics.php''MergeTopics'),
'mlist' => array('Memberlist.php''Memberlist'),
'moderate' => array('ModerationCenter.php''ModerationMain'),
'modifycat' => array('ManageBoards.php''ModifyCat'),
'movetopic' => array('MoveTopic.php''MoveTopic'),
'movetopic2' => array('MoveTopic.php''MoveTopic2'),
'notify' => array('Notify.php''Notify'),
'notifyboard' => array('Notify.php''BoardNotify'),
'notifytopic' => array('Notify.php''TopicNotify'),
'pm' => array('PersonalMessage.php''MessageMain'),
'post' => array('Post.php''Post'),
'post2' => array('Post.php''Post2'),
'printpage' => array('Printpage.php''PrintTopic'),
'profile' => array('Profile.php''ModifyProfile'),
'quotefast' => array('Post.php''QuoteFast'),
'quickmod' => array('MessageIndex.php''QuickModeration'),
'quickmod2' => array('Display.php''QuickInTopicModeration'),
'recent' => array('Recent.php''RecentPosts'),
'reminder' => array('Reminder.php''RemindMe'),
'removepoll' => array('Poll.php''RemovePoll'),
'removetopic2' => array('RemoveTopic.php''RemoveTopic2'),
'reporttm' => array('ReportToMod.php''ReportToModerator'),
'requestmembers' => array('Subs-Auth.php''RequestMembers'),
'restoretopic' => array('RemoveTopic.php''RestoreTopic'),
'search' => array('Search.php''PlushSearch1'),
'search2' => array('Search.php''PlushSearch2'),
'sendactivation' => array('Register.php''SendActivation'),
'signup' => array('Register.php''Register'),
'signup2' => array('Register.php''Register2'),
'smstats' => array('Stats.php''SMStats'),
'suggest' => array('Subs-Editor.php''AutoSuggestHandler'),
'spellcheck' => array('Subs-Post.php''SpellCheck'),
'splittopics' => array('SplitTopics.php''SplitTopics'),
'stats' => array('Stats.php''DisplayStats'),
'sticky' => array('Topic.php''Sticky'),
'theme' => array('Themes.php''ThemesMain'),
'trackip' => array('Profile-View.php''trackIP'),
'about:unknown' => array('Likes.php''BookOfUnknown'),
'unread' => array('Recent.php''UnreadTopics'),
'unreadreplies' => array('Recent.php''UnreadTopics'),
'verificationcode' => array('Register.php''VerificationCode'),
'viewprofile' => array('Profile.php''ModifyProfile'),
'vote' => array('Poll.php''Vote'),
'viewquery' => array('ViewQuery.php''ViewQuery'),
'viewsmfile' => array('Admin.php''DisplayAdminFile'),
'who' => array('Who.php''Who'),
'.xml' => array('News.php''ShowXmlFeed'),
'xmlhttp' => array('Xml.php''XMLhttpMain'),
'form' => array('CustomForm.php''CustomForm'),
);

// Allow modifying $actionArray easily.
call_integration_hook('integrate_actions', array(&$actionArray));

if (!empty($context['disable_sp']))
unset($actionArray['portal'], $actionArray['forum']);

// Get the function and file to include - if it's not there, do the board index.
if (!isset($_REQUEST['action']) || !isset($actionArray[$_REQUEST['action']]))
{
// Catch the action with the theme?
if (!empty($settings['catch_action']))
{
require_once($sourcedir '/Themes.php');
return 'WrapAction';
}

if (!empty($modSettings['integrate_fallback_action']))
{
$fallbackAction explode(','$modSettings['integrate_fallback_action']);

// Sorry, only one fallback action is needed.
$fallbackAction $fallbackAction[0];

$call call_helper($fallbackActiontrue);

if (!empty($call))
return $call;
}

// No fallback action, huh?
else
{
fatal_lang_error('not_found'false, array(), 404);
}
}

// Otherwise, it was set - so let's go to that action.
require_once($sourcedir '/' $actionArray[$_REQUEST['action']][0]);

// Do the right thing.
return call_helper($actionArray[$_REQUEST['action']][1], true);
}

?>


margarett

No, not index.php.
It's index.template.php (under Themes/default)
Se forem conduzir, não bebam. Se forem beber... CHAMEM-ME!!!! :D

QuoteOver 90% of all computer problems can be traced back to the interface between the keyboard and the chair

tectonny

Bruno troquei também, e o layout ficou todo estranho, mas não resolveu.

margarett

Please use English in general support boards ;)
(ou abre um tópico na secção PT se te sentires mais confortável ;) )

I confirm the issue now. I can reproduce it easily, there is for sure something wrong with the "this board" option in quick search.
I will now build a proper reproduction method (because I used PT words - not all of them very nice :P ) and will track an issue at GH.
Se forem conduzir, não bebam. Se forem beber... CHAMEM-ME!!!! :D

QuoteOver 90% of all computer problems can be traced back to the interface between the keyboard and the chair

tectonny

Sorry, I forgot to translate, kkkkkkk.
And in support smf 2.1 seems to be only here.

margarett

No, we can do support for 2.1 in PT boards too ;) Although here you get more "exposure" ;)
Se forem conduzir, não bebam. Se forem beber... CHAMEM-ME!!!! :D

QuoteOver 90% of all computer problems can be traced back to the interface between the keyboard and the chair

tectonny

Bruno, how can I update my forum?
If I already have beta 2?

Just change the files without running upgrade.php?

I made a test facility here: http://simplesforum.tk/

And it seems that for errors not.

tectonny

Updated to the latest version (07.29.2015), and without installing any MOD and did research testing and the problem continues.

margarett

It was supposed to :P
It is indeed a bug in the current code (which reminds me that I haven't fully tracked it)
Se forem conduzir, não bebam. Se forem beber... CHAMEM-ME!!!! :D

QuoteOver 90% of all computer problems can be traced back to the interface between the keyboard and the chair

Oldiesmann

Michael Eshom
Christian Metal Fans


Advertisement: