Seite 1 von 1

forumlinks im selben fenster öffnen lassen

Verfasst: 11.03.2005 18:23
von biggfoot
hi zusammen,
ich würde gern interne forumlinks in beiträgen im selben fenster öffnen lassen. weiß jemand wie das funktioniert?

und, ist es möglich diese links auch als relative und nicht absolute links zu schreiben?

vielen dank!

Verfasst: 11.03.2005 18:38
von rabbit
Local Linksby Netclectic :)

Verfasst: 15.03.2005 18:46
von biggfoot
okay, dafür schon mal danke! das funzt.


wie kann ich mein zweites problem lösen?
-- ich würde gern forum interne links (also einfach nur auf einen anderen post verweisen) nur als relative links schreiben wollen. ohne "http://forum.de/..." sondern nur "/viewtopic.php?t=zahl"

ist das machbar?

vielen dank

Verfasst: 20.04.2006 12:19
von Rewad
ich grabe diesen beitrag aus den tiefen wieder aus weil ich genau diesen mod suche.

es gibt viele topics hier die alle auf diesen mod "Local Links by Netclectic" verweisen.

mein problem: die seite http://www.netclectic.com/ ist schon seit langem offline (zu lange um dem text auf der seite glauben zu schenken, von wegen back soon), kennt jemand einen anderen link oder ähnlichen mod?

besten dank

Verfasst: 20.04.2006 18:37
von grueneralien

Code: Alles auswählen

## EasyMod 0.0.7 compliant
############################################################## 
## Mod Title: Local Links
## Mod Version: 1.1.0
## Author: netclectic < adrian@netclectic.com > Adrian Cockburn - http://www.netclectic.com 
## Description: This MOD will cause any local URLs (i.e. www.YOURDOMAIN.com) posted to your 
## board to open in the same window instead of in a new window, ( i.e. _self instead of _blank ). 
## This does not effect external URLs. Might not be to your liking if you do not have your own domain name.
## 
## Installation Level: easy
## Installation Time: 5 Minutes 
## Files To Edit: (2) includes/bbcode.php,
## templates/subSilver/bbcode.tpl
## Included Files: n/a
############################################################## 
## This MOD is released under the GPL License. 
## Intellectual Property is retained by the MOD Author(s) listed above 
############################################################## 
## For Security Purposes, Please Check: http://www.phpbb.com/mods/downloads/ for the 
## latest version of this MOD. Downloading this MOD from other sites could cause malicious code 
## to enter into your phpBB Forum. As such, phpBB will not offer support for MOD's not offered 
## in our MOD-Database, located at: http://www.phpbb.com/mods/downloads/ 
############################################################## 
## Author Note: 
##
## Change History:
##        1.1.0 - Confirmed with 2.0.4. Updated to be EasyMod compliant.
##        1.0.3 - Aarrgghhh! Regular expressions!!!.
##        1.0.2 - Fixed small bug in script - .
##        1.0.1 - Fixed some dodgy regular expressions.
##        1.0.0 - Original release.
############################################################## 
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD 
############################################################## 

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

# 
#-----[ FIND ]------------------------------------------ 
# 
$bbcode_tpl['url1'] = str_replace('{URL}', '\1\2', $bbcode_tpl['url']);

# 
#-----[ BEFORE, ADD ]------------------------------------------ 
# 
    // MOD LOCAL URL BEGIN 
	$bbcode_tpl['url_local1'] = str_replace('{URL}', '\\1\\2\\3', $bbcode_tpl['url_local']);
	$bbcode_tpl['url_local1'] = str_replace('{DESCRIPTION}', '\\1\\2\\3', $bbcode_tpl['url_local1']);

	$bbcode_tpl['url_local2'] = str_replace('{URL}', 'http://\\1\\2', $bbcode_tpl['url_local']);
	$bbcode_tpl['url_local2'] = str_replace('{DESCRIPTION}', '\\1\\2', $bbcode_tpl['url_local2']);

	$bbcode_tpl['url_local3'] = str_replace('{URL}', '\\1\\2\\3', $bbcode_tpl['url_local']);
	$bbcode_tpl['url_local3'] = str_replace('{DESCRIPTION}', '\\4', $bbcode_tpl['url_local3']);
	
	$bbcode_tpl['url_local4'] = str_replace('{URL}', 'http://\\1\\2', $bbcode_tpl['url_local']);
	$bbcode_tpl['url_local4'] = str_replace('{DESCRIPTION}', '\\3', $bbcode_tpl['url_local4']);
    // MOD LOCAL URL END 

