modu baştan yaz ve şu moddan faydalan:
yönetici - arama flood korumasını açma kapama [1.0.0a]tanımlamaları bundaki gibi yap...
yönetim panelinde 2 seçenek olur; Evet ve Hayır, Evet = 1, Hayır = 0.
sorgu da şöyle olacak:
[syntax="php"] if($board_config['url_rw'])
{
kodlar
}[/syntax]
bu şekilde ki yazım 1 i yani TRUE denetler. içerik 1 ise sorgu çalışır, değilse atlanır, sonrasında else de kullanmaya gerek yok.
- Kod: Tümünü seç
//
// gzip_compression
//
kısmında ise değil kullan (aha bunu bende denemedim)
[syntax="php"] if( ! $board_config['url_rw'])
{
kodlar
}[/syntax]
make_url_friendly fonksiyonu için daha derli toplu, düzenlenmiş, Türkçe karakterler eklenmiş kod:
- Kod: Tümünü seç
//-- [+] MOD: phpBB SEO keyword URLs -------------------------------------
//-- replace
//
// while (@ob_end_flush());
ob_start();
function make_url_friendly($url)
{
$url = trim($url);
$url = strtolower($url);
$find = array('<b>', '</b>');
$url = str_replace ($find, '', $url);
$url = preg_replace('/<(\/{0,1})img(.*?)(\/{0,1})\>/', 'image', $url);
$find = array(' ', '"', '&', '&', '\r\n', '\n', '/', '\\', '+', '<', '>');
$url = str_replace ($find, '-', $url);
$find = array('é', 'è', 'ë', 'ê', 'É', 'È', 'Ë', 'Ê');
$url = str_replace ($find, 'e', $url);
$find = array('í', 'ı', 'ì', 'î', 'ï', 'I', 'İ', 'Í', 'Ì', 'Î', 'Ï');
$url = str_replace ($find, 'i', $url);
$find = array('ó', 'ö', 'Ö', 'ò', 'ô', 'Ó', 'Ò', 'Ô');
$url = str_replace ($find, 'o', $url);
$find = array('á', 'ä', 'â', 'à', 'â', 'Ä', 'Â', 'Á', 'À', 'Â');
$url = str_replace ($find, 'a', $url);
$find = array('ú', 'ü', 'Ü', 'ù', 'û', 'Ú', 'Ù', 'Û');
$url = str_replace ($find, 'u', $url);
$find = array('ç', 'Ç');
$url = str_replace ($find, 'c', $url);
$find = array('ş', 'Ş');
$url = str_replace ($find, 's', $url);
$find = array('ğ', 'Ğ');
$url = str_replace ($find, 'g', $url);
$find = array('/[^a-z0-9\-<>]/', '/[\-]+/', '/<[^>]*>/');
$repl = array('', '-', '');
$url = preg_replace ($find, $repl, $url);
$url = str_replace ('--', '-', $url);
return $url;
}
function rewrite_urls($content)
{
function if_query($amp)
{
if($amp != '')
{
return '?';
}
}
$url_in = array('/(?<!\/)viewforum.php\?f=([0-9]+)((&)|(&)){0,1}([^>]+>)(.*?)<\/a>/e',
'/(?<!\/)\.\/viewforum.php\?f=([0-9]+)((&)|(&)){0,1}([^>]+>)(.*?)<\/a>/e',
'/(?<!\/)viewtopic.php\?p=([0-9]+)((&)|(&)){0,1}([^>]+>)(.*?)<\/a>/e',
'/(?<!\/)viewtopic.php\?t=([0-9]+)((&)|(&)){0,1}([^>]+>)(.*?)<\/a>/e',
'/(?<!\/)index.php\?c=([0-9]+)((&)|(&)){0,1}([^>]+>)(.*?)<\/a>/e',
'/(?<!\/)portal.php\?page=([0-9]+)((&)|(&)){0,1}([^>]+>)(.*?)<\/a>/e',
'/(?<!\/)dload.php\?action=category&cat_id=([0-9]+)((&)|(&)){0,1}([^>]+>)(.*?)<\/a>/e',
'/(?<!\/)dload.php\?action=category&cat_id=([0-9]+)((&)|(&)){0,1}([^>]+>)(.*?)<\/a>/e',
'/(?<!\/)dload.php\?action=file&file_id=([0-9]+)((&)|(&)){0,1}([^>]+>)(.*?)<\/a>/e',
'/(?<!\/)dload.php\?action=download&file_id=([0-9]+)((&)|(&)){0,1}([^>]+>)(.*?)<\/a>/e',
'/(?<!\/)kb.php\?mode=cat&cat=([0-9]+)((&)|(&)){0,1}([^>]+>)(.*?)<\/a>/e',
'/(?<!\/)kb.php\?mode=article&k=([0-9]+)((&)|(&)){0,1}([^>]+>)(.*?)<\/a>/e',
'/(?<!\/)kb.php\?mode=stats&stats=mostpopular((&)|(&)){0,1}([^>]+>)(.*?)<\/a>/e',
'/(?<!\/)kb.php\?mode=stats&stats=toprated((&)|(&)){0,1}([^>]+>)(.*?)<\/a>/e',
'/(?<!\/)kb.php\?mode=stats&stats=latest((&)|(&)){0,1}([^>]+>)(.*?)<\/a>/e',
);
$url_out = array("make_url_friendly('\\6') . '-vf\\1.html' . if_query('\\2') . stripslashes('\\5\\6') . '</a>'",
"make_url_friendly('\\6') . '-vf\\1.html' . if_query('\\2') . stripslashes('\\5\\6') . '</a>'",
"make_url_friendly('\\6') . '-vp\\1.html' . if_query('\\2') . stripslashes('\\5\\6') . '</a>'",
"make_url_friendly('\\6') . '-vt\\1.html' . if_query('\\2') . stripslashes('\\5\\6') . '</a>'",
"make_url_friendly('\\6') . '-vc\\1.html' . if_query('\\2') . stripslashes('\\5\\6') . '</a>'",
"make_url_friendly('\\6') . '-po\\1.html' . if_query('\\2') . stripslashes('\\5\\6') . '</a>'",
"make_url_friendly('\\6') . '-dc\\1.html' . if_query('\\2') . stripslashes('\\5\\6') . '</a>'",
"make_url_friendly('\\6') . '-dc\\1.html' . if_query('\\2') . stripslashes('\\5\\6') . '</a>'",
"make_url_friendly('\\6') . '-df\\1.html' . if_query('\\2') . stripslashes('\\5\\6') . '</a>'",
"make_url_friendly('\\6') . '-indir\\1.html' . if_query('\\2') . stripslashes('\\5\\6') . '</a>'",
"make_url_friendly('\\6') . '-kbc\\1.html' . if_query('\\2') . stripslashes('\\5\\6') . '</a>'",
"make_url_friendly('\\6') . '-kba\\1.html' . if_query('\\2') . stripslashes('\\5\\6') . '</a>'",
"make_url_friendly('\\5') . '-kbsmp.html' . if_query('\\1') . stripslashes('\\4\\5') . '</a>'",
"make_url_friendly('\\5') . '-kbstr.html' . if_query('\\1') . stripslashes('\\4\\5') . '</a>'",
"make_url_friendly('\\5') . '-kbsl.html' . if_query('\\1') . stripslashes('\\4\\5') . '</a>'",
);
$content = preg_replace($url_in, $url_out, $content);
return $content;
}
//
//-- [-] MOD: phpBB SEO keyword URLs -------------------------------------