Changeset 596 for trunk


Ignore:
Timestamp:
Nov 22, 2013, 11:34:47 AM (11 years ago)
Author:
maron
Message:
  • Fixed: url in Dictionary.php to Form.php name starts with $b$b,< etc. now find too
Location:
trunk
Files:
2 edited

Legend:

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

    r593 r596  
    6767          $Output .= '<tr><td>'.$Line[2].'</td>';
    6868          if ($Line[3] <> '') $Output .= '<td><a target="_NEW2" href="'.$this->System->Link('/form.php?group='.$Line[1].'&amp;ID='.$Line[0]).'">'.$Line[3].'</a></td></tr>';
    69           else $Output .= '<td><a target="_NEW2" href="'.$this->System->Link('form.php?group='.$Line[1].'&amp;ID='.$Line[0]).'">Překládat</a></td></tr>';
     69          else $Output .= '<td><a target="_NEW2" href="'.$this->System->Link('/form.php?group='.$Line[1].'&amp;ID='.$Line[0]).'">Překládat</a></td></tr>';
    7070        }
    7171      } else
  • trunk/includes/global.php

    r594 r596  
    512512  'areatrigger_tavern' => 'Name',); */
    513513    $buff = array();
    514  
     514
     515    //change chars by we want to separate
     516    $Text = str_replace('$B$B',' ',$Text);
     517    $Text = str_replace('$b$b',' ',$Text);
     518    $Text = str_replace('$G',' ',$Text);
     519    $Text = str_replace('$I',' ',$Text);
     520    $Text = str_replace('$N',' ',$Text);
     521    $Text = str_replace('$R',' ',$Text);
     522    $Text = str_replace('$g',' ',$Text);
     523    $Text = str_replace('$i',' ',$Text);
     524    $Text = str_replace('$n',' ',$Text);
     525    $Text = str_replace('$r',' ',$Text);
     526    $Text = str_replace(':',' ',$Text);
     527    $Text = str_replace(';',' ',$Text);
     528    $Text = str_replace('!',' ',$Text);
     529    $Text = str_replace('?',' ',$Text);
     530    $Text = str_replace('.',' ',$Text);
     531    $Text = str_replace(',',' ',$Text);
     532    $Text = str_replace('\'s',' ',$Text);
     533    $Text = str_replace('<',' ',$Text);
     534    $Text = str_replace('>',' ',$Text);
     535    $ArrStr = explode(' ', $Text);
     536     
    515537  foreach($TablesColumn as $Table => $Column)
    516538  { 
     
    519541    $groupby = ' GROUP BY `'.$Column.'`';
    520542 
    521     $ArrStr = explode(' ', $Text);
     543
    522544    $where = '(`Language` = '.$Config['OriginalLanguage'].') ';
    523545    if ($mode == 1) $where .= ' AND EXISTS(SELECT 1 FROM `'.$Table.'` AS `Sub` WHERE (`Sub`.`Language` <> '.$Config['OriginalLanguage'].') AND (`Sub`.`Entry` = `O`.`Entry`))';
     
    529551      for($i = 0; $i < count($ArrStr); $i++)
    530552      {
    531         if (strpos($ArrStr[$i],"'s") > 0)
    532        $ArrStr[$i] = substr($ArrStr[$i],0,strlen($ArrStr[$i])-2);
    533         if (strpos($ArrStr[$i],',') > 0) $ArrStr[$i] = substr($ArrStr[$i],0,strlen($ArrStr[$i])-1);
    534         if (strpos($ArrStr[$i],'.') > 0) $ArrStr[$i] = substr($ArrStr[$i],0,strlen($ArrStr[$i])-1);
    535         if (strpos($ArrStr[$i],'!') > 0) $ArrStr[$i] = substr($ArrStr[$i],0,strlen($ArrStr[$i])-1);
    536         if (strpos($ArrStr[$i],'?') > 0) $ArrStr[$i] = substr($ArrStr[$i],0,strlen($ArrStr[$i])-1);
     553       // if (strpos($ArrStr[$i],"'s") > 0)     $ArrStr[$i] = substr($ArrStr[$i],0,strlen($ArrStr[$i])-2);
     554      //  if (strpos($ArrStr[$i],',') > 0) $ArrStr[$i] = substr($ArrStr[$i],0,strlen($ArrStr[$i])-1);
     555       // if (strpos($ArrStr[$i],'.') > 0) $ArrStr[$i] = substr($ArrStr[$i],0,strlen($ArrStr[$i])-1);
     556       // if (strpos($ArrStr[$i],'!') > 0) $ArrStr[$i] = substr($ArrStr[$i],0,strlen($ArrStr[$i])-1);
     557       // if (strpos($ArrStr[$i],'?') > 0) $ArrStr[$i] = substr($ArrStr[$i],0,strlen($ArrStr[$i])-1);
    537558
    538559        if (strlen($ArrStr[$i]) > 4) {
    539560          $where .= '(`O`.`'.$Column.'` LIKE "%'.addslashes($ArrStr[$i]).'%") OR ';
    540561          $SqlOK = true;
    541       }
     562        }
    542563      }
    543564      $where = substr($where, 0, strlen($where) - 4);
     
    550571          $buff[] = array($Line['ID'], GetIDbyName($Table), $Line[$Column], $Line['Tran']);
    551572        }
    552     }
     573      }
    553574    }
    554575  }
Note: See TracChangeset for help on using the changeset viewer.