Pagina 1 van 1

Portal probleem na instaleren Mouse Over Topic Preview

Geplaatst: 13 mar 2005, 11:28
door Muiter
Fatal error: Cannot redeclare bbencode_strip() (previously declared in /home/virtual/site78/fst/var/www/html/forum/fetchposts.php:212) in /home/virtual/site78/fst/var/www/html/forum/includes/bbcode.php on line 788

Code: Selecteer alles

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

#
#-----[ FIND, at end of file ]---------------------------------------------
#
function smiley_sort($a, $b)
{
	if ( strlen($a['code']) == strlen($b['code']) )
	{
		return 0;
	}

	return ( strlen($a['code']) > strlen($b['code']) ) ? -1 : 1;
}

#
#-----[ AFTER, ADD ]--------------------------------------- 
#
//
// Function strip all BBcodes (borrowed from Mouse Hover Topic Preview MOD)
//
function bbencode_strip($text, $uid)
{
	// pad it with a space so we can distinguish between FALSE and matching the 1st char (index 0).
	// This is important; bbencode_quote(), bbencode_list(), and bbencode_code() all depend on it.
	$text = " " . $text;

	// First: If there isn't a "[" and a "]" in the message, don't bother.
	if (! (strpos($text, "[") && strpos($text, "]")) )
	{
		// Remove padding, return.
		$text = substr($text, 1);
		return $text;
	}

	// [code] and [ /CODE ] for posting code (HTML, PHP, C etc etc) in your posts.
	$text = str_replace("[code:1:$uid]","", $text);
	$text = str_replace("[/code:1:$uid]", "", $text);
	$text = str_replace("[code:$uid]", "", $text);
	$text = str_replace("[/code:$uid]", "", $text);

	// [quote] and [/quote] for posting replies with quote, or just for quoting stuff.
	$text = str_replace("[quote:1:$uid]","", $text);
	$text = str_replace("[/quote:1:$uid]", "", $text);
	$text = str_replace("[quote:$uid]", "", $text);
	$text = str_replace("[/quote:$uid]", "", $text);
	// New one liner to deal with opening quotes with usernames...
	// replaces the two line version that I had here before..
	$text = preg_replace("/\[quote:$uid=(?:\"?([^\"]*)\"?)\]/si", "", $text);
	$text = preg_replace("/\[quote:1:$uid=(?:\"?([^\"]*)\"?)\]/si", "", $text);

	// [list] and [list=x] for (un)ordered lists.
	// unordered lists
	$text = str_replace("[list:$uid]", "", $text);
	// li tags
	$text = str_replace("[*:$uid]", "", $text);
	// ending tags
	$text = str_replace("[/list:u:$uid]", "", $text);
	$text = str_replace("[/list:o:$uid]", "", $text);
	// Ordered lists
	$text = preg_replace("/\[list=([a1]):$uid\]/si", "", $text);

	// colours
	$text = preg_replace("/\[color=(\#[0-9A-F]{6}|[a-z]+):$uid\]/si", "", $text);
	$text = str_replace("[/color:$uid]", "", $text);

	// url #2
	$text = str_replace("[url]","", $text);
	$text = str_replace("[/url]", "", $text);

	// url /\[url=([a-z0-9\-\.,\?!%\*_\/:;~\\&$@\/=\+]+)\](.*?)\[/url\]/si
	$text = preg_replace("/\[url=([a-z0-9\-\.,\?!%\*_\/:;~\\&$@\/=\+]+)\]/si", "", $text);
	$text = str_replace("[/url:$uid]", "", $text);

	// img
	$text = str_replace("[img:$uid]","", $text);
	$text = str_replace("[/img:$uid]", "", $text);

	// email
	$text = str_replace("[email:$uid]","", $text);
	$text = str_replace("[/email:$uid]", "", $text);

	// size
	$text = preg_replace("/\[size=([\-\+]?[1-2]?[0-9]):$uid\]/si", "", $text);
	$text = str_replace("[/size:$uid]", "", $text);

	// align
	$text = preg_replace("/\[align=(left|right|center|justify):$uid\]/si", "", $text);
	$text = str_replace("[/align:$uid]", "", $text);

	// [b] and [/b] for bolding text.
	$text = str_replace("[b:$uid]","", $text);
	$text = str_replace("[/b:$uid]", "", $text);

	// [u] and [/u] for underlining text.
	$text = str_replace("[u:$uid]", "", $text);
	$text = str_replace("[/u:$uid]", "", $text);

	// [i] and [/i] for italicizing text.
	$text = str_replace("[i:$uid]", "", $text);
	$text = str_replace("[/i:$uid]", "", $text);

	// Remove our padding from the string..
	$text = substr($text, 1);

	return $text;
}
Iemand bekend met dit probleem?

Geplaatst: 13 mar 2005, 11:37
door Paul
nee, maar ik weet wel een oplossing.
open:
fetchposts.php:
zoek:

Code: Selecteer alles

function bbencode_strip($text, $uid)
{
en vervang door:

Code: Selecteer alles

/*function bbencode_strip($text, $uid)
{
en zoek:

Code: Selecteer alles

	return $text;
}
en vervang door:

Code: Selecteer alles

	return $text;
}*/

Geplaatst: 13 mar 2005, 11:44
door Muiter
paulus schreef:nee, maar ik weet wel een oplossing.
:thumb:

Geplaatst: 13 mar 2005, 11:45
door Paul
Werkt ie? Want je haalt nu een bestaande functie die je in fetchposts had zitten weg, en plaatst hem in bbcode.php :lol:

Geplaatst: 13 mar 2005, 12:03
door Muiter
Alles lijkt goed te werken, dit kan geen problemen opleveren?

Geplaatst: 13 mar 2005, 12:04
door Paul
Muiter schreef:Alles lijkt goed te werken, dit kan geen problemen opleveren?
Het kan alleen een probleem op de portal opleveren wanneer bbcode.php neit wordt geincluded.