Uzun Linkleri Otomatik Kısaltma Modu
Manuel Anlatım
Sources/Subs.php de
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) . $tag['before'] . substr($message, $pos1);
$pos += strlen($tag['before']) - 1;
}
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
// Creates an image/text button
function create_button($name, $alt, $label = '', $custom = '')
ö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
'<a href="$1" target="_blank">$1</a>',
Değiştir
'<a href="$1" target="_blank">$2</a>',
Sources/Subs-Post.php de
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 . ']';
Sources/ManagePosts.php de
bul
'disabledBBC' => implode(',', array_diff($bbcTags, $_POST['enabledTags'])),Sonrasına Ekle
'urlLength' => empty($_POST['urlLength']) ? 50 : (int)$_POST['urlLength'],
Themes/default/Admin.template.php de
Bul
Kod: Hepsini Seç | Panoya Kopyala
</tr><tr class="windowbg2">
<th width="50%" align="right"><label for="autoLinkUrls_check">', $txt['autoLinkUrls'], '</label>:</th>
<td>
<input type="checkbox" name="autoLinkUrls" id="autoLinkUrls_check"', empty($modSettings['autoLinkUrls']) ? '' : ' checked="checked"', ' class="check" />
</td>
</tr><tr class="windowbg2">
Değiştir
</tr><tr class="windowbg2">
<th width="50%" align="right"><label for="autoLinkUrls_check">', $txt['autoLinkUrls'], '</label>:</th>
<td>
<input type="checkbox" name="autoLinkUrls" id="autoLinkUrls_check"', empty($modSettings['autoLinkUrls']) ? '' : ' checked="checked"', ' class="check" />
</td>
</tr><tr class="windowbg2">
<th width="50%" align="right"><label for="urlLength">', $txt['urlLength'], '</label>:</th>
<td>
<input type="text" name="urlLength" id="urlLength" value="', empty($modSettings['urlLength']) ? '50' : $modSettings['urlLength'], '" size="6" />
</td>
</tr><tr class="windowbg2">
languages/Modifications.turkish.php de
bul
Öncesine ekle
// TrimUrl
$txt['urlLength'] = '(x) karakterden uzun linkler kısaltılır.';
Paket haline burdan ulaşabilirsiniz
Linklerin Görülmesine İzin VerilmiyorLinki Görebilmek İçin üye OL veya Giriş YAP