2009-08-25 12:16:42 +00:00
|
|
|
|
<?php
|
|
|
|
|
/**
|
|
|
|
|
**************************************************************************************************
|
|
|
|
|
This Source File Is Written For ClipBucket, Please Read its End User License First and Agree its
|
2010-03-16 18:56:41 +00:00
|
|
|
|
Terms of use at http://www.opensource.org/licenses/attribution.php
|
2009-08-25 12:16:42 +00:00
|
|
|
|
**************************************************************************************************
|
|
|
|
|
Copyright (c) 2007-2008 Clip-Bucket.com. All rights reserved.
|
|
|
|
|
**************************************************************************************************
|
|
|
|
|
**/
|
|
|
|
|
|
|
|
|
|
// We Can Set SEO urls or Simple Urls by selecting following options, by selecting YES , make sure that all ReWrites are defined in .httaccess
|
|
|
|
|
|
|
|
|
|
$seo_urls = @SEO; // yes/no
|
2012-03-17 12:50:07 +00:00
|
|
|
|
function SEO( $text, $slash=false,$iconv=true ) {
|
2011-05-21 13:43:41 +00:00
|
|
|
|
|
2012-03-17 12:50:07 +00:00
|
|
|
|
|
2011-10-18 11:47:29 +00:00
|
|
|
|
|
|
|
|
|
//This is the MOOOOOOOOOOST BEATUIFUL PART OF SEO URL
|
2012-03-17 12:50:07 +00:00
|
|
|
|
if($iconv)
|
2011-10-18 11:47:29 +00:00
|
|
|
|
$text = iconv("UTF-8", "ISO-8859-1//TRANSLIT", $text);
|
|
|
|
|
|
2011-05-21 13:43:41 +00:00
|
|
|
|
$text = preg_replace('/ \&\#?[(0-9a-zA-Z){4}]+\;/','',$text);
|
2012-04-10 14:06:23 +00:00
|
|
|
|
$entities_match = array('"','!','@','#','%','^','&','*','_','(',')','+','{','}','|',':','"','<','>','?','[',']','\\',';','"',',','.','/','*','+','~','`','=',"'","’");
|
2012-03-17 12:50:07 +00:00
|
|
|
|
$new_props = array('£','¥','|','§','«','¬','¯','º','±','ª',',','µ','»','¼','½','¿','À','Á','Â','Ã','Ä','Å','Æ','Ç','È','É','Ê','Ë','Ì','Í','Î','Ï','Ð','Ñ','Ò','Ó','Ô','Õ','Ö','Ø','Ù','Ú','Û','Ü','Ý','Þ','ß','à ','á','â','ã','ä','å','æ','ç ','è','é','ê','ë','ì','í','î','ï','ð','ñ','ò','ó','ô','õ','ö','÷','ø','ù','ú','û','ü','ý','þ','ÿ','%E9');
|
2012-04-10 14:06:23 +00:00
|
|
|
|
$new_replace = array('','','','','','','','','','','','u','','','','','A','A','A','A','A','A','E','C','E','E','E','E','I','I','I','I','D','N','O','O','O','O','O','O','U','U ','U','U','Y','b','B','a','a','a','a','a','a','a','c ','e','e','e','e','i','í','i','i','o','n','o','o','o','o','o','','','u','u','u','u','y','p','y','e');
|
|
|
|
|
$entities_replace = array('','','','','','','','','','','','','','','','','','','','','','','','','');
|
2009-08-25 12:16:42 +00:00
|
|
|
|
$clean_text = str_replace($entities_match, $entities_replace, $text);
|
2011-10-18 11:47:29 +00:00
|
|
|
|
$clean_text = str_replace($new_props, $new_replace, $clean_text);
|
2011-05-21 13:43:41 +00:00
|
|
|
|
$clean_text = trim($clean_text);
|
|
|
|
|
$clean_text = preg_replace('/ /','-',$clean_text);
|
2009-08-25 12:16:42 +00:00
|
|
|
|
if ( $clean_text != '' )
|
|
|
|
|
$slash = ( $slash ) ? '/' : NULL;
|
2011-04-06 13:53:39 +00:00
|
|
|
|
|
2011-05-21 13:43:41 +00:00
|
|
|
|
|
2011-05-23 07:04:27 +00:00
|
|
|
|
$clean_text = preg_replace('/\-{2,10}/','-',$clean_text);
|
2011-05-21 13:43:41 +00:00
|
|
|
|
|
2009-08-25 12:16:42 +00:00
|
|
|
|
return $slash . $clean_text;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if($seo_urls == 'yes'){
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@define(compose_msg_link,'/message/compose');
|
|
|
|
|
@define(login_success,'/login/success');
|
|
|
|
|
@define(logout_success,'/logout/success');
|
|
|
|
|
@define(signup_success,'/signup/success');
|
|
|
|
|
@define(signup_link,'/signup.php');
|
|
|
|
|
@define(myaccount_link,'/myaccount');
|
|
|
|
|
@define(videos_link,'/videos');
|
|
|
|
|
@define(view_group_link,'/group/view/');
|
|
|
|
|
@define(user_account_link,'/manage/account');
|
|
|
|
|
@define(search_result,'/search/result');
|
|
|
|
|
//@define(edit_group_link,'/manage/group/edit/');
|
|
|
|
|
@define(edit_group_link,'/edit_group.php?url=');
|
|
|
|
|
@define(admin_link,'/admin_area/');
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}else{
|
|
|
|
|
|
|
|
|
|
@define(compose_msg_link,'/compose.php');
|
|
|
|
|
@define(login_success,'/login_success.php');
|
|
|
|
|
@define(logout_success,'/logout_success.php');
|
|
|
|
|
@define(signup_success,'/signup_success.php');
|
|
|
|
|
@define(signup_link,'/signup.php');
|
|
|
|
|
@define(myaccount_link,'/myaccount.php');
|
|
|
|
|
@define(videos_link,'/videos.php');
|
|
|
|
|
@define(view_group_link,'/view_group.php?url=');
|
|
|
|
|
@define(user_account_link,'/user_account.php');
|
|
|
|
|
@define(search_result,'/search_result.php');
|
|
|
|
|
@define(edit_group_link,'/edit_group.php?url=');
|
|
|
|
|
@define(admin_link,'/admin_area/');
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
?>
|