# 
#-----[ FIND ]------------------------------------------ 
# 
	// [img]image_url_here[/img] code..
	// This one gets first-passed..

# 
#-----[ BEFORE, ADD ]------------------------------------------ 
# 
    // MOD LOCAL URL BEGIN 
    // do any local urls first... 
    // [url]xxxx://www.phpbb.com[/url] code.. 
	$local_patterns[1] = "#\[url\]([a-z]+?://){1}(".$_SERVER["SERVER_NAME"].")([a-z0-9\-\.,\?!%\*_\#:;~\\&$@\/=\+]*)\[/url\]#si";
	$local_replacements[1] = $bbcode_tpl['url_local1'];                       

	// [url]www.phpbb.com[/url] code.. (no xxxx:// prefix).
	$local_patterns[2] = "#\[url\](".$_SERVER["SERVER_NAME"].")([a-z0-9\-\.,\?!%\*_\#:;~\\&$@\/=\+]*)\[/url\]#si";
	$local_replacements[2] = $bbcode_tpl['url_local2'];

	// [url=xxxx://www.phpbb.com]phpBB[/url] code..
	$local_patterns[3] = "#\[url=([a-z]+?://){1}(".$_SERVER["SERVER_NAME"].")([a-z0-9\-\.,\?!%\*_\#:;~\\&$@\/=\+]*)\](.*?)\[/url\]#si";
	$local_replacements[3] = $bbcode_tpl['url_local3'];

	// [url=www.phpbb.com]phpBB[/url] code.. (no xxxx:// prefix).
	$local_patterns[4] = "#\[url=(".$_SERVER["SERVER_NAME"].")([a-z0-9\-\.,\?!%\*_\#:;~\\&$@\/=\+]*)\](.*?)\[/url\]#si";
	$local_replacements[4] = $bbcode_tpl['url_local4'];
    
    $text = preg_replace($local_patterns, $local_replacements, $text); 
    // now with the local urls done, it's safe to do any external urls 
    // MOD LOCAL URL END 

# 
#-----[ FIND ]------------------------------------------ 
# 
// matches an "xxxx://yyyy" URL at the start of a line, or after a space. 

# 
#-----[ BEFORE, ADD ]------------------------------------------ 
# 
// MOD LOCAL URL BEGIN
// match a local URL and replace with a target="_self" href 
$ret = preg_replace("#([\n ])([a-z]+?)://(".$_SERVER["SERVER_NAME"].")((?:/[^\t <\n\r]*)?)#i", "\\1<a href=\"\\2://\\3\\4\" target=\"_self\">\\2://\\3\\4</a>", $ret); 
$ret = preg_replace("#([\n ])(".$_SERVER["SERVER_NAME"].")((?:/[^\t <\n\r]*)?)#i", "\\1<a href=\"http://\\2\\3\" target=\"_self\">\\2\\3</a>", $ret);
// MOD LOCAL URL END 


# 
#-----[ OPEN ]------------------------------------------ 
# 
templates/subSilver/bbcode.tpl 

# 
#-----[ FIND ]------------------------------------------ 
# 
<!-- BEGIN url --><a href="{URL}" target="_blank" class="postlink">{DESCRIPTION}</a><!-- END url --> 

# 
#-----[ AFTER, ADD ]------------------------------------------ 
# 
<!-- BEGIN url_local --><a href="{URL}" target="_self" class="postlink">{DESCRIPTION}</a><!-- END url_local -->

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