Pagina 1 van 1

[you] hack probleem

Geplaatst: 20 jul 2006, 10:23
door Princess Peach
Wat is het probleem?

Voor de [you]-hack heb ik de Multiple BBcode mod geïnstalleerd en deze werkte goed.
Toen ik de [you]-hack zelf installeerde kreeg ik eerst een error:

Code: Selecteer alles

Parse error: parse error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or ...../phpBB2/includes/bbcode.php on line 140 
Ik heb toen in bbcode.php het volgende aangepast:

Code: Selecteer alles

$bbcode_tpl['you'] = str_replace('{YOU}', "' . $userdata['username'] . '", $bbcode_tpl['you']); 
verandert in;

Code: Selecteer alles

$bbcode_tpl['you'] = str_replace('{YOU}', $userdata['username'], $bbcode_tpl['you']); 
Nu krijg ik nog steeds errors:

Code: Selecteer alles

Parse error: parse error in /data/members/free/tripod/nl/t/h/e/theisland/htdocs/includes/bbcode.php(257) : regexp code on line 1 

Fatal error: Failed evaluating code: The Red Queen in /data/members/free/tripod/nl/t/h/e/theisland/htdocs/includes/bbcode.php on line 257 
(The Red Queen is mijn username)

Ik heb alles stap voor stap gevolgd, ik weet niet wat ik verkeerd heb gedaan.
Dit is my bbcode
and dit is de bbcode in templates.

Wanneer ontstond het probleem?
Gisteren, toen ik bbcode.php had aangepast

phpBB versie:
2.0.21

Heb je onlangs een andere mod of stijl geïnstalleerd?
Ja, Multiple BBCode

Heb je gezocht naar een antwoord?
Op verscheidene fora gezocht (zoekfunctie/bladeren), google, phbpp websites.

Geplaatst: 20 jul 2006, 11:02
door Princess Peach
Ik wil dus gewoon een bbcode invoeren voor de naam van de lezer.
Maar zonder dat gebruikers kunnen zien wat deze is.
Dus een bbcode die je alleen kunt gebruiken als je hem weet.

Geplaatst: 20 jul 2006, 11:12
door ElbertF
Gelieve niet te bumpen binnen 24 uur.

Ik zie zo snel geen fout, heb je de aanpassingen van de mod al een keer gecontroleerd (helemaal nagelopen)?

Geplaatst: 20 jul 2006, 11:14
door Princess Peach
Sorry,
Ja 3x

Code: Selecteer alles

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

#
#-----[ FIND ]------------------------------------------
#
	$bbcode_tpl['email'] = str_replace('{EMAIL}', '\\1', $bbcode_tpl['email']);
#
#-----[ AFTER, ADD ]------------------------------------------
#

  global $userdata;
  $bbcode_tpl['you'] = str_replace('{YOU}', "' . $userdata['username'] . '", $bbcode_tpl['you']);
#
#-----[ FIND ]------------------------------------------
#
	$replacements[] = $bbcode_tpl['email'];
#
#-----[ AFTER, ADD ]------------------------------------------
#
	
	// [you] - inserts the name of the person viewing the post
	$patterns[] = "#\[you\]#ise";
	$replacements[] = $bbcode_tpl['you'];
#
#-----[ OPEN ]------------------------------------------ 
#
templates/subSilver/bbcode.tpl
    
#
#-----[ FIND ]------------------------------------------ 
#
<!-- BEGIN  --><a href="mailto:{EMAIL}">{EMAIL}</A><!-- END email -->
#
#-----[ AFTER, ADD ]------------------------------------------ 
#

<!-- BEGIN you -->{YOU}<!-- END you -->
#
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------ 
#
# EoM
Heb ik ergens overheen gekeken?

Ik weet niet veel van php af, bijna niks actually.
Ja, ik ga een boek kopen om het te leren (is er een php voor dummies?).
Ja, het liefst vandaag nog.
Heeft iemand een aanrader?

Geplaatst: 23 jul 2006, 09:56
door Princess Peach
Meer dan 24 uur voorbij.
Ligt het misschien aan de mod multiple BBcode in combinatie met de [you]?

Code: Selecteer alles

# 
#-----[ OPEN ]---------------------------------
# 
posting.php


# 
#-----[ FIND ]---------------------------------
#
#  NOTE - the full line to look for is:
# make_jumpbox('viewforum.'.$phpEx);
#
make_jumpbox(


# 
#-----[ AFTER, ADD ]---------------------------------
#
Multi_BBCode();

# 
#-----[ OPEN ]---------------------------------
# 
privmsg.php


# 
#-----[ FIND ]---------------------------------
#
	generate_smilies('inline', PAGE_PRIVMSGS);


# 
#-----[ AFTER, ADD ]---------------------------------
#
Multi_BBCode();

# 
#-----[ OPEN ]---------------------------------
#
includes/bbcode.php
# 
#-----[ FIND ]---------------------------------
#
$bbcode_tpl = null;
# 
#-----[ AFTER, ADD ]---------------------------------
#

// MULTI BBCODE-begin
function Multi_BBCode()
{
	global $template, $lang;

	// DO NOT CHANGE THIS ARRAY
	$hotkeys = array('', 'd', 'e', 'g', 'h', 'j', 'k', 'm', 'n', 'r', 't', 'v', 'x', 'y', 'z', '1', '2', '3', '4', '5', '6', '7', '8', '9', '0');

	//NOTE: the first element of each array must be ''   Add new elements AFTER the ''
	$EMBB_widths = array('') ;
	$EMBB_values = array('') ;
	for ($i=1; $i<count($EMBB_values); $i++)
	{
		// load BBcode MODs info
		$val = ($i*2)+16 ;
		$help_lang = ( !empty($lang['bbcode_help'][(strtolower($EMBB_values[$i]))]) ) ? $lang['bbcode_help'][(strtolower($EMBB_values[$i]))] : $lang['bbcode_help'][$EMBB_values[$i]];
		$template->assign_block_vars('MultiBB', array(
			'KEY' => $hotkeys[$i],
			'NAME' => "addbbcode$val",
			'HELP' => sprintf($help_lang, $hotkeys[$i]),
			'WIDTH' => $EMBB_widths[$i],
			'VALUE' => $EMBB_values[$i],
			'STYLE' => "bbstyle($val)")
		);
	}
}
// MULTI BBCODE-end

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


#
#-----[ FIND ]---------------------------------
#
f_help = "{L_BBCODE_F_HELP}";

# 
#-----[ AFTER, ADD ]---------------------------------
#
<!-- BEGIN MultiBB -->
{MultiBB.VALUE}_help = "{MultiBB.HELP}";
<!-- END MultiBB -->

#
#-----[ FIND ]---------------------------------
#
#  NOTE - the full line to look for is:
#			  <input type="button" class="button" accesskey="w" name="addbbcode16" value="URL" style="text-decoration: underline; width: 40px" onClick="bbstyle(16)" onMouseOver="helpline('w')" />
#			  </span></td>
#
	name="addbbcode16"
	</td>

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

			<!-- BEGIN MultiBB -->
			<td><span class="genmed">
			  <input type="button" class="button" accesskey="{MultiBB.KEY}" name="{MultiBB.NAME}" value="{MultiBB.VALUE}" style="width: {MultiBB.WIDTH}px" onClick="{MultiBB.STYLE}" onMouseOver="helpline('{MultiBB.VALUE}')" />
			  </span></td>
			<!-- END MultiBB -->
# 
#-----[ FIND ]---------------------------------
#
#  NOTE - the full line to look for is:
#					<select name="addbbcodefontcolor" onChange="bbfontstyle('[color=' + this.form.addbbcodefontcolor.options[this.form.addbbcodefontcolor.selectedIndex].value + ']', '[/color]')" onMouseOver="helpline('s')">
#
	name="addbbcode18"


# 
#-----[ IN-LINE FIND ]---------------------------------
#
name="addbbcode18"


# 
#-----[ IN-LINE REPLACE WITH ]---------------------------------
#
name="addbbcodefontcolor"


# 
#-----[ IN-LINE FIND ]---------------------------------
#
this.form.addbbcode18.options


# 
#-----[ IN-LINE REPLACE WITH ]---------------------------------
#
this.form.addbbcodefontcolor.options


# 
#-----[ IN-LINE FIND ]---------------------------------
#
this.form.addbbcode18.selectedIndex


# 
#-----[ IN-LINE REPLACE WITH ]---------------------------------
#
this.form.addbbcodefontcolor.selectedIndex


# 
#-----[ FIND ]---------------------------------
#
#  NOTE - the full line to look for is:
#					</select> &nbsp;{L_FONT_SIZE}:<select name="addbbcodefontsize" onChange="bbfontstyle('[size=' + this.form.addbbcodefontsize.options[this.form.addbbcodefontsize.selectedIndex].value + ']', '[/size]')" onMouseOver="helpline('f')">
#
	name="addbbcode20"

# 
#-----[ IN-LINE FIND ]---------------------------------
#
name="addbbcode20"


# 
#-----[ IN-LINE REPLACE WITH ]---------------------------------
#
name="addbbcodefontsize"


# 
#-----[ IN-LINE FIND ]---------------------------------
#
this.form.addbbcode20.options


# 
#-----[ IN-LINE REPLACE WITH ]---------------------------------
#
this.form.addbbcodefontsize.options


# 
#-----[ IN-LINE FIND ]---------------------------------
#
this.form.addbbcode20.selectedIndex


# 
#-----[ IN-LINE REPLACE WITH ]---------------------------------
#
this.form.addbbcodefontsize.selectedIndex

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

# 
#-----[ FIND ]---------------------------------
#
#  NOTE - the full line to look for is:
#	$lang['bbcode_f_help'] = 'Font size: [size=x-small]small text[/size]';
#
$lang['bbcode_f_help']

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

//
// bbcode help format goes like this
// $lang['bbcode_help']['value'] = 'BBCode Name: Info (Alt+%s)';
//
// value is what you put in $EMBB_values in posting.php
// %s gets replaced with the automatic hotkey that the bbcode gets assigned
//
$lang['bbcode_help']['value'] = 'BBCode Name: Info (Alt+%s)';

#
#-----[ SAVE/CLOSE ALL FILES ]---------------------------------
#
# EoM
(zie eerste post voor bbcode.php op mijn forum)
Ik hoop dat iemand hier de tijd voor wil nemen. Ik zal je erg dankbaar zijn!!!

Het gaat dus om dit regeltje:

Code: Selecteer alles

$text = preg_replace($patterns, $replacements, $text);