BBCode Button erstellen ?

Du hast Probleme beim Einbau oder bei der Benutzung eines Mods? In diesem Forum bist du richtig.
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
~Alonso~
Mitglied
Beiträge: 293
Registriert: 22.10.2005 20:13
Wohnort: Saarland
Kontaktdaten:

BBCode Button erstellen ?

Beitrag von ~Alonso~ »

HI habe folgendes Problem habe z.b den Hangman Mod drin und dort gibt es auch das ganze als BBcode der Code funzt auch aber Button bekomme ich keinen angezeigt.

Wie erstellt man einen BBcode Button?

Hier mal die wie es n de Anleitung steht.

Code: Alles auswählen

##############################################################
## MOD Title: Hangman Mod BBCODE Addon
## MOD Author: unTouched < p.s16@web.de > Pete® http://pete.dsl-inet.com/
## MOD Description: 	Adds you the 
##			[hangman]WORD[/hangman] and 
##			[hangman=game_index]Hangman[/hangman]
##			BBCODE (only works with Hangman Mod 1.3.0)
## MOD Version: 0.0.2
##
## MOD phpBB Version needed:	
##				phpbb 2.0.x or phpbbPlus 1.5x
##
## Installation Level:  Extreme hard :D
## Installation Time: 	3 Minutes
## Files To Edit: 	bbcode.php
##			templates/fisubsilversh/bbcode.tpl
##
## Included Files: 	none
##
##
##############################################################
#############################################################
## Author Notes:	Have a lot of fun, questions and ideas
##			relating this mod could be posted in the
##			support forum.
##
##############################################################
## MOD History:
##
##	23-09-2004: 0.0.1 only a try for people can't awaiting it ;)
##		- only the window an [hangman] bbcode ;) works on every bbcode page... no anti
##		spam inside!!! please note that users using 
##		[hangman]wort1[/hangman][hangman]wort2[/hangman][hangman]wort3[/hangman]...
##		could spam your DB if you don't adjust a games_per_day Limitation
##		... this will be fixed in next version
##	22-10-2004: 0.0.2 working version without bugs( i hope ;) )
##		- fixed bug creating a hangman each preview u try
##		- fixed bug doubles in DB
##		- fixed bug - user_id failes on creating...
##############################################################
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD
##############################################################
#
#-----[ OPEN ] ------
#
includes/bbcode.php
#
#-----[ FIND ] ------
#
define("BBCODE_UID_LEN", 10);
#
#-----[AFTER,ADD] -----
#
define('IN_HANGMAN',true);
include($phpbb_root_path.'includes/functions_hangman.php');
#
#-----[ FIND ] ------
#
	define("BBCODE_TPL_READY", true);
#
#-----[BEFORE,ADD] -----
#
	//HANGMAN
	$bbcode_tpl['hangman'] = str_replace('{ID}','\\1',"'".$bbcode_tpl['hangman']."'");
#
#-----[ FIND ] ------
# AT THE END OF BBCODE SECOND PASS FUNCTION
	// Remove our padding from the string..
	$text = substr($text, 1);
#
#-----[BEFORE,ADD] -----
#
	// Hangman bbcode Addon [hangman=][/hangman]
	$patterns[] 	= 	"#\[hangman=([0-9]+):$uid\](.*?)\[/hangman:$uid\]#sie";
	$replacements[] = 	$bbcode_tpl['hangman'];
	$text = preg_replace($patterns, $replacements, $text);
#
#-----[ FIND ] ------
#AT THE END OF BBCODE FIRST PASS FUNCTION
	// Remove our padding from the string..
	return substr($text, 1);

#-----[BEFORE,ADD] -----
#
	//Hangman bbcode Addon
 	$text = bbencode_first_pass_pda($text, $uid, "#\[hangman\]#si", '[/hangman]', '', false, 'phpbb_new_hang'," ");
	$text = preg_replace("#\[hangman=([0-9]+)\](.*?)\[/hangman\]#si", "[hangman=\\1:$uid]\\2[/hangman:$uid]", $text);
#
#-----[ OPEN ] ------
#
templates/fisubsilversh/bbcode.tpl
#
#-----[ FIND ] -----
#
<!-- BEGIN email --><a href="mailto:{EMAIL}">{EMAIL}</a><!-- END email -->
#
#-----[ AFTER, ADD ] -----
#
<!-- BEGIN hangman --><a href="hangman.php?mode=window&game_index={ID}" onclick="var ref = window.open(\'hangman.php?mode=window&game_index={ID}\',\'_hangman\', \'HEIGHT=400, resizeable=no,scrollbars=no,WIDTH=720\');ref.focus();return false" target="_hangman" class="postlink">Hangman</a><!-- END hangman -->
#
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------
# EofM
# Enjoy
# Pete®
Benutzeravatar
~Alonso~
Mitglied
Beiträge: 293
Registriert: 22.10.2005 20:13
Wohnort: Saarland
Kontaktdaten:

Beitrag von ~Alonso~ »

Weis keiner warum ich den Button nicht angezeigt bekomme ?

So sieht meinen bbcode.tpl aus

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

