diff --git a/application/config/autoload.php b/application/config/autoload.php index 07f208e..29473a9 100755 --- a/application/config/autoload.php +++ b/application/config/autoload.php @@ -64,7 +64,7 @@ $autoload['libraries'] = array('lang_detect', 'database', 'session', 'access'); | $autoload['helper'] = array('url', 'file'); */ -$autoload['helper'] = array('url', 'html', 'language'); +$autoload['helper'] = array('url', 'html', 'language', 'hash'); /* diff --git a/application/helpers/MY_date_helper.php b/application/helpers/MY_date_helper.php new file mode 100644 index 0000000..30f7147 --- /dev/null +++ b/application/helpers/MY_date_helper.php @@ -0,0 +1,39 @@ + + */ + +// ------------------------------------------------------------------------ + +/** + * CodeIgniter Date Helpers + * + * @package CodeIgniter + * @subpackage Helpers + * @category Helpers + * @author ExpressionEngine Dev Team + * @link http://codeigniter.com/user_guide/helpers/date_helper.html + */ + +// ------------------------------------------------------------------------ + +/** + * Get "now" time formatted for MySQL + * + * Returns time() formatted for direct insertion into a DATETIME field. + * + * @access public + * @return integer + */ +if ( ! function_exists('mysql_now')) +{ + function mysql_now() + { + return mdate('%Y-%m-%d %H:%i:%s', now()); + } +} + +/* End of file MY_date_helper.php */ +/* Location: ./application/helpers/MY_date_helper.php */ \ No newline at end of file diff --git a/application/helpers/hash_helper.php b/application/helpers/hash_helper.php new file mode 100644 index 0000000..0b977ae --- /dev/null +++ b/application/helpers/hash_helper.php @@ -0,0 +1,23 @@ + + */ + +/** + * Generate a pseudo-random SHA1-hash. + * + * @access public + * @return integer + */ +if ( ! function_exists('random_hash')) +{ + function random_hash($len = 40) + { + return substr(sha1(rand(1,1000).now().rand(1001,2000)), 0, $len); + } +} + +/* End of file MY_date_helper.php */ +/* Location: ./application/helpers/MY_date_helper.php */ \ No newline at end of file