View Single Post
  #2 (permalink)  
Old 09-12-2008, 08:37 AM
ozlegolas's Avatar
ozlegolas ozlegolas is offline
Casual Pligger
 
Join Date: Apr 2008
Posts: 37
Thanks: 4
Thanked 6 Times in 4 Posts
Local Tag Problems

If you have tags contain special chars like "türkçe" you have to do these changes to get correct results when you click on a tag.

1)Change your files'(that will contain Turkish chars) encoding to UTF-8
2) Do the things in this thread.
2)in libs/tags.php line 123 find:
PHP Code:
$tag_url str_replace(" ""+"$tag_url); // Steef 2k7-07 tag search fix 
after above add this:
PHP Code:
//***************Safe Tag Hack by Tuna********************
                
$tag_url str_replace("ç""c"$tag_url);
                
$tag_url str_replace("ğ""g"$tag_url);
                
$tag_url str_replace("ı""i"$tag_url);
                
$tag_url str_replace("ö""o"$tag_url);
                
$tag_url str_replace("ş""s"$tag_url);
                
$tag_url str_replace("ü""u"$tag_url);
                
//******************************************************* 
3)in libs/link.php about 565. line find and replace this:
PHP Code:
if(isset($tag_array[$i])){
                        if ( 
$URLMethod == ) { 
                            
$tags_url_array[$i] = my_pligg_base "/search.php?search=".urlencode(trim($tag_array[$i]))."&tag=true";
                        } elseif ( 
$URLMethod == 2) {
                            
$tags_url_array[$i] = my_pligg_base "/tag/" urlencode(trim($tag_array[$i]));
                    }
                  } 
with this:
PHP Code:
if(isset($tag_array[$i])){
                    
                    
//***********Safe Tag Hack by Tuna********************************** 
                    
$replace_what = array("ç","ğ","ı","ö","ş","ü");
                    
$replace_with = array("c","g","i","o","s","u");
                    
$tag_arraySafestr_ireplace($replace_what,$replace_with,$tag_array);
                    
//******************************************************************** 
                        
if ( $URLMethod == ) { 
                            
$tags_url_array[$i] = my_pligg_base "/search.php?search=".urlencode(trim($tag_arraySafe[$i]))."&tag=true";
                        } elseif ( 
$URLMethod == 2) {
                            
$tags_url_array[$i] = my_pligg_base "/tag/" urlencode(trim($tag_arraySafe[$i]));
                    }
                  } 
4)in /search.php line 58 find and replace this:
PHP Code:
// breadcrumbs and page title
$navwhere['text1'] = $main_smarty->get_config_vars('PLIGG_Visual_Breadcrumb_Search') . stripslashes($search->searchTerm);
$navwhere['link1'] = getmyurl('search'urlencode($search->searchTerm));
$main_smarty->assign('navbar_where'$navwhere);
$main_smarty->assign('posttitle'" / " $main_smarty->get_config_vars('PLIGG_Visual_Breadcrumb_Search') . stripslashes($search->searchTerm)); 
with this:
PHP Code:
//*********************NAVBAR SAFE TAG NAME HACK BY TUNA************************************************************************
//***********************************************************************************************************************************
$tag_name=$db->get_var("SELECT tag_words FROM " table_tags " WHERE `tag_safe` = '".stripslashes($search->searchTerm)."';");
if(
$tag_name==''){
$tag_name=stripslashes($search->searchTerm);

// breadcrumbs and page title
if(isset($_REQUEST['tag'])){
    
$search_name=$tag_name;
    
$navwhere['text1'] = 'Etiket: ' $tag_name;
    
$main_smarty->assign('posttitle'" / " $main_smarty->get_config_vars('PLIGG_Visual_Breadcrumb_Search') . $tag_name);
    
$navwhere['link1'] = getmyurl('tag'urlencode($search->searchTerm));
    
// pagename    
    
define('pagename''tag'); 
}
else{
    
$search_name=stripslashes($search->searchTerm);
    
$navwhere['text1'] = $main_smarty->get_config_vars('PLIGG_Visual_Breadcrumb_Search') . stripslashes($search->searchTerm);
    
$main_smarty->assign('posttitle'" / " $main_smarty->get_config_vars('PLIGG_Visual_Breadcrumb_Search') . stripslashes($search->searchTerm));
    
$navwhere['link1'] = getmyurl('search'urlencode($search->searchTerm));
    
// pagename    
    
define('pagename''search'); 
    
}
    
$main_smarty->assign('pagename'pagename);

    
$main_smarty->assign('navbar_where'$navwhere);
//**********************************************************************************************************
//********************************************************************************************************** 
If any problem occurs or these changes don't solve your problem let me know
__________________
http://teknikim.com
Reply With Quote