/**
* Prepares results from search for display
*
* @param string The source string
* @param int Number of chars to trim
* @param string The searchword to select around
* @return string
*/
function prepareSearchContent( $text, $length = 200, $searchword )
{
// strips tags won't remove the actual jscript
$text = preg_replace( "'<script[^>]*>.*?</script>'si", "", $text );
$text = preg_replace( '/{.+?}/', '', $text);
//$text = preg_replace( '/<a\s+.*?href="([^"]+)"[^>]*>([^<]+)<\/a>/is','\2', $text );
// replace line breaking tags with whitespace
$text = preg_replace( "'<(br[^/>]*?/|hr[^/>]*?/|/(div|h[1-6]|li|p|td))>'si", ' ', $text );
return SearchHelper::_smartSubstr( strip_tags( $text ), $length, $searchword );
}
/**
* Checks an object for search terms (after stripping fields of HTML)
*
* @param object The object to check
* @param string Search words to check for
* @param array List of object variables to check against
* @returns boolean True if searchTerm is in object, false otherwise
*/
function checkNoHtml($object, $searchTerm, $fields) {
$searchRegex = array(
'#<script[^>]*>.*?</script>#si',
'#<style[^>]*>.*?</style>#si',
'#<!.*?(--|]])>#si',
'#<[^>]*>#i'
);
$terms = explode(' ', $searchTerm);
if(empty($fields)) return false;
foreach($fields AS $field) {
if(!isset($object->$field)) continue;
$text = $object->$field;
foreach($searchRegex As $regex) {
$text = preg_replace($regex, '', $text);
}
foreach($terms AS $term) {
if(JString::stristr($text, $term) !== false) {
return true;
}
}
}
return false;
}Ben buradaki kodlara ekleme yaparak aşağıdaki karakterlerin türkçe karşılıklarını ('ı','ş','ü','ç','ö','ğ','ş','Ç','i','ğ','Ş','Ö',' Ü','ı', 'ş', 'ç', 'ö', 'ğ', 'ş', 'Ç', 'i', 'ğ', 'Ş', 'Ö', 'Ü', 'ü', 'ğ') veritabanına işlemek istiyorum veya bu karakterlerin geçtiği kelimelerin veritabanına işlenmesini engellemek istiyorum'ı','Å?','ü','ç','ö','Ä?','ÅŸ','Ç','İ','ÄŸ' ,'Å?','Ö','Ü','ı','Å?','ç','ö','Ä?','ÅŸ','Ç' ,'İ','ÄŸ','Å?','Ö','Ü','ü','ÄŸ'Bu konuda yardımlarınızı bekliyorum.
teşekkürler