News:

Join the Facebook Fan Page.

Main Menu

search

Started by oscar2001, January 14, 2005, 09:41:44 PM

Previous topic - Next topic

oscar2001

installed 1.01 and applied the search fix to stop sql error but still getting errors in my error log when a search is performed..

8: Undefined index: ID_FIRST_MSG
File: /home/worldcic/public_html/yabbse/Sources/Search.php
Line: 623

Had simular errors with smf1
Not a big deal as at least search is usuable after editing the search.php file..

Any help would be appreciated :)

[Unknown]

How about this for that whole area?

$relevance =
$weight['frequency'] * ($row['numMsg'] == 0 ? 0 : $row['numMsg'] / ($matchingTopics[$row['ID_TOPIC']]['numReplies'] + 1)) +
$weight['age'] * (!isset($row['ID_MSG']) || $row['ID_MSG'] === null || $row['lastMatch'] < $minMsg ? 0 : ($row['lastMatch'] - $minMsg) / $recentMsg) +
$weight['length'] * ($matchingTopics[$row['ID_TOPIC']]['numReplies'] < $humungousTopicPosts ? $matchingTopics[$row['ID_TOPIC']]['numReplies'] / $humungousTopicPosts : 1) +
$weight['subject'] * $matchingTopics[$row['ID_TOPIC']]['is_subject'] +
$weight['first_message'] * (!empty($matchingTopics[$row['ID_TOPIC']]['ID_FIRST_MSG']) && $row['firstMatch'] == $matchingTopics[$row['ID_TOPIC']]['ID_FIRST_MSG'] ? 1 : 0);
$ID_MSG = $row['numMsg'] == 0 ? (empty($matchingTopics[$row['ID_TOPIC']]['ID_FIRST_MSG']) ? $row['firstMatch'] : $matchingTopics[$row['ID_TOPIC']]['ID_FIRST_MSG']) : $row['lastMatch'];
$sort[$ID_MSG] = $search_params['sort'] == 'relevance' ? $relevance : ($search_params['sort'] == 'numReplies' ? $matchingTopics[$row['ID_TOPIC']]['numReplies'] : $ID_MSG);
$tmp[$ID_MSG] = '(' . (int) $modSettings['search_pointer'] . ', ' . (int) $row['ID_TOPIC'] . ', ' . (int) $relevance . ', ' . (int) $ID_MSG . ', ' . (int) $row['numMsg'] . '),';


-[Unknown]

oscar2001

#2
Sorry no go..

I done several different word searches and most result in this error again
Database Error: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near ' (20, 8148, 22, 78441, 5),, (20, 8037, 5, 78378, 2),, (20, 8122
File: /home/worldcic/public_html/yabbse/Sources/Search.php
Line: 643


However some words do work (not many) but the error log spits outs multible pages of errors like this
8: Undefined index: ID_FIRST_MSG
File: /home/worldcic/public_html/yabbse/Sources/Search.php
Line: 623

8: Undefined index: 1474
File: /home/worldcic/public_html/yabbse/Sources/Search.php
Line: 626

8: Undefined index: ID_FIRST_MSG
File: /home/worldcic/public_html/yabbse/Sources/Search.php
Line: 623



Also anything thats found will display once only and if the same word is searched again it says there are no matches found but shows the page numbers of the first search just no search results.

Compuart

#3
I think replacing (Search.php):
$request = db_query("
SELECT m.ID_TOPIC AS ID_TOPIC, m.ID_MSG, t.numReplies, 1 AS is_subject


by:
$request = db_query("
SELECT m.ID_TOPIC AS ID_TOPIC, t.ID_FIRST_MSG, t.numReplies, 1 AS is_subject


should do the trick.
Hendrik Jan Visser
Former Lead Developer & Co-founder www.simplemachines.org
Personal Signature:
Realitynet.nl -> ExpeditieRobinson.net / PekingExpress.org / WieIsDeMol.Com

oscar2001

Quote from: Compuart on January 18, 2005, 07:46:48 AM
I think replacing (Search.php):
$request = db_query("
SELECT m.ID_TOPIC AS ID_TOPIC, m.ID_MSG, t.numReplies, 1 AS is_subject


by:
$request = db_query("
SELECT m.ID_TOPIC AS ID_TOPIC, t.ID_FIRST_MSG, t.numReplies, 1 AS is_subject


should do the trick.

Bonza :)

That done the trick,,
No error are being logged at all now with search..

Thank you very much :)

[Unknown]

Shows what I know :P.

-[Unknown]

edi67

#6
..help me i upgraded forum to smf 1.0.3 and i have again the errors:

edi67   Oggi alle 12:49:57 
207.248.240.118     310d2aed8b2539e1b3b468e240cd9c0d 
http://www.forumzoneru.25.com1.ru/index.php?action=search2 
8: Undefined index: 119294
File: /home/forumzo7/public_html/Sources/Search.php
Linea: 626

   edi67   Oggi alle 12:49:57 
207.248.240.118     310d2aed8b2539e1b3b468e240cd9c0d 
http://www.forumzoneru.25.com1.ru/index.php?action=search2 
8: Undefined index: 97052
File: /home/forumzo7/public_html/Sources/Search.php
Linea: 626

   edi67   Oggi alle 12:49:57 
207.248.240.118     310d2aed8b2539e1b3b468e240cd9c0d 
http://www.forumzoneru.25.com1.ru/index.php?action=search2 
8: Undefined index: 109226
File: /home/forumzo7/public_html/Sources/Search.php
Linea: 626

   edi67   Oggi alle 12:49:57 
207.248.240.118     310d2aed8b2539e1b3b468e240cd9c0d 
http://www.forumzoneru.25.com1.ru/index.php?action=search2 
8: Undefined index: 37886
File: /home/forumzo7/public_html/Sources/Search.php
Linea: 626


this is line 626 in Search.php:
$tmp[$ID_MSG] .= "($modSettings[search_pointer], $row[ID_TOPIC], $relevance, $ID_MSG, $row[numMsg])";

i tryed this method:


and worked with version smf 1.0.1 but now no... a lot of errors in log erros.
CrazyZone - My SMF Forum


From the difficult the hardening of the man you can see

Compuart

Overwrite Search.php by the 1.0.3 (or 1.0.4 doesn't really matter) version of Search.
Hendrik Jan Visser
Former Lead Developer & Co-founder www.simplemachines.org
Personal Signature:
Realitynet.nl -> ExpeditieRobinson.net / PekingExpress.org / WieIsDeMol.Com

edi67

Quote from: Compuart on June 17, 2005, 06:37:29 AM
Overwrite Search.php by the 1.0.3 (or 1.0.4 doesn't really matter) version of Search.

ok i will try thanx for anwer me i will let you know about
CrazyZone - My SMF Forum


From the difficult the hardening of the man you can see

edi67

thaNX Compuart seems that work  :D
CrazyZone - My SMF Forum


From the difficult the hardening of the man you can see

Advertisement: