Página 1 de 1

Error en instalacion Advanced ABBC3  Tema Solucionado

Publicado: 13 Sep 2010, 21:46
por KRUSCHEV
Todo bien instalado, incluso vi el nuevo editor pero al ir al inicio del foro me da este error y si quiero entrar en el tambien

Fatal error: Cannot redeclare class bbcode in /home/emulered/public_html/foro/includes/bbcode.php on line 29

Edito: mire el archivo y faltaba una linea pero ahora me da este error:


Parse error: syntax error, unexpected T_CLASS, expecting '{' in /home/emulered/public_html/foro/includes/bbcode.php on line 36

Re: Error en instalacion Advanced ABBC3

Publicado: 13 Sep 2010, 22:00
por leviatan21
Evidentemente la edición no salió bien para el archivo raíz/includes/bbcode.php
Te coloco aqui como debería verse las primeras lineas modificadas, así las comparas con las tuyas :

Código: Seleccionar todo

// MOD : MSSTI ABBC3 - Start
if (!class_exists('abbcode'))
{
    include($phpbb_root_path . 'includes/abbcode.' . $phpEx);
}
/**
* BBCode class
* @package phpBB3
*/
// class bbcode
class bbcode extends abbcode
// MOD : MSSTI ABBC3 - end
{
    var $bbcode_uid = '';

Re: Error en instalacion Advanced ABBC3

Publicado: 13 Sep 2010, 22:05
por KRUSCHEV
correcto me sale tal cual y el error es el primero el segundo no cuenta el archivo estaba bien editado

Re: Error en instalacion Advanced ABBC3

Publicado: 13 Sep 2010, 22:08
por leviatan21
KRUSCHEV escribió:correcto me sale tal cual y el error es el primero el segundo no cuenta el archivo estaba bien editado
Si aún no lo resuelves, adjunta tu archivo aquí y me encargaré de revisarlo

Re: Error en instalacion Advanced ABBC3

Publicado: 13 Sep 2010, 22:14
por KRUSCHEV
Nada yo lo veo bien te lo adjunto

Edito: no se como subirlo sin que sea asi, lo siento. Otra cosa no se si es importante o no, solo pasa en el indice general el resto se ve bien.

Código: Seleccionar todo

<?php
/**
*
* @package phpBB3
* @version $Id$
* @copyright (c) 2005 phpBB Group
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
*
*/

/**
* @ignore
*/
if (!defined('IN_PHPBB'))
{
	exit;
}

// MOD : MSSTI ABBC3 - Start
if (!class_exists('abbcode'))
{
	include($phpbb_root_path . 'includes/abbcode.' . $phpEx);
}
/**
* BBCode class
* @package phpBB3
*/
// class bbcode
class bbcode extends abbcode
// MOD : MSSTI ABBC3 - end
{
	var $bbcode_uid = '';
	var $bbcode_bitfield = '';
	var $bbcode_cache = array();
	var $bbcode_template = array();

	var $bbcodes = array();

	var $template_bitfield;
	var $template_filename = '';

	/**
	* Constructor
	* Init bbcode cache entries if bitfield is specified
	*/
	function bbcode($bitfield = '')
	{
		if ($bitfield)
		{
			$this->bbcode_bitfield = $bitfield;
			$this->bbcode_cache_init();
		}
	}

	/**
	* Second pass bbcodes
	*/
	function bbcode_second_pass(&$message, $bbcode_uid = '', $bbcode_bitfield = false)
	{
		if ($bbcode_uid)
		{
			$this->bbcode_uid = $bbcode_uid;
		}

		if ($bbcode_bitfield !== false)
		{
			$this->bbcode_bitfield = $bbcode_bitfield;

			// Init those added with a new bbcode_bitfield (already stored codes will not get parsed again)
			$this->bbcode_cache_init();
		}

		if (!$this->bbcode_bitfield)
		{
			// Remove the uid from tags that have not been transformed into HTML
			if ($this->bbcode_uid)
			{
				$message = str_replace(':' . $this->bbcode_uid, '', $message);
			}

			return;
		}

		$str = array('search' => array(), 'replace' => array());
		$preg = array('search' => array(), 'replace' => array());

		$bitfield = new bitfield($this->bbcode_bitfield);
		$bbcodes_set = $bitfield->get_all_set();


// MOD : MSSTI ABBC3 - Start
		// Try to avoid duplicates anchor ID's inside quotes
		if (preg_match('#\[quote(?:="(.*?)")?:' . $this->bbcode_uid . '\](.*?)?\[anchor(=(.*?)([\s]?))?#is', $message))
		{
			$message = preg_replace('#(\[quote(?:="(.*?)")?:' . $this->bbcode_uid . '\](.*?))?\[anchor((=|)(.*?)([\s]))?#is',"$1[anchor$5quoted$6$7", $message);
		}
// MOD : MSSTI ABBC3 - End
		$undid_bbcode_specialchars = false;
		foreach ($bbcodes_set as $bbcode_id)
		{
			if (!empty($this->bbcode_cache[$bbcode_id]))
			{
				foreach ($this->bbcode_cache[$bbcode_id] as $type => $array)
				{
					foreach ($array as $search => $replace)
					{
						${$type}['search'][] = str_replace('$uid', $this->bbcode_uid, $search);
						${$type}['replace'][] = $replace;
					}

					if (sizeof($str['search']))
					{
						$message = str_replace($str['search'], $str['replace'], $message);
						$str = array('search' => array(), 'replace' => array());
					}

					if (sizeof($preg['search']))
					{
						// we need to turn the entities back into their original form to allow the
						// search patterns to work properly
						if (!$undid_bbcode_specialchars)
						{
							$message = str_replace(array('&#58;', '&#46;'), array(':', '.'), $message);
							$undid_bbcode_specialchars = true;
						}

						$message = preg_replace($preg['search'], $preg['replace'], $message);
						$preg = array('search' => array(), 'replace' => array());
					}
				}
			}
		}

		// Remove the uid from tags that have not been transformed into HTML
		$message = str_replace(':' . $this->bbcode_uid, '', $message);
	}

	/**
	* Init bbcode cache
	*
	* requires: $this->bbcode_bitfield
	* sets: $this->bbcode_cache with bbcode templates needed for bbcode_bitfield
	*/
	function bbcode_cache_init()
	{
		global $phpbb_root_path, $template, $user;

		if (empty($this->template_filename))
		{
			$this->template_bitfield = new bitfield($user->theme['bbcode_bitfield']);
			$this->template_filename = $phpbb_root_path . 'styles/' . $user->theme['template_path'] . '/template/bbcode.html';

			if (!@file_exists($this->template_filename))
			{
				if (isset($user->theme['template_inherits_id']) && $user->theme['template_inherits_id'])
				{
					$this->template_filename = $phpbb_root_path . 'styles/' . $user->theme['template_inherit_path'] . '/template/bbcode.html';
					if (!@file_exists($this->template_filename))
					{
						trigger_error('The file ' . $this->template_filename . ' is missing.', E_USER_ERROR);
					}
				}
				else
				{
					trigger_error('The file ' . $this->template_filename . ' is missing.', E_USER_ERROR);
				}
			}

// MOD : MSSTI ABBC3 - Start
			$this->template_filename2 = $phpbb_root_path . 'styles/' . $user->theme['template_path'] . '/template/abbcode.html';

			if (!@file_exists($this->template_filename2))
			{
				if (isset($user->theme['template_inherits_id']) && $user->theme['template_inherits_id'])
				{
					$this->template_filename2 = $phpbb_root_path . 'styles/' . $user->theme['template_inherit_path'] . '/template/abbcode.html';
					if (!@file_exists($this->template_filename2))
					{
						trigger_error('The file ' . $this->template_filename2 . ' is missing.', E_USER_ERROR);
					}
				}
				else
				{
					trigger_error('The file ' . $this->template_filename2 . ' is missing.', E_USER_ERROR);
				}
			}
// MOD : MSSTI ABBC3 - End
		}

		$bbcode_ids = $rowset = $sql = array();


// MOD : MSSTI ABBC3 - Start
		$abbcode = new abbcode();
// MOD : MSSTI ABBC3 - end
		$bitfield = new bitfield($this->bbcode_bitfield);
		$bbcodes_set = $bitfield->get_all_set();

		foreach ($bbcodes_set as $bbcode_id)
		{
			if (isset($this->bbcode_cache[$bbcode_id]))
			{
				// do not try to re-cache it if it's already in
				continue;
			}
			$bbcode_ids[] = $bbcode_id;

			if ($bbcode_id > NUM_CORE_BBCODES)
			{
				$sql[] = $bbcode_id;
			}
		}

		if (sizeof($sql))
		{
			global $db;

			$sql = 'SELECT *
				FROM ' . BBCODES_TABLE . '
				WHERE ' . $db->sql_in_set('bbcode_id', $sql);
// MOD : MSSTI ABBC3 - Start
			$sql .= ' AND bbcode_match <> "." ';
// MOD : MSSTI ABBC3 - End
			$result = $db->sql_query($sql, 3600);

			while ($row = $db->sql_fetchrow($result))
			{
				// To circumvent replacing newlines with <br /> for the generated html,
				// we use carriage returns here. They are later changed back to newlines
				$row['bbcode_tpl'] = str_replace("\n", "\r", $row['bbcode_tpl']);
				$row['second_pass_replace'] = str_replace("\n", "\r", $row['second_pass_replace']);

				$rowset[$row['bbcode_id']] = $row;
			}
			$db->sql_freeresult($result);
		}

		foreach ($bbcode_ids as $bbcode_id)
		{
			switch ($bbcode_id)
			{
				case 0:
					$this->bbcode_cache[$bbcode_id] = array(
						'str' => array(
							'[/quote:$uid]'	=> $this->bbcode_tpl('quote_close', $bbcode_id)
						),
						'preg' => array(
							'#\[quote(?:="(.*?)")?:$uid\]((?!\[quote(?:=".*?")?:$uid\]).)?#ise'	=> "\$this->bbcode_second_pass_quote('\$1', '\$2')"
						)
					);
				break;

				case 1:
					$this->bbcode_cache[$bbcode_id] = array(
						'str' => array(
							'[b:$uid]'	=> $this->bbcode_tpl('b_open', $bbcode_id),
							'[/b:$uid]'	=> $this->bbcode_tpl('b_close', $bbcode_id),
						)
					);
				break;

				case 2:
					$this->bbcode_cache[$bbcode_id] = array(
						'str' => array(
							'[i:$uid]'	=> $this->bbcode_tpl('i_open', $bbcode_id),
							'[/i:$uid]'	=> $this->bbcode_tpl('i_close', $bbcode_id),
						)
					);
				break;

				case 3:
					$this->bbcode_cache[$bbcode_id] = array(
						'preg' => array(

// MOD : MSSTI ABBC3 - Start
							'#\[url:$uid\](ed2k://\|(file|server|serverlist|friend)(|\|[^\\/\|:<>\*\?\"]+?)\|(.*?)\|/?)\[/url:$uid\]#sie'		=> "\$this->ed2k_pass( \$bbcode_id, '\$1', '' )",
							'#\[url=(ed2k://\|(file|server|serverlist|friend)(|\|[^\\/\|:<>\*\?\"]+?)\|(.*?)\|/?):$uid\](.*?)\[/url:$uid\]#sie'	=> "\$this->ed2k_pass( \$bbcode_id, '\$1', '\$5' )",
// MOD : MSSTI ABBC3 - End
							'#\[url:$uid\]((.*?))\[/url:$uid\]#s'			=> $this->bbcode_tpl('url', $bbcode_id),
							'#\[url=([^\[]+?):$uid\](.*?)\[/url:$uid\]#s'	=> $this->bbcode_tpl('url', $bbcode_id),
						)
					);
				break;

				case 4:
					if ($user->optionget('viewimg'))
					{
						$this->bbcode_cache[$bbcode_id] = array(
							'preg' => array(
								'#\[img:$uid\](.*?)\[/img:$uid\]#s'		=> $this->bbcode_tpl('img', $bbcode_id),
							)
						);
					}
					else
					{
						$this->bbcode_cache[$bbcode_id] = array(
							'preg' => array(
								'#\[img:$uid\](.*?)\[/img:$uid\]#s'		=> str_replace('$2', '[ img ]', $this->bbcode_tpl('url', $bbcode_id, true)),
							)
						);
					}
				break;

				case 5:
					$this->bbcode_cache[$bbcode_id] = array(
						'preg' => array(
							'#\[size=([\-\+]?\d+):$uid\](.*?)\[/size:$uid\]#s'	=> $this->bbcode_tpl('size', $bbcode_id),
						)
					);
				break;

				case 6:
					$this->bbcode_cache[$bbcode_id] = array(
						'preg' => array(
							'!\[color=(#[0-9a-f]{3}|#[0-9a-f]{6}|[a-z\-]+):$uid\](.*?)\[/color:$uid\]!is'	=> $this->bbcode_tpl('color', $bbcode_id),
						)
					);
				break;

				case 7:
					$this->bbcode_cache[$bbcode_id] = array(
						'str' => array(
							'[u:$uid]'	=> $this->bbcode_tpl('u_open', $bbcode_id),
							'[/u:$uid]'	=> $this->bbcode_tpl('u_close', $bbcode_id),
						)
					);
				break;

				case 8:
					$this->bbcode_cache[$bbcode_id] = array(
						'preg' => array(
							'#\[code(?:=([a-z]+))?:$uid\](.*?)\[/code:$uid\]#ise'	=> "\$this->bbcode_second_pass_code('\$1', '\$2')",
						)
					);
				break;

				case 9:
					$this->bbcode_cache[$bbcode_id] = array(
						'preg' => array(
							'#(\[\/?(list|\*):[mou]?:?$uid\])[\n]{1}#'	=> "\$1",
							'#(\[list=([^\[]+):$uid\])[\n]{1}#'			=> "\$1",
							'#\[list=([^\[]+):$uid\]#e'					=> "\$this->bbcode_list('\$1')",
						),
						'str' => array(
							'[list:$uid]'		=> $this->bbcode_tpl('ulist_open_default', $bbcode_id),
							'[/list:u:$uid]'	=> $this->bbcode_tpl('ulist_close', $bbcode_id),
							'[/list:o:$uid]'	=> $this->bbcode_tpl('olist_close', $bbcode_id),
							'[*:$uid]'			=> $this->bbcode_tpl('listitem', $bbcode_id),
							'[/*:$uid]'			=> $this->bbcode_tpl('listitem_close', $bbcode_id),
							'[/*:m:$uid]'		=> $this->bbcode_tpl('listitem_close', $bbcode_id)
						),
					);
				break;

				case 10:
					$this->bbcode_cache[$bbcode_id] = array(
						'preg' => array(
							'#\[email:$uid\]((.*?))\[/email:$uid\]#is'			=> $this->bbcode_tpl('email', $bbcode_id),
							'#\[email=([^\[]+):$uid\](.*?)\[/email:$uid\]#is'	=> $this->bbcode_tpl('email', $bbcode_id)
						)
					);
				break;

				case 11:
					if ($user->optionget('viewflash'))
					{
						$this->bbcode_cache[$bbcode_id] = array(
							'preg' => array(
								'#\[flash=([0-9]+),([0-9]+):$uid\](.*?)\[/flash:$uid\]#'	=> $this->bbcode_tpl('flash', $bbcode_id),
							)
						);
					}
					else
					{
						$this->bbcode_cache[$bbcode_id] = array(
							'preg' => array(
								'#\[flash=([0-9]+),([0-9]+):$uid\](.*?)\[/flash:$uid\]#'	=> str_replace('$1', '$3', str_replace('$2', '[ flash ]', $this->bbcode_tpl('url', $bbcode_id, true)))
							)
						);
					}
				break;

				case 12:
					$this->bbcode_cache[$bbcode_id] = array(
						'str'	=> array(
							'[/attachment:$uid]'	=> $this->bbcode_tpl('inline_attachment_close', $bbcode_id)
						),
						'preg'	=> array(
							'#\[attachment=([0-9]+):$uid\]#'	=> $this->bbcode_tpl('inline_attachment_open', $bbcode_id)
						)
					);
				break;

				default:
					if (isset($rowset[$bbcode_id]))
					{
						if ($this->template_bitfield->get($bbcode_id))
						{
							// The bbcode requires a custom template to be loaded
							if (!$bbcode_tpl = $this->bbcode_tpl($rowset[$bbcode_id]['bbcode_tag'], $bbcode_id))
							{
								// For some reason, the required template seems not to be available, use the default template
								$bbcode_tpl = (!empty($rowset[$bbcode_id]['second_pass_replace'])) ? $rowset[$bbcode_id]['second_pass_replace'] : $rowset[$bbcode_id]['bbcode_tpl'];
							}
							else
							{
								// In order to use templates with custom bbcodes we need
								// to replace all {VARS} to corresponding backreferences
								// Note that backreferences are numbered from bbcode_match
								if (preg_match_all('/\{(URL|LOCAL_URL|EMAIL|TEXT|SIMPLETEXT|INTTEXT|IDENTIFIER|COLOR|NUMBER)[0-9]*\}/', $rowset[$bbcode_id]['bbcode_match'], $m))
								{
									foreach ($m[0] as $i => $tok)
									{
										$bbcode_tpl = str_replace($tok, '$' . ($i + 1), $bbcode_tpl);
									}
								}
							}
						}
						else
						{
							// Default template
							$bbcode_tpl = (!empty($rowset[$bbcode_id]['second_pass_replace'])) ? $rowset[$bbcode_id]['second_pass_replace'] : $rowset[$bbcode_id]['bbcode_tpl'];
						}

						// Replace {L_*} lang strings
// MOD : MSSTI ABBC3 - Start
						$user->add_lang('mods/abbcode');
// MOD : MSSTI ABBC3 - End
						$bbcode_tpl = preg_replace('/{L_([A-Z_]+)}/e', "(!empty(\$user->lang['\$1'])) ? \$user->lang['\$1'] : ucwords(strtolower(str_replace('_', ' ', '\$1')))", $bbcode_tpl);

						if (!empty($rowset[$bbcode_id]['second_pass_replace']))
						{
							// The custom BBCode requires second-pass pattern replacements
							$this->bbcode_cache[$bbcode_id] = array(
								'preg' => array($rowset[$bbcode_id]['second_pass_match'] => $bbcode_tpl)
							);
						}
						else
						{
							$this->bbcode_cache[$bbcode_id] = array(
								'str' => array($rowset[$bbcode_id]['second_pass_match'] => $bbcode_tpl)
							);
						}
					}
					else
					{
						$this->bbcode_cache[$bbcode_id] = false;
					}
				break;
			}
		}
	}

	/**
	* Return bbcode template
	*/
	function bbcode_tpl($tpl_name, $bbcode_id = -1, $skip_bitfield_check = false)
	{
		static $bbcode_hardtpl = array();
		if (empty($bbcode_hardtpl))
		{
			global $user;

			$bbcode_hardtpl = array(
				'b_open'	=> '<span style="font-weight: bold">',
				'b_close'	=> '</span>',
				'i_open'	=> '<span style="font-style: italic">',
				'i_close'	=> '</span>',
				'u_open'	=> '<span style="text-decoration: underline">',
				'u_close'	=> '</span>',
				'img'		=> '<img src="$1" alt="' . $user->lang['IMAGE'] . '" class="resize_me" />',
				'size'		=> '<span style="font-size: $1%; line-height: normal">$2</span>',
				'color'		=> '<span style="color: $1">$2</span>',
				'email'		=> '<a href="mailto:$1">$2</a>'
			);
		}

		if ($bbcode_id != -1 && !$skip_bitfield_check && !$this->template_bitfield->get($bbcode_id))
		{
			return (isset($bbcode_hardtpl[$tpl_name])) ? $bbcode_hardtpl[$tpl_name] : false;
		}

		if (empty($this->bbcode_template))
		{
			if (($tpl = file_get_contents($this->template_filename)) === false)
			{
				trigger_error('Could not load bbcode template', E_USER_ERROR);
			}
// MOD : MSSTI ABBC3 - Start
			if (($tpl2 = file_get_contents($this->template_filename2)) === false)
			{
				trigger_error('Could not load abbcode template', E_USER_ERROR);
			}
			else
			{
				$tpl .= $tpl2;
			}
// MOD : MSSTI ABBC3 - End

			// replace \ with \\ and then ' with \'.
			$tpl = str_replace('\\', '\\\\', $tpl);
			$tpl = str_replace("'", "\'", $tpl);

			// strip newlines and indent
			$tpl = preg_replace("/\n[\n\r\s\t]*/", '', $tpl);

			// Turn template blocks into PHP assignment statements for the values of $bbcode_tpl..
			$this->bbcode_template = array();

			$matches = preg_match_all('#<!-- BEGIN (.*?) -->(.*?)<!-- END (?:.*?) -->#', $tpl, $match);

			for ($i = 0; $i < $matches; $i++)
			{
				if (empty($match[1][$i]))
				{
					continue;
				}

				$this->bbcode_template[$match[1][$i]] = $this->bbcode_tpl_replace($match[1][$i], $match[2][$i]);
			}
		}

		return (isset($this->bbcode_template[$tpl_name])) ? $this->bbcode_template[$tpl_name] : ((isset($bbcode_hardtpl[$tpl_name])) ? $bbcode_hardtpl[$tpl_name] : false);
	}

	/**
	* Return bbcode template replacement
	*/
	function bbcode_tpl_replace($tpl_name, $tpl)
	{
		global $user;

		static $replacements = array(
			'quote_username_open'	=> array('{USERNAME}'	=> '$1'),
			'color'					=> array('{COLOR}'		=> '$1', '{TEXT}'			=> '$2'),
			'size'					=> array('{SIZE}'		=> '$1', '{TEXT}'			=> '$2'),
			'img'					=> array('{URL}'		=> '$1'),
			'flash'					=> array('{WIDTH}'		=> '$1', '{HEIGHT}'			=> '$2', '{URL}'	=> '$3'),
			'url'					=> array('{URL}'		=> '$1', '{DESCRIPTION}'	=> '$2'),
			'email'					=> array('{EMAIL}'		=> '$1', '{DESCRIPTION}'	=> '$2')
		);

		$tpl = preg_replace('/{L_([A-Z_]+)}/e', "(!empty(\$user->lang['\$1'])) ? \$user->lang['\$1'] : ucwords(strtolower(str_replace('_', ' ', '\$1')))", $tpl);

		if (!empty($replacements[$tpl_name]))
		{
			$tpl = strtr($tpl, $replacements[$tpl_name]);
		}

		return trim($tpl);
	}

	/**
	* Second parse list bbcode
	*/
	function bbcode_list($type)
	{
		if ($type == '')
		{
			$tpl = 'ulist_open_default';
			$type = 'default';
		}
		else if ($type == 'i')
		{
			$tpl = 'olist_open';
			$type = 'lower-roman';
		}
		else if ($type == 'I')
		{
			$tpl = 'olist_open';
			$type = 'upper-roman';
		}
		else if (preg_match('#^(disc|circle|square)$#i', $type))
		{
			$tpl = 'ulist_open';
			$type = strtolower($type);
		}
		else if (preg_match('#^[a-z]$#', $type))
		{
			$tpl = 'olist_open';
			$type = 'lower-alpha';
		}
		else if (preg_match('#[A-Z]#', $type))
		{
			$tpl = 'olist_open';
			$type = 'upper-alpha';
		}
		else if (is_numeric($type))
		{
			$tpl = 'olist_open';
			$type = 'decimal';
		}
		else
		{
			$tpl = 'olist_open';
			$type = 'decimal';
		}

		return str_replace('{LIST_TYPE}', $type, $this->bbcode_tpl($tpl));
	}

	/**
	* Second parse quote tag
	*/
	function bbcode_second_pass_quote($username, $quote)
	{
		// when using the /e modifier, preg_replace slashes double-quotes but does not
		// seem to slash anything else
		$quote = str_replace('\"', '"', $quote);
		$username = str_replace('\"', '"', $username);

		// remove newline at the beginning
		if ($quote == "\n")
		{
			$quote = '';
		}

		$quote = (($username) ? str_replace('$1', $username, $this->bbcode_tpl('quote_username_open')) : $this->bbcode_tpl('quote_open')) . $quote;

		return $quote;
	}

	/**
	* Second parse code tag
	*/
	function bbcode_second_pass_code($type, $code)
	{
		// when using the /e modifier, preg_replace slashes double-quotes but does not
		// seem to slash anything else
		$code = str_replace('\"', '"', $code);

		switch ($type)
		{
			case 'php':
				// Not the english way, but valid because of hardcoded syntax highlighting
				if (strpos($code, '<span class="syntaxdefault"><br /></span>') === 0)
				{
					$code = substr($code, 41);
				}

			// no break;

			default:
				$code = str_replace("\t", '&nbsp; &nbsp;', $code);
				$code = str_replace('  ', '&nbsp; ', $code);
				$code = str_replace('  ', ' &nbsp;', $code);

				// remove newline at the beginning
				if (!empty($code) && $code[0] == "\n")
				{
					$code = substr($code, 1);
				}
			break;
		}

		$code = $this->bbcode_tpl('code_open') . $code . $this->bbcode_tpl('code_close');

		return $code;
	}
}

?>

Re: Error en instalacion Advanced ABBC3

Publicado: 13 Sep 2010, 22:37
por leviatan21

Por favor coloca los datos de soporte como se pide en las normas


Re: Error en instalacion Advanced ABBC3

Publicado: 13 Sep 2010, 22:40
por KRUSCHEV
perdon, no me di cuenta tenia otro tema abierto y me despiste

ya me lo puse en la firma asi no vuelve a pasar

Re: Error en instalacion Advanced ABBC3

Publicado: 13 Sep 2010, 22:49
por leviatan21
KRUSCHEV escribió:solo pasa en el indice general el resto se ve bien.
¿ El listado de MODs está actualizado ?
No hay motivo para que el raíz/includes/bbcode.php sea llamado desde el índice del foro.
ahora quiero ver el raíz/index.php

Re: Error en instalacion Advanced ABBC3

Publicado: 13 Sep 2010, 23:01
por KRUSCHEV
ese archivo no lo encuentro

Re: Error en instalacion Advanced ABBC3

Publicado: 13 Sep 2010, 23:08
por leviatan21
Ya edité, me equivoque de nombre de archivo : es el raíz/index.php

Re: Error en instalacion Advanced ABBC3

Publicado: 13 Sep 2010, 23:13
por KRUSCHEV

Código: Seleccionar todo

<?php
/**
*
* @package phpBB3
* @version $Id$
* @copyright (c) 2005 phpBB Group
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
*
*/

/**
*/

/**
* @ignore
*/
define('IN_PHPBB', true);
$phpbb_root_path = (defined('PHPBB_ROOT_PATH')) ? PHPBB_ROOT_PATH : './';
$phpEx = substr(strrchr(__FILE__, '.'), 1);
include($phpbb_root_path . 'common.' . $phpEx);
include($phpbb_root_path . 'includes/functions_display.' . $phpEx);

// Start session management
$user->session_begin();
$auth->acl($user->data);
$user->setup('viewforum');

display_forums('', $config['load_moderators']);
    // bloque últimos posts - mitch - phpBB-Es
    include($phpbb_root_path . 'includes/bbcode.' . $phpEx);

    function create_where_clauses($gen_id, $type)
    {
    global $db, $auth;

    $size_gen_id = sizeof($gen_id);

    switch($type)
    {
    case 'forum':
    $type = 'forum_id';
    break;
    case 'topic':
    $type = 'topic_id';
    break;
    default:
    trigger_error('No type defined');
    }

    $out_where = '';

    if ($size_gen_id > 0)
    {
    $auth_f_read = array_keys($auth->acl_getf('f_read', true));

    if ($type == 'topic_id')
    {
    $sql = 'SELECT topic_id FROM ' . TOPICS_TABLE . '
    WHERE ' . $db->sql_in_set('topic_id', $gen_id) . '
    AND ' . $db->sql_in_set('forum_id', $auth_f_read);

    $result = $db->sql_query($sql);

    while ($row = $db->sql_fetchrow($result))
    {
    $topic_id_list[] = $row['topic_id'];
    }

    unset($gen_id);

    $gen_id = $topic_id_list;
    $size_gen_id = sizeof($gen_id);
    }

    $j = 0;

    for ($i = 0; $i < $size_gen_id; $i++)
    {
    $id_check = (int) $gen_id[$i]; // If the type is topic, all checks have been made and the query can start to be built if( $type == 'topic_id' ) { $out_where .= ($j == 0) ? 'WHERE ' . $type . ' = ' . $id_check . ' ' : 'OR ' . $type . ' = ' . $id_check . ' '; } // If the type is forum, do the check to make sure the user has read permissions else if( $type == 'forum_id' && $auth->acl_get('f_read', $id_check) )
    {
    $out_where .= ($j == 0) ? 'WHERE ' . $type . ' = ' . $id_check . ' ' : 'OR ' . $type . ' = ' . $id_check . ' ';
    }

    $j++;
    }
    }

    if ($out_where == '' && $size_gen_id > 0)
    {
    trigger_error('A list of topics/forums has not been created');
    }

    return $out_where;
    }


    // Número de últimos posts a mostrar (editar el 5 si así lo deseas):
    $search_limit = 10;


    $posts_ary = array(
    'SELECT' => 'p.*, t.*, u.username, u.user_colour',

    'FROM' => array(
    POSTS_TABLE => 'p',
    ),

    'LEFT_JOIN' => array(
    array(
    'FROM' => array(USERS_TABLE => 'u'),
    'ON' => 'u.user_id = p.poster_id'
    ),
    array(
    'FROM' => array(TOPICS_TABLE => 't'),
    'ON' => 'p.topic_id = t.topic_id'
    ),
    ),

    'WHERE' => $db->sql_in_set('t.forum_id', array_keys($auth->acl_getf('f_read', true))) . '
    AND t.topic_status <> ' . ITEM_MOVED . '
    AND t.topic_approved = 1',

    'ORDER_BY' => 'p.post_id DESC',
    );

    $posts = $db->sql_build_query('SELECT', $posts_ary);

    $posts_result = $db->sql_query_limit($posts, $search_limit);

    while ($posts_row = $db->sql_fetchrow($posts_result))
    {
    $topic_title = $posts_row['topic_title'];
    $topic_title = censor_text($topic_title);
    $post_author = get_username_string('full', $posts_row['poster_id'], $posts_row['username'], $posts_row['user_colour']);
    $post_date = $user->format_date($posts_row['post_time']);
    $post_link = append_sid("{$phpbb_root_path}viewtopic.$phpEx", "p=" . $posts_row['post_id'] . "#p" . $posts_row['post_id']);

    $post_text = nl2br($posts_row['post_text']);

    $bbcode = new bbcode(base64_encode($bbcode_bitfield));
    $bbcode->bbcode_second_pass($post_text, $posts_row['bbcode_uid'], $posts_row['bbcode_bitfield']);

    $post_text = smiley_text($post_text);

    $template->assign_block_vars('last_topics', array(
    'TOPIC_TITLE' => censor_text($topic_title),
    'POST_AUTHOR' => $post_author,
    'POST_DATE' => $post_date,
    'POST_LINK' => $post_link,
    'POST_TEXT' => censor_text($post_text),
    ));
    }

    // Fin bloque últimos posts - mitch - phpBB-Es


// Set some stats, get posts count from forums data if we... hum... retrieve all forums data
$total_posts	= $config['num_posts'];
$total_topics	= $config['num_topics'];
$total_users	= $config['num_users'];

$l_total_user_s = ($total_users == 0) ? 'TOTAL_USERS_ZERO' : 'TOTAL_USERS_OTHER';
$l_total_post_s = ($total_posts == 0) ? 'TOTAL_POSTS_ZERO' : 'TOTAL_POSTS_OTHER';
$l_total_topic_s = ($total_topics == 0) ? 'TOTAL_TOPICS_ZERO' : 'TOTAL_TOPICS_OTHER';

// Grab group details for legend display
if ($auth->acl_gets('a_group', 'a_groupadd', 'a_groupdel'))
{
	$sql = 'SELECT group_id, group_name, group_colour, group_type
		FROM ' . GROUPS_TABLE . '
		WHERE group_legend = 1
		ORDER BY group_name ASC';
}
else
{
	$sql = 'SELECT g.group_id, g.group_name, g.group_colour, g.group_type
		FROM ' . GROUPS_TABLE . ' g
		LEFT JOIN ' . USER_GROUP_TABLE . ' ug
			ON (
				g.group_id = ug.group_id
				AND ug.user_id = ' . $user->data['user_id'] . '
				AND ug.user_pending = 0
			)
		WHERE g.group_legend = 1
			AND (g.group_type <> ' . GROUP_HIDDEN . ' OR ug.user_id = ' . $user->data['user_id'] . ')
		ORDER BY g.group_name ASC';
}
$result = $db->sql_query($sql);

$legend = array();
while ($row = $db->sql_fetchrow($result))
{
	$colour_text = ($row['group_colour']) ? ' style="color:#' . $row['group_colour'] . '"' : '';
	$group_name = ($row['group_type'] == GROUP_SPECIAL) ? $user->lang['G_' . $row['group_name']] : $row['group_name'];

	if ($row['group_name'] == 'BOTS' || ($user->data['user_id'] != ANONYMOUS && !$auth->acl_get('u_viewprofile')))
	{
		$legend[] = '<span' . $colour_text . '>' . $group_name . '</span>';
	}
	else
	{
		$legend[] = '<a' . $colour_text . ' href="' . append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=group&g=' . $row['group_id']) . '">' . $group_name . '</a>';
	}
}
$db->sql_freeresult($result);

$legend = implode(', ', $legend);

// Generate birthday list if required ...
$birthday_list = '';
if ($config['load_birthdays'] && $config['allow_birthdays'])
{
	$now = getdate(time() + $user->timezone + $user->dst - date('Z'));
	$sql = 'SELECT u.user_id, u.username, u.user_colour, u.user_birthday
		FROM ' . USERS_TABLE . ' u
		LEFT JOIN ' . BANLIST_TABLE . " b ON (u.user_id = b.ban_userid)
		WHERE (b.ban_id IS NULL
			OR b.ban_exclude = 1)
			AND u.user_birthday LIKE '" . $db->sql_escape(sprintf('%2d-%2d-', $now['mday'], $now['mon'])) . "%'
			AND u.user_type IN (" . USER_NORMAL . ', ' . USER_FOUNDER . ')';
	$result = $db->sql_query($sql);

	while ($row = $db->sql_fetchrow($result))
	{
		$birthday_list .= (($birthday_list != '') ? ', ' : '') . get_username_string('full', $row['user_id'], $row['username'], $row['user_colour']);

		if ($age = (int) substr($row['user_birthday'], -4))
		{
			$birthday_list .= ' (' . ($now['year'] - $age) . ')';
		}
	}
	$db->sql_freeresult($result);
}

/**
* Ultimate Points
*/
if ( isset($config['points_name']) )
{	
	// Add points lang
	$user->add_lang('mods/points');

	// Generate the bank statistics
	$sql_array = array(
		'SELECT'    => 'SUM(holding) AS total_holding, count(user_id) AS total_users',
		'FROM'      => array(
			POINTS_BANK_TABLE => 'b',
		),
		'WHERE'		=> 'id > 0',
	);
	$sql = $db->sql_build_query('SELECT', $sql_array);
	$result = $db->sql_query($sql);
	$b_row = $db->sql_fetchrow($result);
	$bankholdings = ( $b_row['total_holding'] ) ? $b_row['total_holding'] : 0;
	$bankusers = $b_row['total_users'];

	// Create most rich users - cash and bank
	$limit = $points_values['number_show_top_points'];
	$sql_array = array(
		'SELECT'    => 'u.user_id, u.username, u.user_colour, u.user_points, b.holding',

		'FROM'      => array(
			USERS_TABLE  => 'u',
		),
		'LEFT_JOIN' => array(
			array(
				'FROM'  => array(POINTS_BANK_TABLE => 'b'),
				'ON'    => 'u.user_id = b.user_id'
			)
		),
	);
	$sql = $db->sql_build_query('SELECT', $sql_array);
	$result = $db->sql_query($sql);

	// Create a new array for the users
	$rich_users = array();

	// Create sorting array
	$rich_users_sort = array();

	// Loop all users array to escape the 0 points users
	while( $row = $db->sql_fetchrow($result))
	{
		if ( $row['user_points'] > 0 || $row['holding'] > 0 ) //let away beggars
		{
			$total_points = $row['user_points'] + $row['holding'];
			$index = $row['user_id'];
			$rich_users[$index] = array('total_points' => $total_points, 'username' => $row['username'], 'user_colour' => $row['user_colour'], 'user_id' => $index);
			$rich_users_sort[$index] = $total_points;
		}
	}

	$db->sql_freeresult($result);

	// Sort by points desc
	arsort( $rich_users_sort);

	// Extract the user ids
	$rich_users_sort  = array_keys($rich_users_sort);

	// Create new sorted rich users array
	$rich_users_sorted = array();

	// Check, if number of users in array is below the set limit
	$new_limit = sizeof($rich_users) < $limit ? sizeof($rich_users) : $limit;

	for($i = 0; $i < $new_limit; $i++)
	{
		$rich_users_sorted[] = $rich_users[$rich_users_sort[$i]];
	}

	// Send to template
	foreach($rich_users_sorted as $var)
	{
		$template->assign_block_vars('rich_user', array(
			'USERNAME'         => get_username_string('full', $var['user_id'], $var['username'], $var['user_colour']),
			'SUM_POINTS'      => number_format_points($var['total_points']),
			'SUM_POINTS_NAME'   => $config['points_name'],
		));
	}

	//Generate the points statistics
	$sql_array = array(
		'SELECT'    => 'SUM(user_points) AS total_points',
		'FROM'      => array(
			USERS_TABLE => 'u',
		),
		'WHERE'		=> 'user_points > 0',
	);
	$sql = $db->sql_build_query('SELECT', $sql_array);
	$result = $db->sql_query($sql);
	$b_row = $db->sql_fetchrow($result);
	$totalpoints = ( $b_row['total_points'] ) ? $b_row['total_points'] : 0;
	$lottery_time = $user->format_date(($points_values['lottery_last_draw_time'] + $points_values['lottery_draw_period']), false, true);

	// Run Lottery
	if ( $points_values['lottery_draw_period'] != 0 && $points_values['lottery_last_draw_time'] + $points_values['lottery_draw_period'] - time() < 0 )
	{
		if (!function_exists('run_lottery'))
		{
			include($phpbb_root_path . 'includes/points/functions_points.' . $phpEx);
		}
		if (!function_exists('send_pm'))
		{
			include($phpbb_root_path . 'includes/functions_privmsgs.' . $phpEx);
		}
		run_lottery();
	}

	$template->assign_vars(array(
		'TOTAL_BANK_USER'			=> sprintf($user->lang['POINTS_BUPOINTS_TOTAL'], $bankusers, $points_values['bank_name']),
		'TOTAL_BANK_POINTS'			=> sprintf($user->lang['POINTS_BPOINTS_TOTAL'], number_format_points($bankholdings), $config['points_name'], $points_values['bank_name']),
		'TOTAL_POINTS_USER'			=> sprintf($user->lang['POINTS_TOTAL'], number_format_points($totalpoints), $config['points_name']),
		'LOTTERY_TIME'				=> sprintf($user->lang['POINTS_LOTTERY_TIME'], $lottery_time),
		'S_DISPLAY_LOTTERY'			=> ($points_config['display_lottery_stats']) ? true : false,
		'S_DISPLAY_POINTS_STATS'	=> ($points_config['stats_enable']) ? true : false,
		'S_DISPLAY_INDEX'			=> ($points_values['number_show_top_points'] > 0) ? true : false,
	));
}

// Assign index specific vars
$template->assign_vars(array(
	'TOTAL_POSTS'	=> sprintf($user->lang[$l_total_post_s], $total_posts),
	'TOTAL_TOPICS'	=> sprintf($user->lang[$l_total_topic_s], $total_topics),
	'TOTAL_USERS'	=> sprintf($user->lang[$l_total_user_s], $total_users),
	'NEWEST_USER'	=> sprintf($user->lang['NEWEST_USER'], get_username_string('full', $config['newest_user_id'], $config['newest_username'], $config['newest_user_colour'])),

	'LEGEND'		=> $legend,
	'BIRTHDAY_LIST'	=> $birthday_list,

	'FORUM_IMG'				=> $user->img('forum_read', 'NO_NEW_POSTS'),
	'FORUM_NEW_IMG'			=> $user->img('forum_unread', 'NEW_POSTS'),
	'FORUM_LOCKED_IMG'		=> $user->img('forum_read_locked', 'NO_NEW_POSTS_LOCKED'),
	'FORUM_NEW_LOCKED_IMG'	=> $user->img('forum_unread_locked', 'NO_NEW_POSTS_LOCKED'),

	'S_LOGIN_ACTION'			=> append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=login'),
	'S_DISPLAY_BIRTHDAY_LIST'	=> ($config['load_birthdays']) ? true : false,

	'U_MARK_FORUMS'		=> ($user->data['is_registered'] || $config['load_anon_lastread']) ? append_sid("{$phpbb_root_path}index.$phpEx", 'hash=' . generate_link_hash('global') . '&mark=forums') : '',
	'U_MCP'				=> ($auth->acl_get('m_') || $auth->acl_getf_global('m_')) ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=main&mode=front', true, $user->session_id) : '')
);

// Output page
page_header($user->lang['INDEX']);

$template->set_filenames(array(
	'body' => 'index_body.html')
);

page_footer();

?>

Re: Error en instalacion Advanced ABBC3

Publicado: 13 Sep 2010, 23:31
por leviatan21
Bueno he aquí la solución :

Abrir :
raíz/index.php
Buscar :

Código: Seleccionar todo

    // bloque últimos posts - mitch - phpBB-Es
    include($phpbb_root_path . 'includes/bbcode.' . $phpEx);
Reemplazar por :

Código: Seleccionar todo

    // bloque últimos posts - mitch - phpBB-Es
    if (!class_exists('bbcode'))
    {
        include($phpbb_root_path . 'includes/bbcode.' . $phpEx);
    }
Listo, guardar los cambios, subirlo al servidor vía FTP

Re: Error en instalacion Advanced ABBC3

Publicado: 13 Sep 2010, 23:35
por KRUSCHEV
correcto todo ahora muchisimas gracias este mod es genial, de nuevo gracias por la ayuda y la rapidez en darla.

Re: Error en instalacion Advanced ABBC3

Publicado: 13 Sep 2010, 23:37
por leviatan21
Por favor indícame donde está el MOD bloque últimos posts - mitch, así le sugiero el parche al autor para evitar mas problemas de este tipo

Re: Error en instalacion Advanced ABBC3

Publicado: 13 Sep 2010, 23:41
por KRUSCHEV
http://www.phpbb-es.com/foro/ultimosmensajes