Changeset 760 for trunk/Modules/Search


Ignore:
Timestamp:
Jan 22, 2014, 6:12:46 PM (11 years ago)
Author:
maron
Message:
  • Fixed: search with diacriticals
  • Modified: Not show items search when nothing was found
  • Added: bbcode in Forum.php
  • Added: search in forum
  • Added: Last post at forum in user profile
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Modules/Search/Search.php

    r636 r760  
    4343                else if(array_key_exists('text', $_POST)) $Search = $_POST['text'];
    4444                else $Search = '';
    45                 $SearchHTML = htmlentities($Search);
     45                $SearchHTML = urlencode($Search);
    4646               
    4747                $Output = '<table class="BaseTable"><tr><th>'.T('Section').'</th><th>'.T('Found count').'</th></tr>';
     
    5252                        {
    5353                          $ColumnQuery[] = '(`'.$Column.'` LIKE "%'.$Search.'%")';
    54                   }
     54                  } 
    5555                  $ColumnQuery = implode(' OR ', $ColumnQuery);
    5656                  if($SearchItem['Query'] != '')
    57                   {
     57                  {                      
    5858                    $DbResult = $this->Database->query('SELECT COUNT(*) FROM '.$SearchItem['Query'].' WHERE '.$ColumnQuery);
    5959                  $Line = $DbResult->fetch_row();
    6060                  $Line = $Line[0];
    6161                  } else $Line = '';
    62                 $Output .= '<tr><td><a href="'.$SearchItem['Link'].$SearchHTML.'">'.$SearchItem['Name'].'</a></td><td>'.$Line.'</td></tr>';
     62      if ($Line <> 0)
     63                  $Output .= '<tr><td><a href="'.$SearchItem['Link'].$SearchHTML.'">'.$SearchItem['Name'].'</a></td><td>'.$Line.'</td></tr>';
    6364                }
    6465 
Note: See TracChangeset for help on using the changeset viewer.