encoding = $encoding; mb_internal_encoding($encoding); $this->contents = $this->replace_chars($params['content']); $this->wordLengthMin = $params['min_word_length']; $this->wordOccuredMin = $params['min_word_occur']; $this->word2WordPhraseLengthMin = $params['min_2words_length']; $this->phrase2WordLengthMin = $params['min_2words_phrase_length']; $this->phrase2WordLengthMinOccur = $params['min_2words_phrase_occur']; $this->word3WordPhraseLengthMin = $params['min_3words_length']; $this->phrase3WordLengthMin = $params['min_3words_phrase_length']; $this->phrase3WordLengthMinOccur = $params['min_3words_phrase_occur']; } function get_keywords() { $keywords = $this->parse_2words().$this->parse_words().$this->parse_3words(); return substr($keywords, 0, -2); } function replace_chars($content) { $content = mb_strtolower($content); $content = strip_tags($content); $punctuations = array(',', ')', '(', '.', "'", '"', '<', '>', '!', '?', '/', '-', '_', '[', ']', ':', '+', '=', '#', '$', '"', '©', '>', '<', ' ', '™', '®', ';', chr(10), chr(13), chr(9)); $content = str_replace($punctuations, " ", $content); $content = preg_replace('/ {2,}/si', " ", $content); return $content; } function parse_words() { $common = array("werkt","gebruikt","maakt","gaande","lang","ø","waaronder","hij","jou","diverse","zoals","legt","evenals","elke","vast","hoop","nemen","neem","mee","dus","gun","&rsquo","willen","maken","maak","eigen","willen","altijd","biedt","voert","nadruk","geven","ligt","betreft","nauw","welke","binnen","onze","hun","jij","kunt","komen","dan","veel","dat","het","worden","wordt","hebben","heeft","word","&lsquo","&rsquo","niet","gaan","omdat","jouw","wij","de","in","ons","vaak","snel","neem","waarin","bent","gerust","weer","dit","meer","zal","tot","nodig","heeft","&","alle","voordat","kan","ervoor","dat","deze","wijze","lange","goede","korte","aan","op","in","naast","over","onder","boven","zijn", "kunnen", "zeer", "gegeven", "zodat","wordt", "worden", "als", "é", "zowel", "door", "grote","able", "wel","uit","het","nog","komt","terug","bij","de","van","een","naar", "above", "act", "add", "afraid", "after", "again", "against", "age", "ago", "agree", "all", "almost", "alone", "along", "already", "also", "although", "always", "am", "amount", "an", "and", "anger", "angry", "animal", "another", "answer", "any", "appear", "apple", "are", "arrive", "arm", "arms", "around", "arrive", "as", "ask", "at", "attempt", "aunt", "away", "back", "bad", "bag", "bay", "be", "became", "because", "become", "been", "before", "began", "begin", "behind", "being", "bell", "belong", "below", "beside", "best", "better", "between", "beyond", "big", "body", "bone", "born", "borrow", "both", "bottom", "box", "boy", "break", "bring", "brought", "bug", "built", "busy", "but", "buy", "by", "call", "came", "can", "cause", "choose", "close", "close", "consider", "come", "consider", "considerable", "contain", "continue", "could", "cry", "cut", "dare", "dark", "deal", "dear", "decide", "deep", "did", "die", "do", "does", "dog", "done", "doubt", "down", "during", "each", "ear", "early", "eat", "effort", "either", "else", "end", "enjoy", "enough", "enter", "even", "ever", "every", "except", "expect", "explain", "fail", "fall", "far", "fat", "favor", "fear", "feel", "feet", "fell", "felt", "few", "fill", "find", "fit", "fly", "follow", "for", "forever", "forget", "from", "front", "gave", "get", "gives", "goes", "gone", "good", "got", "gray", "great", "green", "grew", "grow", "guess", "had", "half", "hang", "happen", "has", "hat", "have", "he", "hear", "heard", "held", "hello", "help", "her", "here", "hers", "high", "hill", "him", "his", "hit", "hold", "hot", "how", "however", "I", "if", "ill", "in", "indeed", "instead", "into", "iron", "is", "it", "its", "just", "keep", "kept", "knew", "know", "known", "late", "least", "led", "left", "lend", "less", "let", "like", "likely", "likr", "lone", "long", "look", "lot", "make", "many", "may", "me", "mean", "met", "might", "mile", "mine", "moon", "more", "most", "move", "much", "must", "my", "near", "nearly", "necessary", "neither", "never", "next", "no", "none", "nor", "not", "note", "nothing", "now", "number", "of", "off", "often", "oh", "on", "once", "only", "or", "other", "ought", "our", "out", "please", "prepare", "probable", "pull", "pure", "push", "put", "raise", "ran", "rather", "reach", "realize", "reply", "require", "rest", "run", "said", "same", "sat", "saw", "say", "see", "seem", "seen", "self", "sell", "sent", "separate", "set", "shall", "she", "should", "side", "sign", "since", "so", "sold", "some", "soon", "sorry", "stay", "step", "stick", "still", "stood", "such", "sudden", "suppose", "take", "taken", "talk", "tall", "tell", "ten", "than", "thank", "that", "the", "their", "them", "then", "there", "therefore", "these", "they", "this", "those", "though", "through", "till", "to", "today", "told", "tomorrow", "too", "took", "tore", "tought", "toward", "tried", "tries", "trust", "try", "turn", "two", "under", "until", "up", "upon", "us", "use", "usual", "various", "verb", "very", "visit", "want", "was", "we", "well", "went", "were", "what", "when", "where", "whether", "which", "while", "white", "who", "whom", "whose", "why", "will", "with", "within", "without", "would", "yes", "yet", "you", "young", "your", "br", "img", "p","lt", "gt", "quot", "copy","concert","gratuit","qui","les","des","de","voor","na","sous","avec","ook","maar","ben","kijk","per","deze","leur","cancer","breast","son","pour","dans","sur","une","aux","roi","passe","entier","notre","ans","album","nom","throughout"); $s = explode(" ", $this->contents); $k = array(); foreach( $s as $key=>$val ) { if(mb_strlen(trim($val)) >= $this->wordLengthMin && !in_array(trim($val), $common) && !is_numeric(trim($val))) { $k[] = trim($val); } } $k = array_count_values($k); $occur_filtered = $this->occure_filter($k, $this->wordOccuredMin); arsort($occur_filtered); $imploded = $this->implode(", ", $occur_filtered); unset($k); unset($s); return stripslashes($imploded); } function parse_2words() { $common = array("werkt","gebruikt","maakt","gaande","lang","ø","waaronder","hij","jou","diverse","zoals","legt","evenals","elke","vast","hoop","nemen","neem","mee","dus","gun","&rsquo","willen","maken","maak","eigen","willen","altijd","biedt","voert","nadruk","geven","ligt","betreft","nauw","welke","binnen","onze","hun","jij","kunt","komen","dan","veel","dat","het","worden","wordt","hebben","heeft","word","&lsquo","&rsquo","niet","gaan","omdat","jouw","wij","de","in","ons","vaak","snel","neem","waarin","bent","gerust","weer","bent","dit","meer","zal","tot","nodig","heeft","&","alle","voordat","kan","ervoor","dat","deze","wijze","lange","goede","korte","aan","op","in","naast","over","onder","boven","zijn", "kunnen", "zeer", "gegeven", "zodat","wordt", "worden", "als", "é", "zowel", "door", "grote","able", "wel","uit","het","nog","komt","terug","bij","de","van","een","naar", "above", "act", "add", "afraid", "after", "again", "against", "age", "ago", "agree", "all", "almost", "alone", "along", "already", "also", "although", "always", "am", "amount", "an", "and", "anger", "angry", "animal", "another", "answer", "any", "appear", "apple", "are", "arrive", "arm", "arms", "around", "arrive", "as", "ask", "at", "attempt", "aunt", "away", "back", "bad", "bag", "bay", "be", "became", "because", "become", "been", "before", "began", "begin", "behind", "being", "bell", "belong", "below", "beside", "best", "better", "between", "beyond", "big", "body", "bone", "born", "borrow", "both", "bottom", "box", "boy", "break", "bring", "brought", "bug", "built", "busy", "but", "buy", "by", "call", "came", "can", "cause", "choose", "close", "close", "consider", "come", "consider", "considerable", "contain", "continue", "could", "cry", "cut", "dare", "dark", "deal", "dear", "decide", "deep", "did", "die", "do", "does", "dog", "done", "doubt", "down", "during", "each", "ear", "early", "eat", "effort", "either", "else", "end", "enjoy", "enough", "enter", "even", "ever", "every", "except", "expect", "explain", "fail", "fall", "far", "fat", "favor", "fear", "feel", "feet", "fell", "felt", "few", "fill", "find", "fit", "fly", "follow", "for", "forever", "forget", "from", "front", "gave", "get", "gives", "goes", "gone", "good", "got", "gray", "great", "green", "grew", "grow", "guess", "had", "half", "hang", "happen", "has", "hat", "have", "he", "hear", "heard", "held", "hello", "help", "her", "here", "hers", "high", "hill", "him", "his", "hit", "hold", "hot", "how", "however", "I", "if", "ill", "in", "indeed", "instead", "into", "iron", "is", "it", "its", "just", "keep", "kept", "knew", "know", "known", "late", "least", "led", "left", "lend", "less", "let", "like", "likely", "likr", "lone", "long", "look", "lot", "make", "many", "may", "me", "mean", "met", "might", "mile", "mine", "moon", "more", "most", "move", "much", "must", "my", "near", "nearly", "necessary", "neither", "never", "next", "no", "none", "nor", "not", "note", "nothing", "now", "number", "of", "off", "often", "oh", "on", "once", "only", "or", "other", "ought", "our", "out", "please", "prepare", "probable", "pull", "pure", "push", "put", "raise", "ran", "rather", "reach", "realize", "reply", "require", "rest", "run", "said", "same", "sat", "saw", "say", "see", "seem", "seen", "self", "sell", "sent", "separate", "set", "shall", "she", "should", "side", "sign", "since", "so", "sold", "some", "soon", "sorry", "stay", "step", "stick", "still", "stood", "such", "sudden", "suppose", "take", "taken", "talk", "tall", "tell", "ten", "than", "thank", "that", "the", "their", "them", "then", "there", "therefore", "these", "they", "this", "those", "though", "through", "till", "to", "today", "told", "tomorrow", "too", "took", "tore", "tought", "toward", "tried", "tries", "trust", "try", "turn", "two", "under", "until", "up", "upon", "us", "use", "usual", "various", "verb", "very", "visit", "want", "was", "we", "well", "went", "were", "what", "when", "where", "whether", "which", "while", "white", "who", "whom", "whose", "why", "will", "with", "within", "without", "would", "yes", "yet", "you", "young", "your", "br", "img", "p","lt", "gt", "quot", "copy","concert","gratuit","qui","les","des","de","voor","na","sous","avec","leur","ook","maar","ben","deze","per","kijk","cancer","breast","son","pour","dans","sur","une","aux","roi","passe","entier","notre","ans","album","nom","throughout"); $x = explode(" ", $this->contents); $y = array(); for ($i=0; $i < count($x)-1; $i++) { if( (mb_strlen(trim($x[$i])) >= $this->word2WordPhraseLengthMin ) && (mb_strlen(trim($x[$i+1])) >= $this->word2WordPhraseLengthMin) ) { if(!in_array(trim($x[$i]), $common) && !in_array(trim($x[$i+1]), $common)) { $y[] = trim($x[$i])." ".trim($x[$i+1]); } } } if(is_array($y)) { $y = array_count_values($y); } $occur_filtered = $this->occure_filter($y, $this->phrase2WordLengthMinOccur); arsort($occur_filtered); $imploded = $this->implode(", ", $occur_filtered); unset($y); unset($x); return stripslashes($imploded); } function parse_3words() { $common = array("werkt","gebruikt","maakt","gaande","lang","ø","waaronder","hij","jou","diverse","zoals","legt","evenals","elke","vast","hoop","nemen","neem","mee","dus","gun","&rsquo","willen","maken","maak","eigen","willen","altijd","biedt","voert","nadruk","geven","ligt","betreft","nauw","welke","binnen","onze","hun","jij","kunt","komen","dan","veel","dat","het","worden","wordt","hebben","heeft","word","&lsquo","&rsquo","niet","gaan","omdat","jouw","wij","de","in","ons","vaak","snel","neem","waarin","bent","gerust","weer","bent","dit","meer","zal","tot","nodig","heeft","&","alle","voordat","kan","ervoor","dat","deze","wijze","lange","goede","korte","aan","op","in","naast","over","onder","boven","zijn", "kunnen", "zeer", "gegeven", "zodat","wordt", "worden", "als", "é", "zowel", "door", "grote","able", "wel","uit","het","nog","komt","terug","bij","de","van","een","naar", "above", "act", "add", "afraid", "after", "again", "against", "age", "ago", "agree", "all", "almost", "alone", "along", "already", "also", "although", "always", "am", "amount", "an", "and", "anger", "angry", "animal", "another", "answer", "any", "appear", "apple", "are", "arrive", "arm", "arms", "around", "arrive", "as", "ask", "at", "attempt", "aunt", "away", "back", "bad", "bag", "bay", "be", "became", "because", "become", "been", "before", "began", "begin", "behind", "being", "bell", "belong", "below", "beside", "best", "better", "between", "beyond", "big", "body", "bone", "born", "borrow", "both", "bottom", "box", "boy", "break", "bring", "brought", "bug", "built", "busy", "but", "buy", "by", "call", "came", "can", "cause", "choose", "close", "close", "consider", "come", "consider", "considerable", "contain", "continue", "could", "cry", "cut", "dare", "dark", "deal", "dear", "decide", "deep", "did", "die", "do", "does", "dog", "done", "doubt", "down", "during", "each", "ear", "early", "eat", "effort", "either", "else", "end", "enjoy", "enough", "enter", "even", "ever", "every", "except", "expect", "explain", "fail", "fall", "far", "fat", "favor", "fear", "feel", "feet", "fell", "felt", "few", "fill", "find", "fit", "fly", "follow", "for", "forever", "forget", "from", "front", "gave", "get", "gives", "goes", "gone", "good", "got", "gray", "great", "green", "grew", "grow", "guess", "had", "half", "hang", "happen", "has", "hat", "have", "he", "hear", "heard", "held", "hello", "help", "her", "here", "hers", "high", "hill", "him", "his", "hit", "hold", "hot", "how", "however", "I", "if", "ill", "in", "indeed", "instead", "into", "iron", "is", "it", "its", "just", "keep", "kept", "knew", "know", "known", "late", "least", "led", "left", "lend", "less", "let", "like", "likely", "likr", "lone", "long", "look", "lot", "make", "many", "may", "me", "mean", "met", "might", "mile", "mine", "moon", "more", "most", "move", "much", "must", "my", "near", "nearly", "necessary", "neither", "never", "next", "no", "none", "nor", "not", "note", "nothing", "now", "number", "of", "off", "often", "oh", "on", "once", "only", "or", "other", "ought", "our", "out", "please", "prepare", "probable", "pull", "pure", "push", "put", "raise", "ran", "rather", "reach", "realize", "reply", "require", "rest", "run", "said", "same", "sat", "saw", "say", "see", "seem", "seen", "self", "sell", "sent", "separate", "set", "shall", "she", "should", "side", "sign", "since", "so", "sold", "some", "soon", "sorry", "stay", "step", "stick", "still", "stood", "such", "sudden", "suppose", "take", "taken", "talk", "tall", "tell", "ten", "than", "thank", "that", "the", "their", "them", "then", "there", "therefore", "these", "they", "this", "those", "though", "through", "till", "to", "today", "told", "tomorrow", "too", "took", "tore", "tought", "toward", "tried", "tries", "trust", "try", "turn", "two", "under", "until", "up", "upon", "us", "use", "usual", "various", "verb", "very", "visit", "want", "was", "we", "well", "went", "were", "what", "when", "where", "whether", "which", "while", "white", "who", "whom", "whose", "why", "will", "with", "within", "without", "would", "yes", "yet", "you", "young", "your", "br", "img", "p","lt", "gt", "quot", "copy","concert","gratuit","qui","les","des","de","voor","na","sous","avec","leur","ook","maar","ben","deze","per","kijk","cancer","breast","son","pour","dans","sur","une","aux","roi","passe","entier","notre","ans","album","nom","throughout"); $a = explode(" ", $this->contents); $b = array(); for ($i=0; $i < count($a)-2; $i++) { if( (mb_strlen(trim($a[$i])) >= $this->word3WordPhraseLengthMin) && !in_array(trim($a[$i+1]), $common) && !in_array(trim($a[$i+2]), $common) && !in_array(trim($a[$i]), $common) && (mb_strlen(trim($a[$i+1])) > $this->word3WordPhraseLengthMin) && (mb_strlen(trim($a[$i+2])) > $this->word3WordPhraseLengthMin) && (mb_strlen(trim($a[$i]).trim($a[$i+1]).trim($a[$i+2])) > $this->phrase3WordLengthMin) ) { $b[] = trim($a[$i])." ".trim($a[$i+1])." ".trim($a[$i+2]); } } $b = array_count_values($b); $occur_filtered = $this->occure_filter($b, $this->phrase3WordLengthMinOccur); arsort($occur_filtered); $imploded = $this->implode(", ", $occur_filtered); unset($a); unset($b); return $imploded; } function occure_filter($array_count_values, $min_occur) { $occur_filtered = array(); if(is_array($array_count_values)) { foreach ($array_count_values as $word => $occured) { if ($occured >= $min_occur) { $occur_filtered[$word] = $occured; } } } return $occur_filtered; } function implode($gule, $array) { $c = ""; foreach($array as $key=>$val) { @$c .= $key.$gule; } return $c; } } ?>classes->loadClasses(array("Pages","Plans","EmbeVi","Country","Categories","Members","Auth","Devices")); $cPages = new Pages($oController); $cAuth = new Auth($oController); $cMembers = new Members($oController); $oPage = $cPages->getPageById(PAGE_ID); $oController->template->attach("oPage",$oPage); $request = $oController->getRequest(); /*if($cAuth->checkMemberLogin() === true) { $oCurrentMember = $cMembers->getMemberById($_COOKIE["member_id"]); $oController->template->attach("oCurrentMember",$oCurrentMember); } define("ONEYEAR",time()+31556926);*/ /*if(!isset($_COOKIE['user_id'])) { setcookie("user_id",$oController->template->rand_str(),ONEYEAR,"/"); }*/ if($request->view == "lenovo" && $request->action_address!="") { $this->redirect(str_replace("lenovo","/lenovo-inc",$request->action_address),"301"); }elseif($request->view == "lenovo") { $this->redirect("/lenovo-inc","301"); } $cDevices = new Devices($oController); /*if(isset($_COOKIE["user_id"])) { $sUserId = $_COOKIE["user_id"]; $aViewed = $cDevices->getViewed($sUserId); $oController->template->attach("aViewed",$aViewed); }*/ //$oController->template->addNormalJavascript("/js/compiled/compiled.js"); $oController->template->addNormalJavascript("/js/headjs/1.03/head.load.min.js"); $oController->template->addJavascript(STATICURL."/js/compiled/compiledorig.js"); $oController->template->addCSS("bootstrap.css"); } function getTemplateVariables() { return array(); } } ?>