summaryrefslogtreecommitdiffstats
path: root/system/helpers/smiley_helper.php
diff options
context:
space:
mode:
authorphilsturgeon <devnull@localhost>2011-06-15 17:00:03 +0200
committerphilsturgeon <devnull@localhost>2011-06-15 17:00:03 +0200
commit0fe54dbaf89a8337d27b9203f74891cf1a799715 (patch)
treece168b3c24788e5a4a31e0cc65b64f54e25ee8a2 /system/helpers/smiley_helper.php
parent3a43c7adae7737d68a0eeca663cc2dd3fc5b0cf3 (diff)
parent3ef65bd7491f847fecdab1acc9687f0e90eee09b (diff)
Merged Alex Bilbies MSSQL changes.
Diffstat (limited to 'system/helpers/smiley_helper.php')
-rw-r--r--system/helpers/smiley_helper.php24
1 files changed, 13 insertions, 11 deletions
diff --git a/system/helpers/smiley_helper.php b/system/helpers/smiley_helper.php
index 463881f58..22ca4df77 100644
--- a/system/helpers/smiley_helper.php
+++ b/system/helpers/smiley_helper.php
@@ -1,4 +1,4 @@
-<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
+<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/**
* CodeIgniter
*
@@ -30,7 +30,7 @@
/**
* Smiley Javascript
*
- * Returns the javascript required for the smiley insertion. Optionally takes
+ * Returns the javascript required for the smiley insertion. Optionally takes
* an array of aliases to loosely couple the smiley array to the view.
*
* @access public
@@ -157,7 +157,7 @@ if ( ! function_exists('get_clickable_smileys'))
foreach ($smileys as $key => $val)
{
// Keep duplicates from being used, which can happen if the
- // mapping array contains multiple identical replacements. For example:
+ // 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]]))
@@ -204,7 +204,7 @@ if ( ! function_exists('parse_smileys'))
}
// Add a trailing slash to the file path if needed
- $image_url = preg_replace("/(.+?)\/*$/", "\\1/", $image_url);
+ $image_url = preg_replace("/(.+?)\/*$/", "\\1/", $image_url);
foreach ($smileys as $key => $val)
{
@@ -229,19 +229,21 @@ if ( ! function_exists('_get_smiley_array'))
{
function _get_smiley_array()
{
- if ( ! file_exists(APPPATH.'config/smileys'.EXT))
+ if (defined('ENVIRONMENT') AND file_exists(APPPATH.'config/'.ENVIRONMENT.'/smileys.php'))
{
- return FALSE;
+ include(APPPATH.'config/'.ENVIRONMENT.'/smileys.php');
+ }
+ elseif (file_exists(APPPATH.'config/smileys.php'))
+ {
+ include(APPPATH.'config/smileys.php');
}
- include(APPPATH.'config/smileys'.EXT);
-
- if ( ! isset($smileys) OR ! is_array($smileys))
+ if (isset($smileys) AND is_array($smileys))
{
- return FALSE;
+ return $smileys;
}
- return $smileys;
+ return FALSE;
}
}