1
wishcraft
International Domain Names (IDN) & SEF

xoops_sef function

This is the xoops_sef function you will need to include this in your include/functions.php file to work with any of the examples. It is for converting part of unicode for domain names and any language text, you can replaces the score with an underscore for SQL LIKE Queries for one character wide cards.

RewriteRule ^content/(.*?)$ modules/content/index.php?title=$1


These parts of the regular expression for unicode character for example in the following url : http://www.yoursite.com/content/Your-Open-text-here/ you would use (.*?) in the rewrite htaccess script above with conjunction with a redirect - where the open database text is processed from the story title, hypothetically from user subscriptions.

if (!function_exists('xoops_sef')) {
    function 
xoops_sef($datab$char ='-')
    {
        
$replacement_chars = array( ' ''|''=''\''+''-''_''{''}'']''['''', '"', ';', 
                                    ':', '?', '>', '<', '.', ',', ')', '(', '*', '&', '^', '%', '$', '#', '@', 
                                    '!', '`', '~', ' ', '', '¡', '¦', '§', '¨', '©', 'ª', '«', '¬', '®', '­', 
                                    '¯', '°', '±', '²', '³', '´', 'µ', '¶', '·', '¸', '¹', 'º', '»', '¼', '½',
                                     '¾', '¿');
        
$return_data = (str_replace($replacement_chars,$char,$datab));
        #print 
$return_data."<BR><BR>";
        return(
$return_data);
    
    }
}


The XOOPS sef function for Search Engine Friendly URL which are URL that display in Unicode in Google and bing.. soon the address bar will display it as well.. some already do.

This was updated in the .htaccess tutorial on the wiki

Login

Username:
Password:

Lost Password? Register now!

Who's Online

57 user(s) are online (26 user(s) are browsing Support Forums)


Members: 0


Guests: 57


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: May 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits