Seite 1 von 2

eDonkeylinks + icon

Verfasst: 20.10.2002 21:35
von Gast
Hi phpbb freaks :)

habe bei euch diesen edonkeylink mod gefunden.und zwa hierhttp://www.phpbb.de/viewtopic.php?t=823 ... ht=edonkey
funzt wunderbar!!!

mein frage ist jetzt folgende:wenn ich einen link erstelle steht im fertigen beitrag ed2k:blablabla usw...
nun möchte ich anstatt ed2k: so einen icon haben(pfad images/smiles/e.gif)
[ externes Bild ]
wie muss ich folgender Code ändern damit das funzt????

Code: Alles auswählen

################################################################# 
## Mod Title: BBCode - eDonkey Links 
## Mod Version: 0.0.1 
## Author: sica <sica@nuxli.de> 
## Description: Display eDonkey Links in your Board 
## 
## Installation Level: easy 
## Installation Time: 5 Minutes 
## Files To Edit: phpBB2/includes/bbcode.php 
## Included Files: n/a 
################################################################# 
## Security Disclaimer: This MOD Cannot Be Posted To Or Added At Any Non-Official phpBB Sites 
################################################################# 
## 
## Author Note: 
## This MOD supports eDonkey File and Server Links in the BBCode 
## [url=...]name[/url] and is also able to make ed2k:// links in 
## the posting itself clickable. 
## 
################################################################# 
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD 
################################################################# 

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

# 
#-----[ FIND ]------------------------------------------ 
# 
$bbcode_tpl['url4'] = str_replace('{DESCRIPTION}', '\\2', $bbcode_tpl['url4']); 

# 
#-----[ AFTER, ADD ]------------------------------------------ 
# 
// The URL replacements codes for the eDonkey Links - eDonkey MOD 
$bbcode_tpl['url5'] = str_replace('{URL}', '\\1', $bbcode_tpl['url']); 
$bbcode_tpl['url5'] = str_replace('{DESCRIPTION}', '\\2', $bbcode_tpl['url5']); 

$bbcode_tpl['url6'] = str_replace('{URL}', '\\1', $bbcode_tpl['url']); 
$bbcode_tpl['url6'] = str_replace('{DESCRIPTION}', '\\3', $bbcode_tpl['url6']); 

# 
#-----[ FIND ]------------------------------------------ 
# 
$replacements[5] = $bbcode_tpl['email']; 

# 
#-----[ AFTER, ADD ]------------------------------------------ 
# 
// [url=ed2k://|file|...]name[/url] code.. - eDonkey MOD 
$patterns[6] = "#\[url=(ed2k://\|file\|.*\|\d+\|\w+\|/?)\](.*?)\[/url\]#si"; 
$replacements[6] = $bbcode_tpl['url5']; 

// [url=ed2k://|server|...]name[/url] code.. - eDonkey MOD 
$patterns[7] = "#\[url=(ed2k:(//)?\|server\|[\d\.]+\|\d+\|/?)\](.*?)\[/url\]#si"; 
$replacements[7] = $bbcode_tpl['url6']; 

# 
#-----[ FIND ]------------------------------------------ 
# 
$ret = preg_replace("#([\n ])([a-z0-9\-_.]+?)@([\w\-]+\.([\w\-\.]+\.)?[\w]+)#i", "\\1<a href=\"mailto:\\2@\\3\">\\2@\\3</a>", $ret); 

# 
#-----[ AFTER, ADD ]------------------------------------------ 
# 
// make the file links clickable - eDonkey MOD 
$ret = preg_replace("#([\n ])(ed2k://\|file\|(.*)\|\d+\|\w+\|/?)#", "\\1ed2k: <a href=\"\\2\">\\3</a>", $ret); 

// make the server links clickable - eDonkey MOD 
$ret = preg_replace("#([\n ])(ed2k:(//)?\|server\|([\d\.]+)\|(\d+)\|/?)#", "\\1ed2k: <a href=\"\\2\">\\4 at \\5 </a>", $ret); 

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

Würde mich über Eure hilfe freuen!

danke im voraus

Verfasst: 21.10.2002 14:55
von saerdnaer
das musst du in der templates/xxx/bbcode.tpl ändern...

Verfasst: 22.10.2002 20:43
von Gast
@saerdnaer

Ich absoluter PHP noob :oops:

könntest du mir bitte mein bbcode.tpl ergänzen!!! BIDDE :wink:

