Let me add the letter ñ and Ñ
ñ ñ
Ñ Ñ
I have done this but does not work:
//Mod_bmollet bitissss
/**
* Get the category url
* @param int $cat_id The id of the category
* @param string $cat_url The current status of the URL
*/
function get_category_url($cat_id,$cat_url = '')
{
global $site_db;
$sql = "SELECT cat_name,cat_parent_id FROM ".CATEGORIES_TABLE." WHERE cat_id = '".$cat_id."'";
$result = $site_db->query($sql);
$row = $site_db->fetch_array($result);
$trans = array(","=>"","\\"=>"",";"=>"",":"=>"","/"=>"","İ"=>"i","ı"=>"i","ñ"=>"ñ","Ñ"=>"Ñ","ş"=>"s","ğ"=>"g","ö"=>"ö","Ö"=>"O","ü"=>"u","Ü"=>"U","ç"=>"c","Ç"=>"C","?"=>"");
$row['cat_name']=strtr($row['cat_name'],$trans);
$row['cat_name'] = strtr($row['cat_name'], "éèêàëâúóíáABCDEFGHIJKLMNÑOPQRSTUVWXYZsSiIÝIÇçöÖGgüÜýþÞðÐ","eeeaeauoiaabcdefghijklmnñopqrstuvwxyzssiiiiccoogguuissgg");
$cat_url = '-'.str_replace('+','-',urlencode($row['cat_name'])).'-'.$cat_id.$cat_url;
// if you want full path of category in url, put next line in comment
//return $cat_url;
if( $row['cat_parent_id'] != 0)
{
return get_category_url($row['cat_parent_id'],$cat_url);
}
else
{
return $cat_url;
}
}
//Mod_bmollet
/**
* Get the image url
* @param int $image_id The id of the image
*/
function get_image_url($image_id)
{
global $site_db;
$sql = "SELECT cat_id,image_name FROM ".IMAGES_TABLE." WHERE image_id = '".$image_id."'";
$result = $site_db->query($sql);
$row = $site_db->fetch_array($result);
$trans = array(","=>"","\\"=>"",";"=>"",":"=>"","/"=>"","İ"=>"i","ı"=>"i","ñ"=>"ñ","Ñ"=>"Ñ","ş"=>"s","ğ"=>"g","ö"=>"ö","Ö"=>"O","ü"=>"u","Ü"=>"U","ç"=>"c","Ç"=>"C","?"=>"");
$row['image_name']=strtr($row['image_name'],$trans);
$row['image_name'] = strtr($row['image_name'], "éèêàëâúóíáABCDEFGHIJKLMNÑOPQRSTUVWXYZsSiIÝIÇçöÖGgüÜýþÞðÐ","eeeaeauoiaabcdefghijklmnñopqrstuvwxyzssiiiiccoogguuissgg");
// if you want comlpete path to image in url, remove comment from following line
return get_category_url($row['cat_id']).'-'.str_replace('+','-',urlencode($row['image_name'])).'-'.$image_id;
return '-'.str_replace('+','-',urlencode($row['image_name'])).'-'.$image_id;
}