ClipShare Community Forums  

Go Back   ClipShare Community Forums > ClipShare PRO - Version 4 > Pre-Sales Questions
Register FAQ Bug Tracker Members List Calendar Mark Forums Read

Pre-Sales Questions If you have any pre-sales questions, here's the place to ask.


Reply
 
Thread Tools Display Modes
Old 09-29-2010, 07:55 PM   #1
Mujaheed
Member
|Forum Newbie|
 
Join Date: Jun 2008
Posts: 42
Mujaheed is on a distinguished road
Default SEO URL replacement? How to do?

Hi everybody.
I wanna do something with cs's url structure. I want to replace "ş" to "s"
I edited function.php and "function clean_seo_text( $text, $slash=true ) {" in it.
Code:
function clean_seo_text( $text, $slash=true ) {
	$entities_match		= array(' ','--','&quot;','!','@','#','%','^','&','*','_','(',')','+','{','}','|',':','"','<','>','?','[',']','\\',';',"'",',','.','/','*','+','~','`','=','ş','ı','ğ','ü','ç','Ş','İ','Ğ','Ü','Ç');
	$entities_replace   = array('-','-','','','','','','','','','','','','','','','','','','','','','','','','','s','i','g','u','c','s','i','g','u','c');
It's like that, but still this turkish characters in URLs. I don't want turkish special chars in URL. How can i do that exactly?
Please help.
Thanks.

Last edited by Mujaheed : 09-29-2010 at 07:57 PM.
Mujaheed is offline   Reply With Quote
Old 11-07-2010, 01:20 AM   #2
cesario
Member
|Forum Newbie|
 
Join Date: Nov 2010
Posts: 1
cesario is on a distinguished road
Default

Hello,

I have the same problems.
Maybe some one have solution ?

Thanks.
cesario is offline   Reply With Quote
Old 05-22-2011, 04:21 AM   #3
ckarea
Verified Member
|Forum Newbie|
 
Join Date: Mar 2009
Posts: 22
ckarea is on a distinguished road
Default

you should use PsPad to edit with utf-8 code
ckarea is offline   Reply With Quote
Old 03-01-2012, 10:14 AM   #4
playbek.com
Member
|Forum Newbie|
 
Join Date: Feb 2012
Location: turkey / istanbul
Posts: 45
playbek.com is on a distinguished road
Default

hey bana da yardım edin bendede aynı sorun var ben video url de türkçe karakter istemiyorum
playbek.com is offline   Reply With Quote
Old 03-12-2012, 02:21 PM   #5
playbek.com
Member
|Forum Newbie|
 
Join Date: Feb 2012
Location: turkey / istanbul
Posts: 45
playbek.com is on a distinguished road
Default

I have the same problem mine does not help anyone cause I want to remove these characters from video url.
playbek.com is offline   Reply With Quote
Old 03-13-2012, 02:13 PM   #6
fornit
Member
|Forum Senior|
 
Join Date: May 2007
Posts: 450
fornit is on a distinguished road
Default

Hi,

I do it as follows:

PHP Code:
function clean_seo_text$s$slash=true 
{
    
// Strip htmlspecialchars
    
$s htmlspecialchars_decode($sENT_QUOTES);

    
// German special chars handling
    
$aSrch = array(    
        
"\xC3\x96",
        
"\xC3\xB6",
        
"\xC3\x84",
        
"\xC3\xA4",
        
"\xC3\x9C",
        
"\xC3\xBC",
        
"\xC3\x9F"
    
);

    
$aRpl = array(     
        
"\x6F\x65",
        
"\x6F\x65",
        
"\x61\x65",
        
"\x61\x65",
        
"\x75\x65",
        
"\x75\x65",
        
"\x73\x73"
    
);

    
$s str_replace($aSrch$aRpl$s);

    
// Remove all unwanted characters
    
$s preg_replace('/[^a-z0-9_\.\~]/isu'' '$s);

    
// Remove groups of whitespaces
    
$s trim(preg_replace("/\s+/isu"' '$s));

    
// Replace whitespaces ba dashes, set lower letters
    
$s strtolower(str_replace(' ''-'$s));

    return (
$slash '/' '') . $s;

Please note: The special char replacement is for german characters - if you want to do that for turkish characters then change that. You find unicode hex tables all over the internet.

Regards
fornit is offline   Reply With Quote
Old 03-14-2012, 10:08 AM   #7
firionicable
Verified Member
|Forum Newbie|
 
Join Date: Mar 2012
Posts: 24
firionicable is on a distinguished road
Default

Does anyone tried fornit codes and see if it works? It still doesn't work completely on my end. Please help.
firionicable is offline   Reply With Quote
Old 03-14-2012, 11:59 AM   #8
playbek.com
Member
|Forum Newbie|
 
Join Date: Feb 2012
Location: turkey / istanbul
Posts: 45
playbek.com is on a distinguished road
Default

Nothing changed in the same issue that you've added code continues?
playbek.com is offline   Reply With Quote
Old 03-15-2012, 11:57 AM   #9
fornit
Member
|Forum Senior|
 
Join Date: May 2007
Posts: 450
fornit is on a distinguished road
Default

Hm,

I've debugged it - the change needs to be done a bit different.

Clipshare makes use of the Smarty plugin "seourl" to build its seo urls and that's the function which has to be changed.

So, I suggest to do that as follows.

Open the file include/smarty/libs/plugins/function.seourl.php

Replace the code by the following:

PHP Code:
function smarty_function_seourl($params, &$smarty)
{
    global 
$config;
    
$seo_url    $params['rewrite'];
    
$normal_url    $params['url'];
    
$seo_clean    = ( isset($params['clean']) ) ? $params['clean'] : NULL;
    
$base_url    $config['BASE_URL'];

    if ( 
$config['seo_urls'] == '1' ) {
        if ( 
$seo_clean ) {
            
$seo_clean htmlspecialchars_decode($seo_cleanENT_QUOTES);

            
// German special chars handling
            
$aSrch = array(    
                
"\xC3\x96",
                
"\xC3\xB6",
                
"\xC3\x84",
                
"\xC3\xA4",
                
"\xC3\x9C",
                
"\xC3\xBC",
                
"\xC3\x9F"
            
);
        
            
$aRpl = array(     
                
"\x6F\x65",
                
"\x6F\x65",
                
"\x61\x65",
                
"\x61\x65",
                
"\x75\x65",
                
"\x75\x65",
                
"\x73\x73"
            
);
        
            
$seo_clean str_replace($aSrch$aRpl$seo_clean);
        
            
// Remove all unwanted characters
            
$seo_clean preg_replace('/[^a-z0-9_\.\~]/isu'' '$seo_clean);
        
            
// Remove groups of whitespaces
            
$seo_clean trim(preg_replace("/\s+/isu"' '$seo_clean));
        
            
// Replace whitespaces ba dashes, set lower letters
            
$seo_clean strtolower(str_replace(' ''-'$seo_clean));

            if ( 
$seo_clean != '' )
                
$seo_clean        '/' .$seo_clean;
        }
        
        return 
$base_url'/' .$seo_url.$seo_clean;
    }
    
    return 
$base_url'/' .$normal_url;

Hope that helps.

Regards
fornit is offline   Reply With Quote
Old 03-16-2012, 05:25 AM   #10
playbek.com
Member
|Forum Newbie|
 
Join Date: Feb 2012
Location: turkey / istanbul
Posts: 45
playbek.com is on a distinguished road
Default

no, no: I do not want to destroy a simple method that has already been. I want to convert. Turkish has a multi-clip-share video website I want it to be converted into other kinds of characters has no meaning. What is important is the full name of the video goes
playbek.com is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
How to embed replacement player Jackablade General Discussion 0 04-10-2009 12:09 AM
IPN Paypal replacement mentaldave Freelance Services 0 04-27-2007 06:32 PM



All times are GMT +1. The time now is 06:59 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Copyright © 2006-2008 Envient. All Rights Reserved.

An Envient product.