Code: Alles auswählen


<!-- BEGIN ulist_open --><ul><!-- END ulist_open -->
<!-- BEGIN ulist_close --></ul><!-- END ulist_close -->

<!-- BEGIN olist_open --><ol type="{LIST_TYPE}"><!-- END olist_open -->
<!-- BEGIN olist_close --></ol><!-- END olist_close -->

<!-- BEGIN listitem --><li><!-- END listitem -->

<!-- BEGIN table_open --> <table> <!-- END table_open --> 
<!-- BEGIN table_close --> </table> <!-- END table_close --> 

<!-- BEGIN btable_open --> <table border="{BORDER}"> <!-- END btable_open --> 
<!-- BEGIN btable_close --> </table> <!-- END btable_close --> 

<!-- BEGIN tablerow_open --> <tr> <!-- END tablerow_open --> 
<!-- BEGIN tablerow_close --> </tr> <!-- END tablerow_close --> 

<!-- BEGIN tablecol_open --> <td> <!-- END tablecol_open --> 
<!-- BEGIN tablecol_close --> </td> <!-- END tablecol_close -->

<!-- BEGIN quote_username_open --></span>
<table width="90%" cellspacing="1" cellpadding="3" border="0" align="center">
<tr> 
	  <td><span class="genmed"><b>{USERNAME} {L_WROTE}:</b></span></td>
	</tr>
	<tr>
	  <td class="quote"><!-- END quote_username_open -->
<!-- BEGIN quote_open --></span>
<table width="90%" cellspacing="1" cellpadding="3" border="0" align="center">
<tr> 
	  <td><span class="genmed"><b>{L_QUOTE}:</b></span></td>
	</tr>
	<tr>
	  <td class="quote"><!-- END quote_open -->
<!-- BEGIN quote_close --></td>
	</tr>
</table>
<span class="postbody"><!-- END quote_close -->

<!-- BEGIN code_open --></span>
<table width="90%" cellspacing="1" cellpadding="3" border="0" align="center">
<tr> 
	  <td><span class="genmed"><b>{L_CODE}:</b></span></td>
	</tr>
	<tr>
	  <td class="code"><!-- END code_open -->
<!-- BEGIN code_close --></td>
	</tr>
</table>
<span class="postbody"><!-- END code_close -->


<!-- BEGIN b_open --><span style="font-weight: bold"><!-- END b_open -->
<!-- BEGIN b_close --></span><!-- END b_close -->

<!-- BEGIN scroll_open --><span><marquee><!-- END scroll_open -->
<!-- BEGIN scroll_close --></marquee></span><!-- END scroll_close -->

<!-- BEGIN u_open --><span style="text-decoration: underline"><!-- END u_open -->
<!-- BEGIN u_close --></span><!-- END u_close -->

<!-- BEGIN i_open --><span style="font-style: italic"><!-- END i_open -->
<!-- BEGIN i_close --></span><!-- END i_close -->

<!-- BEGIN color_open --><span style="color: {COLOR}"><!-- END color_open -->
<!-- BEGIN color_close --></span><!-- END color_close -->

<!-- BEGIN glow_open --> <span style="filter: glow(color={GLOWCOLOR}); height:20"> <!-- END glow_open --> 
<!-- BEGIN glow_close --> </span> <!-- END glow_close --> 

<!-- BEGIN shadow_open --> <span style="filter: shadow(color={SHADOWCOLOR}); height:20"> <!-- END shadow_open --> 
<!-- BEGIN shadow_close --> </span> <!-- END shadow_close -->

<!-- BEGIN size_open --><span style="font-size: {SIZE}px; line-height: normal"><!-- END size_open -->
<!-- BEGIN size_close --></span><!-- END size_close -->

<!-- BEGIN align_open --><div style="text-align:{ALIGN}"><!-- END size_open -->
<!-- BEGIN align_close --></div><!-- END align_close -->

<!-- BEGIN img --><img src="{URL}" border="0" /><!-- END img -->

<!-- BEGIN flash --> 
<!-- URL's used in the movie--> 
<!-- text used in the movie--> 
<!-- --> 
<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" 
codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0" 
WIDTH={WIDTH} HEIGHT={HEIGHT}> 
<PARAM NAME=movie VALUE="{URL}"> <PARAM NAME=loop VALUE={LOOP}> <PARAM NAME=quality VALUE=high> <PARAM NAME=scale VALUE=noborder> <PARAM NAME=wmode VALUE=transparent> <PARAM NAME=bgcolor VALUE=#000000> <EMBED src="{URL}" loop={LOOP} quality=high scale=noborder wmode=transparent bgcolor=#000000  WIDTH={WIDTH} HEIGHT={HEIGHT} TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash"></EMBED> 
</OBJECT> 
<!-- END flash -->

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

