phpBB

Code Changes

File: includes/bbcode.php

  Unmodified   Added   Modified   Removed
Line 129Line 129
	*/
function bbcode_cache_init()
{

	*/
function bbcode_cache_init()
{

		global $phpbb_root_path, $phpEx, $config, $user, $phpbb_extension_manager, $phpbb_path_helper;

		global $phpbb_root_path, $phpEx, $config, $user, $phpbb_dispatcher, $phpbb_extension_manager, $phpbb_path_helper;


if (empty($this->template_filename))
{


if (empty($this->template_filename))
{

Line 182Line 182
			$db->sql_freeresult($result);
}


			$db->sql_freeresult($result);
}


 
		// To perform custom second pass in extension, use $this->bbcode_second_pass_by_extension()
// method which accepts variable number of parameters

		foreach ($bbcode_ids as $bbcode_id)
{
switch ($bbcode_id)

		foreach ($bbcode_ids as $bbcode_id)
{
switch ($bbcode_id)

Line 388Line 390
				break;
}
}

				break;
}
}

 

$bbcode_cache = $this->bbcode_cache;
$bbcode_bitfield = $this->bbcode_bitfield;
$bbcode_uid = $this->bbcode_uid;

/**
* Use this event to modify the bbcode_cache
*
* @event core.bbcode_cache_init_end
* @var array bbcode_cache The array of cached search and replace patterns of bbcodes
* @var string bbcode_bitfield The bbcode bitfield
* @var string bbcode_uid The bbcode uid
* @since 3.1.3-RC1
*/
$vars = array('bbcode_cache', 'bbcode_bitfield', 'bbcode_uid');
extract($phpbb_dispatcher->trigger_event('core.bbcode_cache_init_end', compact($vars)));

$this->bbcode_cache = $bbcode_cache;
$this->bbcode_bitfield = $bbcode_bitfield;
$this->bbcode_uid = $bbcode_uid;

	}

/**

	}

/**

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

return $code;

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

return $code;

 
	}

/**
* Function to perform custom bbcode second pass by extensions
* can be used to assign bbcode pattern replacement
* Example: '#\[list=([^\[]+):$uid\]#e' => "\$this->bbcode_second_pass_by_extension('\$1')"
*
* Accepts variable number of parameters
*
* @return mixed Second pass result
*/
function bbcode_second_pass_by_extension()
{
global $phpbb_dispatcher;

$return = false;
$params_array = func_get_args();

/**
* Event to perform bbcode second pass with
* the custom validating methods provided by extensions
*
* @event core.bbcode_second_pass_by_extension
* @var array params_array Array with the function parameters
* @var mixed return Second pass result to return
*
* @since 3.1.5-RC1
*/
$vars = array('params_array', 'return');
extract($phpbb_dispatcher->trigger_event('core.bbcode_second_pass_by_extension', compact($vars)));

return $return;

	}
}


	}
}