function cleanmytext($text)
{
$text = preg_replace("/[^a-zA-Z0-9_-\s]/", "", $text);
$text = str_replace(" ", "-", $text);
$text = preg_replace("/([\s\s]+|[--]+)/", "-", $text);
return $text;
}
$text = preg_replace("/[^a-zA-Z0-9_-\s]/", "", $text);
function cleanmytext($text)
{
$text = str_replace("Ą", "a", $text);
$text = str_replace("ć", "c", $text);
$text = str_replace("ę", "e", $text);
$text = str_replace("ł", "l", $text);
$text = str_replace("ń", "n", $text);
$text = str_replace("Ó", "o", $text);
$text = str_replace("ś", "s", $text);
$text = str_replace("ź", "z", $text);
$text = str_replace("ż", "z", $text);
$text = str_replace(" ", "-", $text);
$text = preg_replace("/([\s\s]+|[--]+)/", "-", $text);
return $text;
}
Quote
Veggie wrote:
One link is cutted and it looks like: "download-category-1-dragon_ball.html" instead of: "http://example.com/Download-Category-1-Dragon-Ball.html". I don't know why the site name is cutted and big letters are replaced to small one. Please, help :o
Quote
mertozakkas wrote:
Try this for Seo Func;
Note: Turkish character problem was resolved
[syntaxhighlighter brush=php,first-line=1,highlight=0,collapse=false,html-script=false]
function seo($str, $replace=array(), $delimiter='-'){
setlocale(LC_ALL, 'tr_TR.windows-1254');
if( !empty($replace) ) {
$str = str_replace((array)$replace, ' ', $str);
}else{
$trArr = array('ç','Ç','i','I','s','S','g','G','ö','Ö','ü', 'Ü');
$toArr = array('c','c','i','I','s','s','g','g','o','o','u', 'u');
$str = str_replace($trArr,$toArr,$str);
}
$clean = iconv('windows-1254', 'ASCII//TRANSLIT', $str);
$clean = preg_replace("/[^a-zA-Z0-9\/_|+ -]/", '', $clean);
$clean = preg_replace("/[\/_|+ -]+/", $delimiter, $clean);
return $clean;
}[/syntaxhighlighter]
www.mertozakkas.com
Quote
pemaxs wrote:Quote
mertozakkas wrote:
Try this for Seo Func;
Note: Turkish character problem was resolved
[syntaxhighlighter brush=php,first-line=1,highlight=0,collapse=false,html-script=false]
function seo($str, $replace=array(), $delimiter='-'){
setlocale(LC_ALL, 'tr_TR.windows-1254');
if( !empty($replace) ) {
$str = str_replace((array)$replace, ' ', $str);
}else{
$trArr = array('ç','Ç','i','I','s','S','g','G','ö','Ö','ü', 'Ü');
$toArr = array('c','c','i','I','s','s','g','g','o','o','u', 'u');
$str = str_replace($trArr,$toArr,$str);
}
$clean = iconv('windows-1254', 'ASCII//TRANSLIT', $str);
$clean = preg_replace("/[^a-zA-Z0-9\/_|+ -]/", '', $clean);
$clean = preg_replace("/[\/_|+ -]+/", $delimiter, $clean);
return $clean;
}[/syntaxhighlighter]
www.mertozakkas.com
ankur Which file to add the code ?
Quote
Ankur wrote:Quote
Veggie wrote:
One link is cutted and it looks like: "download-category-1-dragon_ball.html" instead of: "http://example.com/Download-Category-1-Dragon-Ball.html". I don't know why the site name is cutted and big letters are replaced to small one. Please, help :o
Check if you have changed the Code for Download Cats in infusions/seo_friendly_urls_panel/includes/seo_functions.php.
Also, which Link are you talking about ? A Core Download Link or a Custom Link added in the website by you ?
/*-------------------+
| DOWNLOADS CATS |
+-------------------*/
function replace_downloads_cats($matches)
{
global $data_cache;
$replace = "'".$matches[1]."Download-Category-".$matches[2]."-".cleanmytext($data_cache['downloads_cats'][$matches[2]]).URL_POSTFIX."'";
return $replace;
}
Quote
Veggie wrote:
I'm talking about core download link: "http://example.com/downloads.php?cat_id=$1". It is replaced to "http://example.com/Download-Category-1-name.html" But when I add special letters the link looks like: "download-category-1-name.html" and domain name is cutted, so I can't open this link.
Quote
Ankur wrote:Quote
Veggie wrote:
I'm talking about core download link: "http://example.com/downloads.php?cat_id=$1". It is replaced to "http://example.com/Download-Category-1-name.html" But when I add special letters the link looks like: "download-category-1-name.html" and domain name is cutted, so I can't open this link.
Actually, URL must contain only allowed characters and the special characters must be encoded before posting.
See more at: http://www.blooberry.com/indexdot/htm...coding.htm
So I think you may try to use the urlencode function to replace it...
function cleanmytext($string){
$string = strtr($string, 'ĘęÓ󥹌śŁłŹźŻżĆćŃń', 'EeOoAaSsLlZzZzCcNn');
$string = strtr($string, 'ˇ¦¬±¶Ľ','ASZasz');
$string = preg_replace("'[[:punct:][:space:]]'",'-',$string);
$string = strtolower($string);
$znaki = '-';
$powtorzen = 1;
$string = preg_replace_callback('#(['.$znaki.'])\1{'.$powtorzen.',}#', create_function('$a', 'return substr($a[0], 0,'.$powtorzen.');'), $string);
return $string;
}
Not Found
The requested URL /Profile.html was not found on this server.
Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.
echo "<td align='center' rowspan='2'><input type='submit' name='login' value='' class='zaloguj'/></td>\n";
echo "<input type='submit' name='login' value='".$locale['global_104']."' class='button' /><br />\n";
Not Found
The requested URL /infusions/shoutbox_panel/Shoutbox_archive.php was not found on this server.
Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.
Quote
Veggie wrote:
I used this function:Code Download sourcefunction cleanmytext($string){
$string = strtr($string, 'ĘęÓ󥹌śŁłŹźŻżĆćŃń', 'EeOoAaSsLlZzZzCcNn');
$string = strtr($string, 'ˇ¦¬±¶Ľ','ASZasz');
$string = preg_replace("'[[:punct:][:space:]]'",'-',$string);
$string = strtolower($string);
$znaki = '-';
$powtorzen = 1;
$string = preg_replace_callback('#(['.$znaki.'])\1{'.$powtorzen.',}#', create_function('$a', 'return substr($a[0], 0,'.$powtorzen.');'), $string);
return $string;
}
and it's working fine! :) I have another problem. When I'm on someone's profile or group page for example: "http://example.com/Profil-4-Name.html" or "http://example.com/Group-1-Name.html" and I try to login, I get this error:Code Download sourceNot Found
The requested URL /Profile.html was not found on this server.
Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.
I'm using a login panel added on the website by me. The file login.php is in the theme folder. The code to login button from login.php looks like:Code Download sourceecho "<td align='center' rowspan='2'><input type='submit' name='login' value='' class='zaloguj'/></td>\n";
and this is code from infusions/user_info_panel/user_info_panel.phpCode Download sourceecho "<input type='submit' name='login' value='".$locale['global_104']."' class='button' /><br />\n";
so they're almost identical and I don't know why I get the error ;/
Also when I'm on the page with infusion for example: "http://example.com/infusions/shoutbox_panel/Shoutbox_archive.html" and I try to login, I get the same error:I think it's a bug in SEO-Fusion.Code Download sourceNot Found
The requested URL /infusions/shoutbox_panel/Shoutbox_archive.php was not found on this server.
Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.
function replace_normal_pages($matches)
{
$replace = "'".$matches[1].ucfirst($matches[2]).URL_POSTFIX."'";
return $replace;
}
function replace_normal_pages($matches)
{
$replace = "'".$matches[1].$matches[2].URL_POSTFIX."'";
return $replace;
}
Quote
Ankur wrote:
This doesn't happen with me at all. I tested it on both my Localhost and http://fusion8.co.cc/Profile-1-Ankur. It looks like your Apache is not rewriting the Links well as it should.
However, try to open its Lowercase URL, i.e, /infusions/shoutbox_panel/shoutbox_archive.html
If It works, then you should edit your \infusions\seo_friendly_urls_panel\includes\seo_functions.php and change this function :Code Download sourcefunction replace_normal_pages($matches)
{
$replace = "'".$matches[1].ucfirst($matches[2]).URL_POSTFIX."'";
return $replace;
}
to :Code Download sourcefunction replace_normal_pages($matches)
{
$replace = "'".$matches[1].$matches[2].URL_POSTFIX."'";
return $replace;
}
Quote
Veggie wrote:
But about the first one, I don't get the error when I login in user_info_panel. This problem concerns my login panel. I don't know why it happens, though that codes are identical.
Quote
Ankur wrote:
so you don't get the error ? then what happens when you login?
Not Found
The requested URL /Profile.html was not found on this server.
Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.
echo "<input type='submit' name='login' value='".$locale['global_104']."' class='button' /><br />\n";
echo "<td align='center' rowspan='2'><input type='submit' name='login' value='' class='zaloguj'/></td>\n";
$action_url = FUSION_SELF.(FUSION_QUERY ? "?".FUSION_QUERY : "");
if (isset($_GET['redirect']) && strstr($_GET['redirect'], "/")) {
$action_url = cleanurl(urldecode($_GET['redirect']));
}
openside($locale['global_100']);
echo "<div style='text-align:center'>\n";
echo "<form name='loginform' method='post' action='".$action_url."'>\n";
Quote
Veggie wrote:
Thank you! It's working :) I have some questions. I'm using mod FMC Download v1.08 and I want to replace this link: "http://example.com/downloads.php?cat_id=$1&info_id=$2" to: "http://example.com/Download-Category-1-category_name-File-1-file_name". Which codes should I put into seo_functions.php and .htaccess?
Would it be also possible to replace such links: "http://example/downloads.php?cat_id=$1&rowstart=$2" using SEO-Fusion? I also remarked, that links aren't replaced in "Jump to Forum":
Quote
pemaxs wrote:
Ankur, module will not load
[youtube]hVrbmwIJ2h4[/youtube]
$inf_adminpanel[1] = array(
"title" => $locale['inf_title'],
"image" => "seofusion.png",
"panel" => "seo_friendly_urls_panel_admin.php",
"rights" => "SEO"
);
if (!checkrights("SEO")||!defined("iAUTH")||$_GET['aid']!=iAUTH) { redirect("../index.php"); }
if (!checkrights("SE2")||!defined("iAUTH")||$_GET['aid']!=iAUTH) { redirect("../index.php"); }
Quote
Ankur wrote:
Sorry for the problems, but this will make the code more complex. Thus, I will fix it in the next version...
The Jump to Forum function is based on JS Function, which is not changed in the infusion...
Quote
Veggie wrote:Quote
Ankur wrote:
Sorry for the problems, but this will make the code more complex. Thus, I will fix it in the next version...
The Jump to Forum function is based on JS Function, which is not changed in the infusion...
Ok, but can you tell now how to replace this links?
"http://example.com/downloads.php?cat_id=$1&info_id=$2" and "http://example/downloads.php?cat_id=$1&rowstart=$2"
Quote
mertozakkas wrote:
Try this for Seo Func;
Note: Turkish character problem was resolved
[syntaxhighlighter brush=php,first-line=1,highlight=0,collapse=false,html-script=false]
function seo($str, $replace=array(), $delimiter='-'{
setlocale(LC_ALL, 'tr_TR.windows-1254';
if( !empty($replace) ) {
$str = str_replace((array)$replace, ' ', $str);
}else{
$trArr = array('ç','Ç','i','I','s','S','g','G','ö','Ö','ü', 'Ü';
$toArr = array('c','c','i','I','s','s','g','g','o','o','u', 'u';
$str = str_replace($trArr,$toArr,$str);
}
$clean = iconv('windows-1254', 'ASCII//TRANSLIT', $str);
$clean = preg_replace("/[^a-zA-Z0-9\/_|+ -]/", '', $clean);
$clean = preg_replace("/[\/_|+ -]+/", $delimiter, $clean);
return $clean;
}[/syntaxhighlighter]
www.mertozakkas.com
Quote
pemaxs wrote:
Turkish character error
Parse error: syntax error, unexpected '<', expecting ')' in /home/reksnet/public_html/infusions/seo_friendly_urls_panel/seo_friendly_urls_panel.php on line 52
is the routing page not found
http://www.reksnet.com/secure_question.php
orientation
http://www.reksnet.com/Secure_question.html
404 Not Found
The resource requested could not be found on this server!
Category Forum
Official releases [Infusions]Labels
None yet
Statistics
0 participants
Notifications
You are not receiving notifications from this thread.
Related Questions