GüLe SeVDaLi BiR GeNçLiK
WEBMASTER SAHASI => Hazır Sistemler => SMF => Konuyu başlatan: sevdaligul - 27 Mayıs 2012, 19:41:36
-
Modu bilmeyenimiz yoktur sanırım. Yinede kısaca örnek vererek göstereyim..
Orjinal link: www.smf.gen.tr/smf/index.php?topic=46652.0
Kısaltılmış hali: http://www.smf.gen.t...ex.php?topic=46652.0
Bu mod 1.x serisi için vardı fakat 2.x serisi için mod yazarı güncellememişti. Yağız arkadaşımız paket olarak 2.0 RC3 serisine çevirmiş.Ama şimdiki sürümde (2.0.2) subs.php de hata veriyor.Bende hatasız şekilde manuelini çıkardım.
Manuel kurulum
Subs.php
Bul:
// No type means 'parsed_content'.
if (!isset($tag['type']))
{
// !!! Check for end tag first, so people can say "I like that [i] tag"?
$open_tags[] = $tag;
$message = substr($message, 0, $pos) . "\n" . $tag['before'] . "\n" . substr($message, $pos1);
$pos += strlen($tag['before']) - 1 + 2;
}
Sonrasına ekle:
// Trim the urls
elseif (($tag['type'] == 'unparsed_content' && $tag['tag'] == 'url'))
{
$pos2 = stripos($message, '[/' . substr($message, $pos + 1, strlen($tag['tag'])) . ']', $pos1);
if ($pos2 === false)
continue;
$data = substr($message, $pos1, $pos2 - $pos1);
if (!empty($tag['block_level']) && substr($data, 0, 6) == '<br />')
$data = substr($data, 6);
if (isset($tag['validate']))
$tag['validate']($tag, $data, $disabled);
$code = strtr($tag['content'], array('$1' => $data, '$2' => urlTrim($data)));
$message = substr($message, 0, $pos) . $code . substr($message, $pos2 + 3 + strlen($tag['tag']));
$pos += strlen($code) - 1;
}
Bul:
?>
Öncesine ekle:
// Shorten url.
function urlTrim($url)
{
global $modSettings;
$modSettings['urlLength'] = isset($modSettings['urlLength']) ? $modSettings['urlLength'] : 50;
// Check the length of the url
if (strlen($url) > $modSettings['urlLength'])
{
$break = $modSettings['urlLength'] / 2;
$urlNew = substr($url, 0, $break) . '...' . substr($url, -$break);
}
else
$urlNew = $url;
return $urlNew;
}
Bul:
array(
'tag' => 'url',
'type' => 'unparsed_content',
'content' => '<a href="$1" class="bbc_link" target="_blank">$1</a>',
'validate' => create_function('&$tag, &$data, $disabled', '
$data = strtr($data, array(\'<br />\' => \'\'));
if (strpos($data, \'http://\') !== 0 && strpos($data, \'https://\') !== 0)
$data = \'http://\' . $data;
'),
),
Değiştir:
array(
'tag' => 'url',
'type' => 'unparsed_content',
'content' => '<a href="$1" class="bbc_link" target="_blank">$2</a>',
'validate' => create_function('&$tag, &$data, $disabled', '
$data = strtr($data, array(\'<br />\' => \'\'));
if (strpos($data, \'http://\') !== 0 && strpos($data, \'https://\') !== 0)
$data = \'http://\' . $data;
'),
),
Subs-Post.php
Bul:
elseif ($hasEqualSign)
$replaces['[' . $matches[1][$k] . '=' . $matches[2][$k] . ']'] = '[' . $this_tag . '=' . $replace . ']';
Sonrasına ekle:
elseif ($embeddedUrl && $matches[1][$k] == 'url' && !$hasEqualSign)
$replaces['[' . $matches[1][$k] . ']' . $matches[2][$k] . '[/' . $matches[3][$k] . ']'] = '[' . $this_tag . ']' . $replace . '[/' . $this_close . ']';
ManagePosts.php
Bul:
array('bbc', 'disabledBBC'),
Sonrasına ekle:
array('int', 'urlLength'),
Modifications.english.php
Bul:
?>
Öncesine ekle:
// TrimUrl
$txt['urlLength'] = 'Trim url longer than (x) characters.';
Modifications.turkish.php
Bul:
?>
Öncesine ekle:
// TrimUrl
$txt['urlLength'] = 'Uzun karaktere (x) sahip linkleri kısalt';
Aklınızda bulunsun mod eski linkleri kısaltmaz yeni eklenen linkleri kısaltır.
Modun ayarı: Admin Paneli>İletiler ve Konular>BBC kısmından linkin uzunluğunu ayarlayabilirsiniz.
Alıntı:http://www.smf.gen.tr/smf/index.php?topic=73917.0#quickreply (http://www.smf.gen.tr/smf/index.php?topic=73917.0#quickreply)