added ability to "extend" helpers
* modified Loader to check for prefixed helpers in application/helpers folder
* surrounded provided helper functions with if (! function_exists('foo')) conditionals so the user's helper functions take precedent.
diff --git a/system/helpers/smiley_helper.php b/system/helpers/smiley_helper.php
index d61ea78..f414947 100644
--- a/system/helpers/smiley_helper.php
+++ b/system/helpers/smiley_helper.php
@@ -37,9 +37,11 @@
  * @param	string	field name

  * @return	string

  */	

-function js_insert_smiley($form_name = '', $form_field = '')

+if (! function_exists('js_insert_smiley'))

 {

-return <<<EOF

+	function js_insert_smiley($form_name = '', $form_field = '')

+	{

+		return <<<EOF

 <script type="text/javascript">

 	function insert_smiley(smiley)

 	{

@@ -47,8 +49,8 @@
 	}

 </script>

 EOF;

-}	

-

+	}	

+}

 // ------------------------------------------------------------------------

 

 /**

@@ -61,37 +63,40 @@
  * @param	string	the URL to the folder containing the smiley images

  * @return	array

  */	

-function get_clickable_smileys($image_url = '', $smileys = NULL)

+if (! function_exists('get_clickable_smileys'))

 {

-	if ( ! is_array($smileys))

+	function get_clickable_smileys($image_url = '', $smileys = NULL)

 	{

-		if (FALSE === ($smileys = _get_smiley_array()))

+		if ( ! is_array($smileys))

 		{

-			return $str;

-		}        

-	}

+			if (FALSE === ($smileys = _get_smiley_array()))

+			{

+				return $str;

+			}        

+		}

 

-	// Add a trailing slash to the file path if needed

-	$image_url = preg_replace("/(.+?)\/*$/", "\\1/",  $image_url);

+		// Add a trailing slash to the file path if needed

+		$image_url = preg_replace("/(.+?)\/*$/", "\\1/",  $image_url);

 	

-	$used = array();

-	foreach ($smileys as $key => $val)

-	{

-		// Keep duplicates from being used, which can happen if the

-		// mapping array contains multiple identical replacements.  For example:

-		// :-) and :) might be replaced with the same image so both smileys

-		// will be in the array.

-		if (isset($used[$smileys[$key][0]]))

+		$used = array();

+		foreach ($smileys as $key => $val)

 		{

-			continue;

+			// Keep duplicates from being used, which can happen if the

+			// mapping array contains multiple identical replacements.  For example:

+			// :-) and :) might be replaced with the same image so both smileys

+			// will be in the array.

+			if (isset($used[$smileys[$key][0]]))

+			{

+				continue;

+			}

+	

+			$link[] = "<a href=\"javascript:void(0);\" onClick=\"insert_smiley('".$key."')\"><img src=\"".$image_url.$smileys[$key][0]."\" width=\"".$smileys[$key][1]."\" height=\"".$smileys[$key][2]."\" alt=\"".$smileys[$key][3]."\" style=\"border:0;\" /></a>";	

+	

+			$used[$smileys[$key][0]] = TRUE;

 		}

 	

-		$link[] = "<a href=\"javascript:void(0);\" onClick=\"insert_smiley('".$key."')\"><img src=\"".$image_url.$smileys[$key][0]."\" width=\"".$smileys[$key][1]."\" height=\"".$smileys[$key][2]."\" alt=\"".$smileys[$key][3]."\" style=\"border:0;\" /></a>";	

-	

-		$used[$smileys[$key][0]] = TRUE;

+		return $link;

 	}

-	

-	return $link;

 }

 

 // ------------------------------------------------------------------------

@@ -106,30 +111,33 @@
  * @param	string	the URL to the folder containing the smiley images

  * @return	string

  */	

-function parse_smileys($str = '', $image_url = '', $smileys = NULL)

+if (! function_exists('parse_smileys'))

 {

-	if ($image_url == '')

+	function parse_smileys($str = '', $image_url = '', $smileys = NULL)

 	{

-		return $str;

-	}

-

-	if ( ! is_array($smileys))

-	{

-		if (FALSE === ($smileys = _get_smiley_array()))

+		if ($image_url == '')

 		{

 			return $str;

-		}        

-	}

-	

-	// Add a trailing slash to the file path if needed

-	$image_url = preg_replace("/(.+?)\/*$/", "\\1/",  $image_url);

+		}

 

-	foreach ($smileys as $key => $val)

-	{        

-		$str = str_replace($key, "<img src=\"".$image_url.$smileys[$key][0]."\" width=\"".$smileys[$key][1]."\" height=\"".$smileys[$key][2]."\" alt=\"".$smileys[$key][3]."\" style=\"border:0;\" />", $str);

-	}

+		if ( ! is_array($smileys))

+		{

+			if (FALSE === ($smileys = _get_smiley_array()))

+			{

+				return $str;

+			}        

+		}

 	

-	return $str;

+		// Add a trailing slash to the file path if needed

+		$image_url = preg_replace("/(.+?)\/*$/", "\\1/",  $image_url);

+

+		foreach ($smileys as $key => $val)

+		{        

+			$str = str_replace($key, "<img src=\"".$image_url.$smileys[$key][0]."\" width=\"".$smileys[$key][1]."\" height=\"".$smileys[$key][2]."\" alt=\"".$smileys[$key][3]."\" style=\"border:0;\" />", $str);

+		}

+	

+		return $str;

+	}

 }

 

 // ------------------------------------------------------------------------

@@ -142,24 +150,24 @@
  * @access	private

  * @return	mixed

  */	

-function _get_smiley_array()

+if (! function_exists('_get_smiley_array'))

 {

-	if ( ! file_exists(APPPATH.'config/smileys'.EXT))

+	function _get_smiley_array()

 	{

-		return FALSE;

-	}

+		if ( ! file_exists(APPPATH.'config/smileys'.EXT))

+		{

+			return FALSE;

+		}

 

-	include(APPPATH.'config/smileys'.EXT);

+		include(APPPATH.'config/smileys'.EXT);

 	

-	if ( ! isset($smileys) OR ! is_array($smileys))

-	{

-		return FALSE;

+		if ( ! isset($smileys) OR ! is_array($smileys))

+		{

+			return FALSE;

+		}

+	

+		return $smileys;

 	}

-	

-	return $smileys;

 }

 

-

-

-

 ?>
\ No newline at end of file