Browse Source

+ Add in a couple of requested hooks for entry/exit parse_bbc and loading user context

Signed-off-by: Spuds <[email protected]>
Spuds 12 years ago
parent
commit
3337ba6350
2 changed files with 10 additions and 1 deletions
  1. 3 0
      Sources/Load.php
  2. 7 1
      Sources/Subs.php

+ 3 - 0
Sources/Load.php

@@ -936,6 +936,9 @@ function loadMemberData($users, $is_name = false, $set = 'normal')
 	else
 		trigger_error('loadMemberData(): Invalid member data set \'' . $set . '\'', E_USER_WARNING);
 
+	// Allow mods to easily add to the selected member data
+	call_integration_hook('integrate_load_member_data', array(&$select_columns, &$select_tables));
+	
 	if (!empty($users))
 	{
 		// Load the member's data.

+ 7 - 1
Sources/Subs.php

@@ -883,7 +883,10 @@ function parse_bbc($message, $smileys = true, $cache_id = '', $parse_tags = arra
 		$temp_bbc = $bbc_codes;
 		$bbc_codes = array();
 	}
-
+	
+	// Allow mods access before entering the main parse_bbc loop
+	call_integration_hook('integrate_pre_parsebbc', array(&$message, &$smileys, &$cache_id, &$parse_tags));
+	
 	// Sift out the bbc for a performance improvement.
 	if (empty($bbc_codes) || $message === false || !empty($parse_tags))
 	{
@@ -2388,6 +2391,9 @@ function parse_bbc($message, $smileys = true, $cache_id = '', $parse_tags = arra
 	// Cleanup whitespace.
 	$message = strtr($message, array('  ' => ' &nbsp;', "\r" => '', "\n" => '<br />', '<br /> ' => '<br />&nbsp;', '&#13;' => "\n"));
 
+	// Allow mods access to what parse_bbc created
+	call_integration_hook('integrate_post_parsebbc', array(&$message, &$smileys, &$cache_id, &$parse_tags));
+	
 	// Cache the output if it took some time...
 	if (isset($cache_key, $cache_t) && array_sum(explode(' ', microtime())) - array_sum(explode(' ', $cache_t)) > 0.05)
 		cache_put_data($cache_key, $message, 240);