<!-- BEGIN img --><img src="{URL}" border="0" /><!-- END img -->
<!-- BEGIN img2 --><a href="preview.php?path={URL}" target="_blank" alt="{L_OPEN_IN_NEW_WINDOW}" title="{L_OPEN_IN_NEW_WINDOW}"><img src="{THUMBNAIL}" border="0" /></a><!-- END img2 -->

<!-- BEGIN url --><a href="out.php?url={URL}" target="_blank" class="postlink">{DESCRIPTION}</a><!-- END url -->
<!-- BEGIN url_ebay --><a href="http://partners.webmasterplan.com/click.asp?ref=262766&site=1382&type=text&tnb=23&diurl={URL}" target="_blank" class="postlink">{DESCRIPTION}</a><!-- END url_ebay -->

<!-- BEGIN email --><a href="mailto:{EMAIL}">{EMAIL}</a><!-- END email --> 
<!-- BEGIN schild --><img src="{URL}" border="0"><!-- END schild -->

<!-- BEGIN hangman --><a href="hangman.php?mode=window&game_index={ID}" onclick="var ref = window.open(\'hangman.php?mode=window&game_index={ID}\',\'_hangman\', \'HEIGHT=400, resizeable=no,scrollbars=no,WIDTH=720\');ref.focus();return false" target="_hangman" class="postlink">Hangman</a><!-- END hangman -->
Benutzeravatar
Endres
Mitglied
Beiträge: 70
Registriert: 19.11.2005 12:18
Wohnort: Wuppertal
Kontaktdaten:

php statt tpl

Beitrag von Endres »

Das müsste in der bbcode.php stehen nicht in der tpl... vllt ist es aber auch richtig
Benutzeravatar
~Alonso~
Mitglied
Beiträge: 293
Registriert: 22.10.2005 20:13
Wohnort: Saarland
Kontaktdaten:

Beitrag von ~Alonso~ »

Also so steht es in der Anleitung

Code: Alles auswählen

#-----[ OPEN ] ------
#
includes/bbcode.php
#
#-----[ FIND ] ------
#
define("BBCODE_UID_LEN", 10);
#
#-----[AFTER,ADD] -----
#
define('IN_HANGMAN',true);
include($phpbb_root_path.'includes/functions_hangman.php');
#
#-----[ FIND ] ------
#
	define("BBCODE_TPL_READY", true);
#
#-----[BEFORE,ADD] -----
#
	//HANGMAN
	$bbcode_tpl['hangman'] = str_replace('{ID}','\\1',"'".$bbcode_tpl['hangman']."'");
#
#-----[ FIND ] ------
# AT THE END OF BBCODE SECOND PASS FUNCTION
	// Remove our padding from the string..
	$text = substr($text, 1);
#
#-----[BEFORE,ADD] -----
#
	// Hangman bbcode Addon [hangman=][/hangman]
	$patterns[] 	= 	"#\[hangman=([0-9]+):$uid\](.*?)\[/hangman:$uid\]#sie";
	$replacements[] = 	$bbcode_tpl['hangman'];
	$text = preg_replace($patterns, $replacements, $text);
#
#-----[ FIND ] ------
#AT THE END OF BBCODE FIRST PASS FUNCTION
	// Remove our padding from the string..
	return substr($text, 1);

#-----[BEFORE,ADD] -----
#
	//Hangman bbcode Addon
 	$text = bbencode_first_pass_pda($text, $uid, "#\[hangman\]#si", '[/hangman]', '', false, 'phpbb_new_hang'," ");
	$text = preg_replace("#\[hangman=([0-9]+)\](.*?)\[/hangman\]#si", "[hangman=\\1:$uid]\\2[/hangman:$uid]", $text);
#
#-----[ OPEN ] ------
#
templates/fisubsilversh/bbcode.tpl
#
#-----[ FIND ] -----
#
<!-- BEGIN email --><a href="mailto:{EMAIL}">{EMAIL}</a><!-- END email -->
#
#-----[ AFTER, ADD ] -----
#
<!-- BEGIN hangman --><a href="hangman.php?mode=window&game_index={ID}" onclick="var ref = window.open(\'hangman.php?mode=window&game_index={ID}\',\'_hangman\', \'HEIGHT=400, resizeable=no,scrollbars=no,WIDTH=720\');ref.focus();return false" target="_hangman" class="postlink">Hangman</a><!-- END hangman -->
#
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------
bbcodes.php hänge ich gleich mal an
Benutzeravatar
Dr.Death
Moderator
Moderator
Beiträge: 17476
Registriert: 23.04.2003 08:22
Wohnort: Xanten
Kontaktdaten:

Beitrag von Dr.Death »

Da fehlen noch Änderungen an der posting_body.tpl

Schau mal in dieses MOD hinein, dort wird erklärt wie man einen zusätzlichen Butten erstellt.

http://www.phpbb.de/moddb/bbcode_through
Benutzeravatar
~Alonso~
Mitglied
Beiträge: 293
Registriert: 22.10.2005 20:13
Wohnort: Saarland
Kontaktdaten:

Beitrag von ~Alonso~ »

Oki Danke

Habs so gemacht und hat direkt geklappt ;-)
Antworten

Zurück zu „phpBB 2.0: Mod Support“