Tarih: 2007-03-25, 19:30:41 Mesaj konusu: Bağlantı Gizleme Eklentisi
Bağlantı Gizleme Eklentsini Kurdum...
Alıntı:
Eklenti
#################################################################
## Mod Title: Hide Links
## Mod Author: Nome < nome@bk.ru > 162783614
## Mod Version: 2.1.0
## Ported 2 BBNuke By Turan <turan@nuketurk.com> http://ntbb.nuketurk.com
## Mod Description: This mod will prevent links from being shown
## to unregistered users. Instead they'll be
## advised to register or login.
## Mod Features:
## - hide http links and email from unregistered users
##
## Installation Level: Very Easy
## Installation Time: 3 Minutes
##
## Files To Edit: 2
## includes/bbcode.php
## language/lang_turkish/lang_main.php
##
#################################################################
## Author's notes:
## In order to change the thing you get instead of a link
## edit $replacer. By default there is a quotelike box.
## Pay attention to the fact that the second block of $replacers
## has a space in the first line, it's a must there :)
#################################################################
#################################################################
## History
## - 2.1.0 - Updated with latest bugfixes from phpbb groupe
## - 2.0.0 - Fixed a bug with [url] links
## - 1.0.0 - First released
#################################################################
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD
#################################################################
#
#-----[ BULUN ]------------------------------------------
#
// matches an "xxxx://yyyy" URL at the start of a line, or after a space.
// xxxx can only be alpha characters.
// yyyy is anything up to the first space, newline, comma, double quote or <
$ret = preg_replace("#(^|[\n ])([\w]+?://[^ \"\n\r\t<]*)#is", "\\1<a href=\"\\2\" target=\"_blank\">\\2</a>", $ret);
// matches a "www|ftp.xxxx.yyyy[/zzzz]" kinda lazy URL thing
// Must contain at least 2 dots. xxxx contains either alphanum, or "-"
// zzzz is optional.. will contain everything up to the first space, newline,
// comma, double quote or <.
$ret = preg_replace("#(^|[\n ])((www|ftp)\.[^ \"\t\n\r<]*)#is", "\\1<a href=\"http://\\2\" target=\"_blank\">\\2</a>", $ret);
// matches an email@domain type address at the start of a line, or after a space.
// Note: Only the followed chars are valid; alphanums, "-", "_" and or ".".
$ret = preg_replace("#(^|[\n ])([a-z0-9&\-_.]+?)@([\w\-]+\.([\w\-\.]+\.)*[\w]+)#i", "\\1<a href=\"mailto:\\2@\\3\">\\2@\\3</a>", $ret);
#
#-----[ AŞAĞIDAKİ İLE DEĞİŞTİRİN ]------------------------------------
#
//
// Hide links from unregistered users mod
//
if ( !$userdata['session_logged_in'] )
{
// The thing we replace links with. I like using a quote like box
$replacer = ' <table width="40%" cellspacing="1" cellpadding="3" border="0"><tr><td class="quote">';
$replacer .= $lang['Links_Allowed_For_Registered_Only'] . '<br />';
$replacer .= sprintf($lang['Get_Registered'], "<a href=\"" . append_sid('profile.' . $phpEx . '?mode=register') . "\">", "</a>");
$replacer .= sprintf($lang['Enter_Forum'], "<a href=\"" . append_sid($u_login_logout) . "\">", "</a>");
$replacer .= '</td></tr></table>';
// matches an "xxxx://yyyy" URL at the start of a line, or after a space.
// xxxx can only be alpha characters.
// yyyy is anything up to the first space, newline, comma, double quote or <
$ret = preg_replace("#(^|[\n ])([\w]+?://[^ \"\n\r\t<]*)#is", $replacer, $ret);
// matches a "www|ftp.xxxx.yyyy[/zzzz]" kinda lazy URL thing
// Must contain at least 2 dots. xxxx contains either alphanum, or "-"
// zzzz is optional.. will contain everything up to the first space, newline,
// comma, double quote or <.
$ret = preg_replace("#(^|[\n ])((www|ftp)\.[^ \"\t\n\r<]*)#is", $replacer, $ret);
// matches an email@domain type address at the start of a line, or after a space.
// Note: Only the followed chars are valid; alphanums, "-", "_" and or ".".
$ret = preg_replace("#(^|[\n ])([a-z0-9&\-_.]+?)@([\w\-]+\.([\w\-\.]+\.)*[\w]+)#i", $replacer, $ret);
}
else
{
// matches an "xxxx://yyyy" URL at the start of a line, or after a space.
// xxxx can only be alpha characters.
// yyyy is anything up to the first space, newline, comma, double quote or <
$ret = preg_replace("#(^|[\n ])([\w]+?://[^ \"\n\r\t<]*)#is", "\\1<a href=\"\\2\" target=\"_blank\">\\2</a>", $ret);
// matches a "www|ftp.xxxx.yyyy[/zzzz]" kinda lazy URL thing
// Must contain at least 2 dots. xxxx contains either alphanum, or "-"
// zzzz is optional.. will contain everything up to the first space, newline,
// comma, double quote or <.
$ret = preg_replace("#(^|[\n ])((www|ftp)\.[^ \"\t\n\r<]*)#is", "\\1<a href=\"http://\\2\" target=\"_blank\">\\2</a>", $ret);
// matches an email@domain type address at the start of a line, or after a space.
// Note: Only the followed chars are valid; alphanums, "-", "_" and or ".".
$ret = preg_replace("#(^|[\n ])([a-z0-9&\-_.]+?)@([\w\-]+\.([\w\-\.]+\.)*[\w]+)#i", "\\1<a href=\"mailto:\\2@\\3\">\\2@\\3</a>", $ret);
}
//
// Hide links from unregistered users mod
//
Fakat..
Sadece Url İle Başlayan Linkleri Gizliyor Gider Http Ve www İle Başlayanlar Gizlenmiyor...
bir Diger Sorunda...
Üye Ol Yazısına Tıkladıgımda Söleşme Sayfasına gidiyor..
Kabul Ediyorum Dedikten Sonra Bir Hata Çıkıyor..
Ben Sitemde Yayinladiğim Tüm Resimleri Gizleyebileceğim Ve Bir Eklenti Arıyorum... Böyle Bİr Eklenti İle İlgili Bilgisi olan Varmı Acaba...
Yukarıdaki Eklenti Verilen Url Adreslerini Gizliyor Misafirlere Sadece...
Ben Tüm Resimsel İçerikleri Gizlemek İstiyorum....
benzer bir script yazılabilir yada editlenebilir ancak sunu sormak istiyorum. tarayıcıya gelen resmin özelliklerine bakıldığında resim adresi gözükecektir bunu nasıl engelleyeceksin ve resimleri neden gizleme ihtiyacı duydun (son sorum tamamen meraktan) :) ..
Tarih: 2007-03-25, 19:51:12 Mesaj konusu: Re: Bağlantı Gizleme Eklentisi
Bu Eklenti Çogu Sitede Var Bildiğim Kadari İle Bulamadım Ben...
Yukarıda Verdiğim Eklentide Siteme Eklenen Resimler gizleniyor görmek İçin üye ol Yada Giriş Yap Diyor Çok Güzel Ama Bu Sadece
bu Şekilde Verilen Bİr Resim Linkini Giliyor...
[img]
Yapilmniş Olanlari Gİzlemiyor...
Sitemde bbcode 5 kurulu
Bu forumda yeni başlıklar açamazsınız Bu forumdaki başlıklara cevap veremezsiniz Bu forumdaki mesajlarınızı değiştiremezsiniz Bu forumdaki mesajlarınızı silemezsiniz Bu forumdaki anketlerde oy kullanamazsınız