MAX_WOTD_LIST_LENGTH) { $wListLength = DEFAULT_WOTD_LIST_LENGTH; } } else { $wListLength = NULL; } $listLength = (int) util_getRequestParameter('n'); if (!is_int($listLength) || $listLength<=MIN_LIST_LENGTH || $listLength>MAX_LIST_LENGTH) { $listLength = DEFAULT_LIST_LENGTH; } $showSource = (int) util_getRequestParameter('s'); if ( !is_int($showSource) || $showSource!=1 ){ $showSource = DEFAULT_SHOW_LIST; } $noSkin = (int) util_getRequestParameter('k'); if ( !is_int($noSkin) || $noSkin!=1 ){ $noSkin = DEFAULT_SHOW_LIST; } /* $query = sprintf('select id from Lexem order by rand() limit %d', $listLength); $ids = db_getArray($query); $query = sprintf(RANDOM_WORDS_QUERY, $showSource?SOURCE_PART_RANDOM_WORDS:'', implode(",",$ids)); $forms = db_getArrayOfRows($query); */ $wotd = ''; if (is_null($wListLength)) { $query = sprintf(RANDOM_WORDS_QUERY, $showSource?SOURCE_PART_RANDOM_WORDS:'', $listLength); } else { $query = sprintf(RANDOM_WOTD_QUERY, $wListLength); $wotd = ' ale zilei'; } $forms = db_getArrayOfRows($query); $cnt = count($forms); if ($noSkin) { SmartyWrap::assign('forms', $forms); SmartyWrap::displayWithoutSkin('common/randomWordListSimple.ihtml'); } else { SmartyWrap::assign('forms', $forms); SmartyWrap::assign('page_title', "O listă de {$cnt} de cuvinte{$wotd} alese la întâmplare."); SmartyWrap::displayCommonPageWithSkin('randomWordList.ihtml'); } ?>