<!-- BEGIN email --><a href="mailto:{EMAIL}">{EMAIL}</A><!-- END email -->

THANKX

Verfasst: 22.10.2002 20:50
von esperitox
Du musst doch einfach nur vor <a href.... <img src..... einfügen so:

Ist der letzte teil aus der Mod Anleitung
// make the file links clickable - eDonkey MOD
$ret = preg_replace("#([\n ])(ed2k://\|file\|(.*)\|\d+\|\w+\|/?)#", "\\1<img src=\"Der_Pfad_zu_deinem_Bild\" width=\"15\" height=\"15\"> <a href=\"\\2\">\\3</a>", $ret);

// make the server links clickable - eDonkey MOD
$ret = preg_replace("#([\n ])(ed2k:(//)?\|server\|([\d\.]+)\|(\d+)\|/?)#", "\\1<img src=\"Der_Pfad_zu_deinem_Bild\" width=\"15\" height=\"15\"> <a href=\"\\2\">\\4 at \\5 </a>", $ret);
esperitox

Verfasst: 22.10.2002 21:18
von Gast
HI

erstmal vielen dank für Deine mühe!

leider komme ich nicht mehr in meine Foren und das Portal rein!!!

hast du ne idee woran das liegt???

Verfasst: 22.10.2002 22:38
von esperitox
Versuchs mal so:

Code: Alles auswählen

// make the file links clickable - eDonkey MOD 
$ret = preg_replace("#([\n ])(ed2k://\|file\|(.*)\|\d+\|\w+\|/?)#", "\\1<img src="Der_Pfad_zu_deinem_Bild" width="15" height="15"> <a href=\"\\2\">\\3</a>", $ret); 

// make the server links clickable - eDonkey MOD 
$ret = preg_replace("#([\n ])(ed2k:(//)?\|server\|([\d\.]+)\|(\d+)\|/?)#", "\\1<img src="Der_Pfad_zu_deinem_Bild" width="15" height="15"> <a href=\"\\2\">\\4 at \\5 </a>", $ret); 
esperitox

Verfasst: 22.10.2002 22:39
von Gast
HI

SORRY!!! mein Fehler :oops: :oops: :oops:

Hat super gefunzt!!!!

BIG THANKX

Verfasst: 26.10.2002 14:34
von Gast
esperitox hat geschrieben:Versuchs mal so:

Code: Alles auswählen

// make the file links clickable - eDonkey MOD 
$ret = preg_replace("#([\n ])(ed2k://\|file\|(.*)\|\d+\|\w+\|/?)#", "\\1<img src="Der_Pfad_zu_deinem_Bild" width="15" height="15"> <a href="\\2">\\3</a>", $ret); 

// make the server links clickable - eDonkey MOD 
$ret = preg_replace("#([\n ])(ed2k:(//)?\|server\|([\d\.]+)\|(\d+)\|/?)#", "\\1<img src="Der_Pfad_zu_deinem_Bild" width="15" height="15"> <a href="\\2">\\4 at \\5 </a>", $ret); 
esperitox
Hallo,

sobald ich versuche genau diesen Bereich zu ändern, ist es bei mir nicht mehr möglich zu posten. Es kommen dann nur noch Fehlermeldungen die auf diesen Bereich in der bbcode.php hinweisen.

hier mal der Auszug meiner bbcode.php:
// make the file links clickable - eDonkey MOD
$ret = preg_replace("#([\n ])(ed2k://\|file\|(.*)\|\d+\|\w+\|/?)#", "\\1<img src="images/e.gif"> <a href="\\2">\\3</a>", $ret);

// make the server links clickable - eDonkey MOD
$ret = preg_replace("#([\n ])(ed2k:(//)?\|server\|([\d\.]+)\|(\d+)\|/?)#", "\\1<img src="images/e.gif"> <a href="\\2">\\4 at \\5 </a>", $ret);

Verfasst: 21.11.2002 21:44
von neo_ths
Bei mir gehts auch nicht ! :cry:


©Neo

Verfasst: 11.12.2002 14:45
von New Primax
cool danke bei mir funst es*freu*