Advertisement:

Author Topic: bug with ads. Please help  (Read 1415 times)

didkap84

  • Full Member
  • ***
  • Posts: 195

teseo

  • Hero Member
  • *****
  • Posts: 6169
Re: bug with ads. Please help
« Reply #1 on: April 13, 2015, 09:20:38 pm »
Hi,

Couldn't find another way than modifying a core file. ??? Try this:

1.- Look in oc-includes/osclass/helpers/hDefines.php for:

Code: [Select]
$url = str_replace('{ITEM_TITLE}', osc_sanitizeString($item['s_title']), $url);
and replace it with:

Code: [Select]
$url = str_replace('{ITEM_TITLE}', osc_sanitizeString( cust_cyrillic_to_latin($item['s_title']) ), $url);

Now, being a core file, remember that you need to redo this modification every time you upgrade Osclass.

2.- Add this at the very bottom of your theme functions.php (take care not to leave blank lines after this):

Code: [Select]
<?php
function cust_cyrillic_to_latin($textcyr) {
    
$cyr  = array('а','б','в','г','д','e','ж','з','и','й','к','л','м','н','о','п','р','с','т','у',
        
'ф','х','ц','ч','ш','щ','ъ','ь''ю','я','А','Б','В','Г','Д','Е','Ж','З','И','Й','К','Л','М','Н','О','П','Р','С','Т','У',
        
'Ф','Х','Ц','Ч','Ш','Щ','Ъ','Ь''Ю','Я' );
    
$lat = array( 'a','b','v','g','d','e','zh','z','i','y','k','l','m','n','o','p','r','s','t','u',
        
'f' ,'h' ,'ts' ,'ch','sh' ,'sht' ,'a' ,'y' ,'yu' ,'ya','A','B','V','G','D','E','Zh',
        
'Z','I','Y','K','L','M','N','O','P','R','S','T','U',
        
'F' ,'H' ,'Ts' ,'Ch','Sh' ,'Sht' ,'A' ,'Y' ,'Yu' ,'Ya' );

    return 
str_replace($cyr$lat$textcyr); 
}
?>

Regards

Sophia_OS

  • Sr. Member
  • ****
  • Posts: 416
.
« Reply #2 on: September 23, 2017, 12:31:40 am »
.
« Last Edit: March 29, 2019, 06:01:11 pm by Sophia_OS »

officeland

  • Newbie
  • *
  • Posts: 15
Re: bug with ads. Please help
« Reply #3 on: March 29, 2019, 02:06:47 pm »
This worked great! in Osclass 3.8.

For the Greeks you should copy this is functions.php of your theme:
Code: [Select]
<?php
function cust_cyrillic_to_latin($textcyr) {
    
$cyr  = array('α','β','γ','δ','ε','ζ','η','θ','ι','κ','λ','μ','ν','ξ','ο','п','ρ','σ','τ','υ',
        
'φ','χ','ψ','ω','Α','Β','Γ','Δ','Ε','Ζ','Η','Θ','Ι','Κ','Λ','Μ','Ν','Ξ','Ο','Π','Ρ','Σ','Τ','Υ',
        
'Φ','Χ','Ψ','Ω','ί','ό','ώ','ά','ή','έ','€');
    
$lat = array( 'a','b','g','d','e','z','i','th','i','k','l','m','n','x','o','p','r','s','t','y',
        
'f' ,'x' ,'ps' ,'w','A','B','G','D','E','Z','I',
        
'TH','I','K','L','M','N','X','O','P','R','S','T','Y',
        
'F' ,'X' ,'Ps' ,'W' ,'i' ,'ο' ,'w''a''h''e''euro');

    return 
str_replace($cyr$lat$textcyr); 
}
?>



Can anyone help how do the same with Categories?
« Last Edit: March 29, 2019, 02:08:22 pm by officeland »