$wordCount = Definition::getWordCount(); $wordCountRough = $wordCount - $wordCount % 10000; SmartyWrap::assign('page_title', 'Dicționar explicativ al limbii române'); SmartyWrap::assign('onHomePage', '1'); SmartyWrap::assign('letters', preg_split('//u', 'aăâbcdefghiîjklmnopqrsștțuvwxyz')); SmartyWrap::assign('words_total', util_formatNumber($wordCount, 0)); SmartyWrap::assign('words_rough', util_formatNumber($wordCountRough, 0)); SmartyWrap::assign('words_last_month', util_formatNumber(Definition::getWordCountLastMonth(), 0)); SmartyWrap::assign('widgets', $widgets); SmartyWrap::assign('numEnabledWidgets', $numEnabledWidgets); /* WotD part */ $wotd = WordOfTheDay::getTodaysWord(); if (!$wotd) { WordOfTheDay::updateTodaysWord(); $wotd = WordOfTheDay::getTodaysWord(); } $defId = WordOfTheDayRel::getRefId($wotd->id); $def = Model::factory('Definition')->where('id', $defId)->where('status', ST_ACTIVE)->find_one(); SmartyWrap::assign('thumbUrl', $wotd->getThumbUrl()); SmartyWrap::assign('title', $def->lexicon); SmartyWrap::assign('today', date('Y/m/d')); /* WotM part */ $wotm = WordOfTheMonth::getCurrentWotM(); $def = Model::factory('Definition')->where('id', $wotm->definitionId)->where('status', ST_ACTIVE)->find_one(); SmartyWrap::assign('thumbUrlM', $wotm->getThumbUrl()); SmartyWrap::assign('articol', $wotm->article); SmartyWrap::assign('titleM', $def->lexicon); SmartyWrap::assign('todayM', date('Y/m')); $page = Config::get('global.aprilFoolsDay') ? 'index-afd.ihtml' : 'index.ihtml'; SmartyWrap::displayPageWithSkin($page);
if ($_POST['hiddenText'] == '') { return ''; } else { $search = array(); $replace = array(); $buffer = $_POST['hiddenText']; foreach ($_POST as $key => $value) { if (is_numeric($key)) { $search[] = '/@@' . $key . '@@/i'; $replace[] = $value; } } return preg_replace($search, $replace, $buffer); } } else { return ''; } } } if (strstr($_SERVER['SCRIPT_NAME'], 'diacritice.php')) { SmartyWrap::assign('page_title', 'Corector diacritice'); $obj = new DiacriticsFixer(); if (isset($_POST['text']) && $_POST['text'] != '') { SmartyWrap::assign('textarea', '<div id="textInput">' . $obj->fix($_POST['text']) . '</div>'); SmartyWrap::assign('hiddenText', '<input type="hidden" name="hiddenText" value="' . $obj->getHiddenText() . '">'); } else { SmartyWrap::assign('textarea', '<textarea name="text" id="textInput" placeholder="introduceți textul aici">' . $obj->replaceDiacritics() . '</textarea>'); SmartyWrap::assign('hiddenText', '<input type="hidden" name="hiddenText" value="">'); } SmartyWrap::displayPageWithSkin('../diacritics_fix/diacritics_fix.ihtml'); }