ho aumentato il tempo del php.ini da 30 a 60, ma il risultato è lo stesso. se la parola ricercata è nelle prime posizioni ok, altrimenti va in timeout!
se invece non lo trova e non so per quale motivo e in quale caso mi restituisce il messaggio:
----------------------------------------
Errore
La tua ricerca non ha prodotto risultati.
Indietro
---------------------------------------
che non è altro che la parte di codice che viene dopo la riga che chiama la funzione:
Codice PHP:
$sql = "SELECT COUNT(a.post_id) AS num_posts
FROM " . POST_TBL . " a
WHERE a.subject like '%".$keyword."%' OR a.message like '%".$keyword."%'" ;
if ( !($result = $db->sql_query($sql)) )
{ $sql_error = $db->sql_error(); echo $sql_error['message']; }
$numrow= ( $row = $db->sql_fetchrow($result) ) ? intval($row['num_posts']) : 0;
$pagination = pagelink("search&keyword=".$keyword, $pageno, $bloglimit, $numrow);
$sql = "SELECT ".CAT_TBL.".cat_desc, ".POST_TBL.".cat_id, ".CAT_TBL.".cat_id, ".POST_TBL.".post_id, ".POST_TBL.".subject,".POST_TBL.".message, ".USER_TBL.".user, ".POST_TBL.".timestamp, ".USER_TBL.".id, ".POST_TBL.".user_id FROM ".POST_TBL.", ".USER_TBL.", ".CAT_TBL."
WHERE ".POST_TBL.".user_id=".USER_TBL.".id AND ".CAT_TBL.".cat_id=".POST_TBL.".cat_id AND ( $searchlogic )
Order by ".POST_TBL.".post_id DESC
LIMIT $pageno, $bloglimit";
//".POST_TBL.".subject like '%".$keyword."%' OR ".POST_TBL.".message like '%".$keyword."%'
if( !($result = $db->sql_query($sql)) )
{
$sql_error = $db->sql_error();
echo $sql_error['message'];
}
$result = $db->sql_query($sql) ;
if( $db->sql_numrows($result)==0 ) {
error($lang['Error'],$lang['Search_Error']);
}
$template->assign_block_vars('search', array(
'KEYWORD' => $lang['Search_Results']." : [b]".$keyword."[/b]",
));
while ($row = $db->sql_fetchrow($result)) {
$message=$row['message'];
//$message=viewsmile($message);
$message=viewbbcode($message);
$message=viewlink($message);
$message=autolink($message);
$message = nl2br($message);
//$keywords = explode(" ", str_replace(array("+","-","*","~","\"","(",")","<",">","\\"),"",$keyword));
$message = highlight($message,$keywords);
$subject = highlight($row['subject'],$keywords);
$message = chop_text($message, 500, 10)."
....<a class=\"std\" href=\"".$_SERVER['PHP_SELF']."?mode=viewid&post_id=".$row['post_id']."\">Continue</a>";
/// Query for No of Comments //
$querycomment = "SELECT comment_id FROM ".COMMENT_TBL."
WHERE ".COMMENT_TBL.".post_id = ".$row['post_id'];
if ( !($commentresult = $db->sql_query($querycomment)) )
{
$sql_error = $db->sql_error();
echo $sql_error['message'];
}
Non è possibile limitare la ricerca impostando un numero di caratteri della stringa e con un off set adeguato?? pareri a riguardo??