News:

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

Main Menu

Search Enhancement Mod

Started by ioszilla, August 12, 2007, 05:53:15 PM

Previous topic - Next topic

L.G.S

FREE and LIVE World Cup + Premier League football streams:

www.gamesandgoals.com


ES23

Hi!

I have installed the latest version of the smf search enhancement and it is working great.However,there is an error reported in my forums error log when I visited the log.

This is the error:

8: Undefined index: brd
File: /var/www/html/forums/Sources/Search.php
Line: 407

I have attached my search.php in my this post.Can someone please advise what is going wrong???What do you mean by undefined index?Will it affect my forum in anyway by having this undefined index error.Plzz help!!!

ioszilla

#42
It's caused by a confirmed bug in the official SMF 1.1.3 Search.php, not by this mod:

From official 1.1.3 Search.php, line 407:

Quote// Ensure that brd is an array.
if (!is_array($_REQUEST['brd']) && !empty($_REQUEST['brd']))
   $_REQUEST['brd'] = strpos($_REQUEST['brd'], ',') !== false ? explode(',', $_REQUEST['brd']) : array($_REQUEST['brd']);

You see if $_REQUEST['brd'] is not set, is_array($_REQUEST['brd']) will generate a warning.


This search mod actually fixed this smf bug:

Quote
        // Ensure that brd is an array.
   // ATTN: reverse the order here to prevent undefined index error. (credit: mouser)
   if (!empty($_REQUEST['brd']) && !is_array($_REQUEST['brd']))
      $_REQUEST['brd'] = strpos($_REQUEST['brd'], ',') !== false ? explode(',', $_REQUEST['brd']) : array($_REQUEST['brd']);

So you wont be seeing this error again. :)


Ben_S

Quote from: wordzilla on August 13, 2007, 11:55:42 PM
Search ranking is especially important for BIG forums like the one you run, Ben_S - frequently your users get overwhelming amount of matches (it's reasonable to assume that only a small fraction of ppl today are very good at crafting queries). Now with "ordering by date" or otherwise poorly ranked results, it's impossible for users to grab the whole picture and enjoy the richness of information -- their horizon is strictly limited to recent posts and irrelevant posts, and as such it makes no difference whether the forum boasts 3 million posts or has just 30k. Yes, the admin and his forum users can swear that there's 500% chance the topic of interest just lies somewhere, somewhere, somewhere, buried in 3 million posts -- yet nobody is willing to go through 30 pages of search results to dig it out. Dang! It's lost.

Personally I still think the only real worthwhile ranking for search results is ordered by date.

The vast majority of things people search for on my own forum at least, are pretty much mentioned in most topics so any ordering performed any way other than by date is useles, I'll take a look at your code sometime though.

My only real issue with search is the fact that (on it's own at least) MySQL is absolutely rubbish in terms of performance.
Liverpool FC Forum with 14 million+ posts.

Eleglin

I think SMF Team should add this mod in SMF 2.0 !
This would be a great feature, if it was added :D
No support by PM or Mail.

L.G.S

I think they'd have to make their own wouldn't they? Doubt they would want the copyright in their search results!
FREE and LIVE World Cup + Premier League football streams:

www.gamesandgoals.com


ioszilla

Quote from: L.G.S on August 14, 2007, 04:12:37 PM
I think they'd have to make their own wouldn't they? Doubt they would want the copyright in their search results!

They don't have to. If they are interested in what this mod offers, I'm willing to share with the SMF team all I have/know, without any reciprocation (no copyright thingy, of course). SMF is about open source and sharing, just imagine how many forums and forum members can benefit from this - I won't let my ego get in the way. :)

Eleglin

No support by PM or Mail.

ioszilla

Well, yes u right, I actually used "open source" in its loosest sense here. ;)

karlbenson

I always am appreciative when users are willing to offer code 'no-strings' attached.

So thanks wordZilla.

ES23

Quote from: wordzilla on August 14, 2007, 12:14:17 PM
It's caused by a confirmed bug in the official SMF 1.1.3 Search.php, not by this mod:

From official 1.1.3 Search.php, line 407:

Quote// Ensure that brd is an array.
if (!is_array($_REQUEST['brd']) && !empty($_REQUEST['brd']))
   $_REQUEST['brd'] = strpos($_REQUEST['brd'], ',') !== false ? explode(',', $_REQUEST['brd']) : array($_REQUEST['brd']);

You see if $_REQUEST['brd'] is not set, is_array($_REQUEST['brd']) will generate a warning.


This search mod actually fixed this smf bug:

Quote
        // Ensure that brd is an array.
   // ATTN: reverse the order here to prevent undefined index error. (credit: mouser)
   if (!empty($_REQUEST['brd']) && !is_array($_REQUEST['brd']))
      $_REQUEST['brd'] = strpos($_REQUEST['brd'], ',') !== false ? explode(',', $_REQUEST['brd']) : array($_REQUEST['brd']);

So you wont be seeing this error again. :)



Thanks for the reply ;) I feel rest assured ... ... now bugged by the modify_inline issue now ... ... :( lol...

ioszilla

Quotenow bugged by the modify_inline issue now

Is this issue related to this mod?

ES23

Quote from: wordzilla on August 15, 2007, 06:40:38 AM
Quotenow bugged by the modify_inline issue now

Is this issue related to this mod?

Not sure ... ... I think not as error seems to be from post.php there so din list the details on this thread.I have posted on the modify_inline thread... ... now in hope of someone to help me soon ... ... ;) There's the only error I keep facing besides this search error ... ..Thanks a million btw for clearing 50% of my mindload :)

ioszilla

I have uploaded a new version of this mod to fix a bug from official smf 1.1.3 search.php:
http://www.simplemachines.org/community/index.php?topic=189110.0

I believe it's a major bug and therefore it's recommended that you upgrade to the latest version of this mod.

To upgrade this mod: uninstall the old version from package manager, delete old package, upload new one and install. :)

ES23

#54
Quote from: wordzilla on August 15, 2007, 10:22:35 PM
I have uploaded a new version of this mod to fix a bug from official smf 1.1.3 search.php:
http://www.simplemachines.org/community/index.php?topic=189110.0

I believe it's a major bug and therefore it's recommended that you upgrade to the latest version of this mod.

To upgrade this mod: uninstall the old version from package manager, delete old package, upload new one and install. :)

I'm currently using the Search Enhancement Mod ... ...Do I need to make the changes to the Search.php file because the part you stated that needs to be edited has some difference in my one?This only applies to the original official smf search and nothing to do with the search enhancement mod,right?Currently,I'm using the search enhancement mod so do I need to make any changes?Pls advise.Thanks.

ioszilla

Quote from: ES23 on August 17, 2007, 05:25:43 AM
Quote from: wordzilla on August 15, 2007, 10:22:35 PM
I have uploaded a new version of this mod to fix a bug from official smf 1.1.3 search.php:
http://www.simplemachines.org/community/index.php?topic=189110.0

I believe it's a major bug and therefore it's recommended that you upgrade to the latest version of this mod.

To upgrade this mod: uninstall the old version from package manager, delete old package, upload new one and install. :)

I'm currently using the Search Enhancement Mod ... ...Do I need to make the changes to the Search.php file because the part you stated that needs to be edited has some difference in my one?This only applies to the original official smf search,right?Currently,I'm using the search enhancement mod so do I need to make any changes?Pls advise.Thanks.

The bug affects official SMF 1.1.3 without this mod or with any previous version of this mod. Whether this bug will actually ruin your search results depends on your account's MySQL privilege to CREATE TEMPORARY TABLES on the server. If your host does not grant this privilege then you are in bad luck - go upgrade to this mod to have the bug fixed.

My suggestion is to always upgrade to the latest version of this mod. After all more features are being added, bugs are getting fixed - you lose nothing. :)


To upgrade: uninstall the old version from package manager, delete old package, upload new one and install.

Eleglin

If you must do a manual installation and if you don't want to modify all your files, you can still compare the install.xml of the new version and the old one with the program Windiff and then modify your files where there are differences :)
No support by PM or Mail.

tonzi

I am having an error upon installing...

./Sources/Search.php         ---------------------------             Test failed

TrueSatan

Your error is a variant on the most common error of all those reported on these pages...it tells you that another mod you have installed has already edited the file in question and that you thus need to do a manual installation of this mod. Please read:

http://docs.simplemachines.org/index.php?topic=402.msg531#msg531

http://www.simplemachines.org/community/index.php?topic=34526.0

The following may also prove helpful:

http://modparser.dev.dansoftaustralia.net/

Ramón Cutanda

#59
Well... thanks on the one hand and, on the other, here's the Spanish code for the language file, in case someone needs it or you would like to update the mod.

<!-- Spanish language -->
<!-- Add a language string for error handling to the English error languagefile Thanks to Aaron: http://custom.simplemachines.org/mods/index.php?mod=884 -->
<file name="$themedir/languages/Errors.spanish.php" error="ignore">
<operation error="ignore">
<search position="end" />
<add><![CDATA[
$txt['error_search_string_small_words'] = 'Cada palabra debe tener un mínimo de dos caracteres.';]]></add>
</operation>
</file>

<!-- Spanish language -->
<file name="$languagedir/Modifications.spanish.php" error="ignore">
<operation>
<search position="end" />
<add><![CDATA[
//Begin DC SMF Search Text Strings
$txt['specific_topic_id'] = 'ID específico del tema';
$txt['search_match_mode'] = 'Tipo de coincidencia';
$txt['search_match_mode_whole'] = 'Sólo palabras completas - menos resultados, pero más precisos';
$txt['search_match_mode_smart'] = 'Búsqueda inteligente - método equilibrado';
$txt['search_match_mode_any'] = 'Todas las coincidencias - más resultados, pero menos precisos';

$txt['search_numReplies'] = 'Respuestas';
$txt['search_match_mode_whole_short'] = 'Palabras completas';
$txt['search_match_mode_smart_short'] = 'Búsqueda inteligente';
$txt['search_match_mode_any_short'] = 'Todas las coincidencias';

$txt['result_summary'] = 'Mostrar/ocultar resumen de resultados';

$txt['result_generated'] = 'Los resultados se generaron usando ';
$txt['zillarank'] = 'ZillaRank';

$txt['search_entireforum'] = 'Todos los foros';
$txt['search_thisbrd'] = 'Este foro';
$txt['search_thistopic'] = 'Este tema';
$txt['search_members'] = 'Usuarios';
$txt['search_entiresite'] = 'Toda la web';

$txt['search_view_all'] = 'Ver todos';
$txt['search_match_criteria'] = 'mensajes en este tema que coincidan con el criterio de búsqueda';

$txt['search_go_to_top'] = 'Ir arriba';
$txt['search_go_to_top_single'] = 'Arriba';
//END DC SMF Search Text Strings
]]></add>
</operation>
</file>

Advertisement: