[Erledigt] Problem mit Hide links!

Du suchst einen bestimmten Mod, weißt aber nicht genau wo bzw. ob er überhaupt existiert? Wenn dir dieser Artikel nicht weiterhilft, kannst du hier den von dir gewünschten/gesuchten Mod beschreiben ...
Falls ein Mod-Autor eine der Anfragen hier aufnimmt um einen neuen Mod zu entwicklen, geht's in phpBB 2.0: Mods in Entwicklung weiter.
Forumsregeln
phpBB 2.0 hat das Ende seiner Lebenszeit überschritten
phpBB 2.0 wird nicht mehr aktiv unterstützt. Insbesondere werden - auch bei Sicherheitslücken - keine Patches mehr bereitgestellt. Der Einsatz von phpBB 2.0 erfolgt daher auf eigene Gefahr. Wir empfehlen einen Umstieg auf phpBB 3.0, welches aktiv weiterentwickelt wird und für welches regelmäßig Updates zur Verfügung gestellt werden.
Antworten
Benutzeravatar
HaYaLcI
Mitglied
Beiträge: 58
Registriert: 20.04.2006 14:32
Wohnort: Ulm

[Erledigt] Problem mit Hide links!

Beitrag von HaYaLcI »

Hi,
habe diesen Mod instaliert doch funktioniert nicht, habe phpbb2 2.0.20!
Hatte zuvor phpbb2 plus und da hat es Problemlos funktioniert!

Code: Alles auswählen

#################################################################
## Mod Title: Hide Links
## Mod Author: Nome < nome@bk.ru > 162783614
## Mod Version: 2.1.0
## 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_english/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
#################################################################

#
#-----[ OPEN ]------------------------------------------
#
includes/bbcode.php

#
#-----[ FIND ]------------------------------------------
#
function bbencode_second_pass($text, $uid)
{
	global $lang, $bbcode_tpl;

#
#-----[ REPLACE WITH ]------------------------------------
#
function bbencode_second_pass($text, $uid)
{
	global $lang, $bbcode_tpl, $userdata, $phpEx, $u_login_logout;

	// 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>';

#
#-----[ FIND ]------------------------------------------
#
	// matches a [url]xxxx://www.phpbb.com[/url] code..
	$patterns[] = "#\[url\]([\w]+?://[^ \"\n\r\t<]*?)\[/url\]#is";
	$replacements[] = $bbcode_tpl['url1'];

	// [url]www.phpbb.com[/url] code.. (no xxxx:// prefix).
	$patterns[] = "#\[url\]((www|ftp)\.[^ \"\n\r\t<]*?)\[/url\]#is";
	$replacements[] = $bbcode_tpl['url2'];

	// [url=xxxx://www.phpbb.com]phpBB[/url] code..
	$patterns[] = "#\[url=([\w]+?://[^ \"\n\r\t<]*?)\]([^?\n\r\t].*?)\[/url\]#is"; 
	$replacements[] = $bbcode_tpl['url3'];

	// [url=www.phpbb.com]phpBB[/url] code.. (no xxxx:// prefix).
	$patterns[] = "#\[url=((www|ftp)\.[^ \"\n\r\t<]*?)\]([^?\n\r\t].*?)\[/url\]#is";
	$replacements[] = $bbcode_tpl['url4'];

	// [email]user@domain.tld[/email] code..
	$patterns[] = "#\[email\]([a-z0-9&\-_.]+?@[\w\-]+\.([\w\-\.]+\.)?[\w]+)\[/email\]#si";
	$replacements[] = $bbcode_tpl['email'];



#
#-----[ REPLACE WITH ]------------------------------------
#
	// matches a [url]xxxx://www.phpbb.com[/url] code..
	$patterns[] = "#\[url\]([\w]+?://[^ \"\n\r\t<]*?)\[/url\]#is";
	if ( !$userdata['session_logged_in'] )
	{
		$replacements[] = $replacer;
	}
	else
	{
		$replacements[] = $bbcode_tpl['url1'];
	}

	// [url]www.phpbb.com[/url] code.. (no xxxx:// prefix).
	$patterns[] = "#\[url\]((www|ftp)\.[^ \"\n\r\t<]*?)\[/url\]#is";
	if ( !$userdata['session_logged_in'] )
	{
		$replacements[] = $replacer;
	}
	else
	{
		$replacements[] = $bbcode_tpl['url2'];
	}

	// [url=xxxx://www.phpbb.com]phpBB[/url] code..
	$patterns[] = "#\[url=([\w]+?://[^ \"\n\r\t<]*?)\]([^?\n\r\t].*?)\[/url\]#is";
	if ( !$userdata['session_logged_in'] )
	{
		$replacements[] = $replacer;
	}
	else
	{
		$replacements[] = $bbcode_tpl['url3'];
	}

	// [url=www.phpbb.com]phpBB[/url] code.. (no xxxx:// prefix).
	$patterns[] = "#\[url=((www|ftp)\.[^ \"\n\r\t<]*?)\]([^?\n\r\t].*?)\[/url\]#is";
	if ( !$userdata['session_logged_in'] )
	{
		$replacements[] = $replacer;
	}
	else
	{
		$replacements[] = $bbcode_tpl['url4'];
	}

	// [email]user@domain.tld[/email] code..
	$patterns[] = "#\[email\]([a-z0-9&\-_.]+?@[\w\-]+\.([\w\-\.]+\.)?[\w]+)\[/email\]#si";
	if ( !$userdata['session_logged_in'] )
	{
		$replacements[] = $replacer;
	}
	else
	{
		$replacements[] = $bbcode_tpl['email'];
	}

#
#-----[ FIND ]------------------------------------------
#
function make_clickable($text)
{

#
#-----[ AFTER, ADD ]------------------------------------
#
	global $userdata, $lang, $phpEx, $u_login_logout;

#
#-----[ FIND ]------------------------------------------
#
		// 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);

#
#-----[ REPLACE WITH ]------------------------------------
#
//
// 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
//

#
#-----[ OPEN ]------------------------------------------
#
language/lang_english/lang_main.php

#
#-----[ FIND ]------------------------------------------
#
$lang['A_critical_error'] = 

#
#-----[ AFTER, ADD ]------------------------------------
#

//
// Hide links from unregistered users mod
//
$lang['Links_Allowed_For_Registered_Only'] = 'Sadece Kayitli Kulanicilar Linkleri Görebilirler';
$lang['Get_Registered'] = 'Lütfen %Kayit%s olunuz veya';
$lang['Enter_Forum'] = '%Giris%s yapiniz!';

#
#-----[ SAVE/CLOSE ALL FILES ]--------------------------
#
#EoM

Code: Alles auswählen

$lang['Links_Allowed_For_Registered_Only'] = 'Sadece Kayitli Kulanicilar Linkleri Görebilirler';
$lang['Get_Registered'] = 'Lütfen %Kayit%s olunuz veya';
$lang['Enter_Forum'] = '%Giris%s yapiniz!';
das habe ich geändert!

Könnt ihr mir da weiterhelfen?

Danke...
Zuletzt geändert von HaYaLcI am 21.04.2006 23:07, insgesamt 1-mal geändert.
blubbin
Mitglied
Beiträge: 409
Registriert: 08.09.2005 16:52

Beitrag von blubbin »

Hi

WAS funktionier genau nicht?
KB:frage_recht

Gruß,
blubbin
Benutzeravatar
HaYaLcI
Mitglied
Beiträge: 58
Registriert: 20.04.2006 14:32
Wohnort: Ulm

Beitrag von HaYaLcI »

also, es hat sich nichts geändert, als ob ich diesen Mod nie instaliert habe!
Benutzeravatar
Sanchez17
Mitglied
Beiträge: 913
Registriert: 10.12.2005 22:21
Wohnort: Moers / Sevilla
Kontaktdaten:

Beitrag von Sanchez17 »

Blöde Frage,aber warst du eingelogt als du es ausprobiert hast? :roll:
Viva el betís, mi amor :-)
Wir gehn voran, als euer zwölfter Mann, scheiß egal wie weit, ob Sturm oder Schnee, MSV Duisburg oé
Benutzeravatar
HaYaLcI
Mitglied
Beiträge: 58
Registriert: 20.04.2006 14:32
Wohnort: Ulm

Beitrag von HaYaLcI »

sorry hat sich erledigt... hab die instalation neu durchgeführt und es ging auf ein mal :roll:
LaLeCaN
Mitglied
Beiträge: 2
Registriert: 23.04.2006 18:33

Beitrag von LaLeCaN »

Ich habe eine ganz wichtige frage

Bitte antworten sie :(

Ich brauche für diese mod

edk2 link fix

weil bei HTTP links funktioniert diese mod einwand frei

aber du unregistrierte besucher können meine EMULE links sehen :(

Warte auf die antworte

DANKE
Benutzeravatar
Slytherin
Mitglied
Beiträge: 1771
Registriert: 11.03.2005 17:52
Wohnort: Hogwarts
Kontaktdaten:

Beitrag von Slytherin »

Bitte drücke dich so aus, dass es für durchschnittliche Bürger zu verstehen ist.
>> KB:frage_recht <<

Slytherin
LaLeCaN
Mitglied
Beiträge: 2
Registriert: 23.04.2006 18:33

Beitrag von LaLeCaN »

Entschuldigung :oops:
Antworten

Zurück zu „phpBB 2.0: Mod Suche/Anfragen“