| Gökhan YILDIZ |
|
|---|---|
|
http://www.cotonti.com/docs/en/admin/url_modification?d=15 sayfasında verilen modifikasyonu başarılı bir şekilde uyguladım.Aynı şeyleri forum için yapmaya kalktım fakat forum kategorisinin üzerine gelince sadece site adini(http://www.siteadi.com olarak) gosteriyor.fakat elle http://www.siteadi.com/forum/ olarak girdiğimde herhangi bir problem yok.
Yaptığım uygulamada functions.php'ye ilk önce function degistir($text)
{
//$text = preg_replace("#&\#([0-9]*);#ie","_",$text);
$text = html_entity_decode($text);
$text = str_replace(" / ","_",$text);
$text = str_replace("'","",$text);
$text = str_replace("\"","",$text);
$text = str_replace("/","_",$text);
$text = str_replace("'","_",$text);
$text = str_replace(" - ","_",$text);
$text = str_replace("-","_",$text);
$text = str_replace(" ","_",$text);
$text = str_replace( "ä", "ae", $text);
$text = str_replace( "ç", "c", $text);
$text = str_replace( "Ç", "c", $text);
$text = str_replace( "ğ", "g", $text);
$text = str_replace( "ı", "i", $text);
$text = str_replace( "İ", "i", $text);
$text = str_replace( "ö", "o", $text);
$text = str_replace( "Ö", "o", $text);
$text = str_replace( "ş", "s", $text);
$text = str_replace( "Ş", "s", $text);
$text = str_replace( "ü", "u", $text);
$text = str_replace( "Ü", "u", $text);
$text = str_replace( "&", "ve", $text);
$text = str_replace( "%", "yuzde", $text);
$text = str_replace( "!", "dikkat", $text);
$text = str_replace( "?", "soru", $text);
$text = str_replace( "ó", "o", $text);
$text = ereg_replace("[^A-Za-z0-9_-]", "", $text);
$text = str_replace("____","_",$text);
$text = str_replace("___","_",$text);
$text = str_replace("__","_",$text);
$text = strtolower($text);
return $text;
}
kodlarını ekleyip linklerdeki karakter hatalarını düzeltmesini istedim.Daha sonrafunction sed_forum_section_url(&$args)
{
global $cfg, $fsn, $row, $row1, $master, $title;
$stitle = $title;
$url = parse_url($cfg['mainurl']);
$www = strstr($url['host'], 'www.') ? 'www' : '';
$domain = str_replace('www.', '', $url['host']);
$path = $url['path'];
$title = (!empty($fsn['fs_title'])) ? $fsn['fs_title'] : $row['fs_title'];
$title = (empty($title)) ? $stitle : $title;
$title = (empty($title)) ? $master[1] : $title;
$title = (empty($title)) ? $row1['fs_title'] : $title;
$patterns = array(
'/forums.php?m=topics&q={$id}',
'/forum/{$title}-s{$id}.html',
'http://forum.{$domain}/{$title}-s{$id}.html',
'/forum/{$title}-s{$id}.html'
);
$url = str_replace(array('{$id}', '{$title}', '{$domain}'), array($args['s'], degistir($title), $domain), $patterns[$cfg['urls_pattern'] - 1]);
unset($args['s'], $master);
return $url;
}
function sed_forum_topic_url(&$args)
{
global $cfg, $fsnn, $fsn, $row, $ft_title;
$url = parse_url($cfg['mainurl']);
$www = strstr($url['host'], 'www.') ? 'www' : '';
$domain = str_replace('www.', '', $url['host']);
$path = $url['path'];
$title = (!empty($fsnn['fs_lt_id'])) ? $fsnn['fs_lt_id'] : $fsn['fs_lt_id'];
$title = (empty($title)) ? $row['ft_title'] : $title;
$title = (empty($title)) ? $ft_title : $title;
$patterns = array(
'/forums.php?m=posts&q={$id}',
'/forum/{$title}-t{$id}.html',
'http://forum.{$domain}/{$title}-t{$id}.html',
'/forum/{$title}-t{$id}.html'
);
$url = str_replace(array('{$id}', '{$title}', '{$domain}'), array($args['q'], degistir($title), $domain), $patterns[$cfg['urls_pattern'] - 1]);
unset($args['q']);
return $url;
}
kodunu ekledim.yönetim paneli >> diğer >> urls kısmına da area forums parametres m=topics&s=* format {sed_forum_section_url()} area forums parametres m=posts&q=* format {cot_forum_topic_url()} kodlarını ekledim. htaccess dosyasına RewriteCond %{HTTP_HOST} !^(www\.)?([^.]+)\.(com)?$
RewriteCond %{HTTP_HOST} ^forum\.([^.]+)\.(com)?$
RewriteRule ^$ forums.php [L]
RewriteCond %{HTTP_HOST} !^(www\.)?([^.]+)\.(com)?$
RewriteCond %{HTTP_HOST} ^forum\.([^.]+)\.(com)?$
RewriteRule ^(.*)-t([0-9]*)\.html(.*)$ forums.php?m=posts&q=$2$3 [L]
RewriteCond %{HTTP_HOST} !^(www\.)?([^.]+)\.(com)?$
RewriteCond %{HTTP_HOST} ^forum\.([^.]+)\.(com)?$
RewriteRule ^(.*)-f([0-9]*)\.html(.*)$ forums.php?m=topics&s=$2$3 [L]
RewriteCond %{HTTP_HOST} !^(www\.)?([^.]+)\.(com)?$
RewriteCond %{HTTP_HOST} ^forum\.([^.]+)\.(com)?$
RewriteRule ^(.*)-s([0-9]*)\.html$ forums.php?m=topics&s=$2$3 [L]
RewriteRule ^forum/$ forums.php [L]
RewriteRule ^forum/(.*)-t([0-9]*)\.html(.*)$ forums.php?m=posts&q=$2$3 [L]
RewriteRule ^forum/(.*)-f([0-9]*)\.html(.*)$ forums.php?m=topics&s=$2$3 [L]
RewriteRule ^forum/(.*)-s([0-9]*)\.html$ forums.php?m=topics&s=$2$3 [L]
kodlarını ekledim. Sorunu nerede yaşıyorum kestiremedim bir türlü.Yardım ederseniz sevinirim. Gökhan YILDIZ
|