wishcraft wishcraft
  • Module Developer
  • Module Developer
  • Joined: 2007/5/18 16:56
  • From Marrickville South, NSW, Australia
  • Group: Registered Users
  • Posts: 3652
  • Posted on: 2010/2/14 9:05
International Domain Names (IDN) & SEF #1
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
How to effectively post a question in the Xoops forums? - Read here...
Design by: XOOPS UI/UX Team