Changeset 596 for trunk/includes/global.php
- Timestamp:
- Nov 22, 2013, 11:34:47 AM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/includes/global.php
r594 r596 512 512 'areatrigger_tavern' => 'Name',); */ 513 513 $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 515 537 foreach($TablesColumn as $Table => $Column) 516 538 { … … 519 541 $groupby = ' GROUP BY `'.$Column.'`'; 520 542 521 $ArrStr = explode(' ', $Text); 543 522 544 $where = '(`Language` = '.$Config['OriginalLanguage'].') '; 523 545 if ($mode == 1) $where .= ' AND EXISTS(SELECT 1 FROM `'.$Table.'` AS `Sub` WHERE (`Sub`.`Language` <> '.$Config['OriginalLanguage'].') AND (`Sub`.`Entry` = `O`.`Entry`))'; … … 529 551 for($i = 0; $i < count($ArrStr); $i++) 530 552 { 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); 537 558 538 559 if (strlen($ArrStr[$i]) > 4) { 539 560 $where .= '(`O`.`'.$Column.'` LIKE "%'.addslashes($ArrStr[$i]).'%") OR '; 540 561 $SqlOK = true; 541 }562 } 542 563 } 543 564 $where = substr($where, 0, strlen($where) - 4); … … 550 571 $buff[] = array($Line['ID'], GetIDbyName($Table), $Line[$Column], $Line['Tran']); 551 572 } 552 }573 } 553 574 } 554 575 }
Note:
See TracChangeset
for help on using the changeset viewer.