$form = util_getRequestParameter('form');
$locVersion = util_getRequestParameter('locVersion');
$locVersions = pref_getLocVersions();
if ($locVersion && $form) {
    LocVersion::changeDatabase($locVersion);
    $form = StringUtil::cleanupQuery($form);
    smarty_assign('page_title', 'Verificare LOC: ' . $form);
    $ifs = loadLoc($form);
    $lexems = array();
    $inflections = array();
    foreach ($ifs as $if) {
        $lexems[] = Lexem::get_by_id($if->lexemId);
        $inflections[] = Inflection::get_by_id($if->inflectionId);
    }
    smarty_assign('form', $form);
    smarty_assign('selectedLocVersion', $locVersion);
    smarty_assign('ifs', $ifs);
    smarty_assign('lexems', $lexems);
    smarty_assign('inflections', $inflections);
} else {
    smarty_assign('selectedLocVersion', $locVersions[1]->name);
    smarty_assign('page_title', 'Căutare formă flexionară în LOC ' . $form);
}
setlocale(LC_ALL, "ro_RO.utf8");
smarty_assign('locVersions', $locVersions);
smarty_displayCommonPageWithSkin('scrabble-flexiune.ihtml');
function loadLoc($cuv)
{
    $field = StringUtil::hasDiacritics($cuv) ? 'formNoAccent' : 'formUtf8General';
    return Model::factory('InflectedForm')->raw_query("select distinct I.* from InflectedForm I, Lexem L, Model M, ModelDescription MD, ModelType MT " . "where I.lexemId = L.id and L.modelType = MT.code and MT.canonical = M.modelType and L.modelNumber = M.number and M.id = MD.modelId " . "and I.inflectionId = MD.inflectionId and I.variant = MD.variant and MD.applOrder = 0 " . "and I.{$field} = '{$cuv}' and L.isLoc and MD.isLoc order by L.formNoAccent", null)->find_many();
}
$identity = util_getRequestParameter('identity');
$email = util_getRequestParameter('email');
smarty_assign('identity', $identity);
smarty_assign('email', $email);
smarty_assign('page_title', 'Parolă uitată');
smarty_assign('suggestHiddenSearchForm', true);
if (!$submitButton) {
    smarty_displayCommonPageWithSkin('auth/parola-uitata.ihtml');
} else {
    if (!$email) {
        FlashMessage::add('Trebuie să introduceți o adresă de e-mail.');
    } else {
        $user = User::get_by_email($email);
        if ($user) {
            log_userLog("Password recovery requested for {$email} from " . $_SERVER['REMOTE_ADDR']);
            // Create the token
            $pt = Model::factory('PasswordToken')->create();
            $pt->userId = $user->id;
            $pt->token = util_randomCapitalLetterString(20);
            $pt->save();
            // Send email
            smarty_assign('homePage', util_getFullServerUrl());
            smarty_assign('token', $pt->token);
            $body = smarty_fetch('email/resetPassword.ihtml');
            $ourEmail = pref_getContactEmail();
            $result = mail($email, "Schimbarea parolei pentru DEX online", $body, "From: DEX online <{$ourEmail}>\r\nReply-To: {$ourEmail}");
            // Display a confirmation even for incorrect addresses.
            smarty_displayCommonPageWithSkin('auth/passwordRecoveryEmailSent.ihtml');
        }
    }
}
Example #3
0
    if (!is_null($conjugations) || !is_null($declensions)) {
        $page_keywords .= ", paradigmă {$cuv}";
        $page_description .= ', paradigme';
    }
    $page_keywords .= ", dexonline, DEX online";
    $page_description .= " pentru {$cuv}";
    $page_title = '';
    if (count($sourceList)) {
        $page_description .= " din dicționarele: " . implode(", ", $sourceList);
        if (count($sourceList) == 1) {
            $page_title = ' ' . $sourceList[0];
        }
    }
    $page_title .= $showParadigm ? ' si paradigme' : '';
    smarty_assign('page_title', "{$cuv} - definitie{$page_title}");
    smarty_assign('page_keywords', $page_keywords);
    smarty_assign('page_description', $page_description);
}
// Ads
AdsModule::runAllModules(empty($lexems) ? null : $lexems, empty($definitions) ? null : $definitions);
smarty_assign('text', $text);
smarty_assign('searchType', $searchType);
smarty_assign('showParadigm', $showParadigm);
smarty_assign('paradigmLink', $paradigmLink);
smarty_assign('advancedSearch', $text || $sourceId);
if (!$xml) {
    smarty_displayCommonPageWithSkin('search.ihtml');
} else {
    header('Content-type: text/xml');
    smarty_displayWithoutSkin('common/searchXML.ihtml');
}
        $paradigms[] = $paradigm;
    }
    smarty_assign('modelsToDisplay', $modelsToDisplay);
    smarty_assign('lexems', $lexems);
    smarty_assign('paradigms', $paradigms);
} else {
    smarty_assign('selectedLocVersion', $locVersions[0]->name);
    // LocVersion::changeDatabase($locVersion);
}
$modelTypes = ModelType::loadCanonical();
$models = FlexModel::loadByType($modelType ? $modelType : $modelTypes[0]->code);
smarty_assign('page_title', 'Modele de flexiune');
smarty_assign('locVersions', $locVersions);
smarty_assign('modelTypes', $modelTypes);
smarty_assign('models', $models);
smarty_displayCommonPageWithSkin('modele-flexiune.ihtml');
/*************************************************************************/
/**
 * Load the forms to display for a model when a lexem already exists. This code is specific to each LOC version.
 */
function getExistingForms($lexemId, $locVersion)
{
    if ($locVersion >= '5.0') {
        return InflectedForm::loadByLexemIdMapByInflectionRank($lexemId);
    } else {
        return InflectedForm::loadByLexemIdMapByInflectionId($lexemId);
    }
}
function getNewForms($lexem, $locVersion)
{
    $ifArray = $lexem->generateParadigm();
$content = "";
$messageAlert = array();
$blackList = array();
foreach ($rezultate as $iter) {
    # Skip dexonline.ro from results
    #if(stripos($iter->url, "dexonline.ro") == true)
    #	continue;
    $components = parse_url($iter->url);
    if (StringUtil::endsWith($components['host'], 'dexonline.ro')) {
        continue;
    }
    $listAll[] = $iter->url;
    # Search for "licenta GPL" or "dexonline.ro" in resulted page
    $content = @file_get_contents($iter->url);
    $poslink = stripos($content, "dexonline.ro");
    $posGPL = stripos($content, "GPL");
    if ($poslink === false && $posGPL === false) {
        $blackList[] = $iter->url;
        $messageAlert[] = "Licenta GPL sau link catre dexonline.ro negasite in site-ul {$iter->url} ";
    } else {
        $messageAlert[] = "A fost gasita o mentiune catre licenta GPL sau un link catre dexonline.ro in site-ul {$iter->url} ";
    }
}
smarty_assign('page_title', 'Site Clones');
smarty_assign('definition', $definition);
smarty_assign('listAll', $listAll);
smarty_assign('alert', $messageAlert);
# Print Blacklist items if any
smarty_assign("blackList", $blackList);
smarty_displayCommonPageWithSkin("siteClones.ihtml");
        }
    } else {
        $openidNick = $loginType == 1 ? $data['fullname'] : ($loginType == 2 ? $data['nickname'] : $nick);
        $user = User::get_by_nick($openidNick);
        if ($user) {
            FlashMessage::add('Acest nume de utilizator este deja luat.');
        } else {
            if (mb_strlen($openidNick) < 3 || mb_strlen($openidNick) > 20) {
                FlashMessage::add('Numele de utilizator trebuie să aibă între 3 și 20 de caractere.');
            } else {
                if (!preg_match("/^([-a-z0-9_. ]|ă|â|î|ș|ț|Ă|Â|Î|Ș|Ț)+\$/i", $openidNick)) {
                    FlashMessage::add('Numele de utilizator poate conține doar litere, cifre, spații și simbolurile . - _');
                } else {
                    if (!preg_match("/[a-z]|ă|â|î|ș|ț|Ă|Â|Î|Ș|Ț/i", $openidNick)) {
                        FlashMessage::add('Numele de utilizator trebuie să conțină cel puțin o literă.');
                    } else {
                        $data['nickname'] = $openidNick;
                        session_login(null, $data);
                    }
                }
            }
        }
    }
}
smarty_assign('page_title', 'Autentificare cu OpenID');
smarty_assign('suggestHiddenSearchForm', true);
smarty_assign('data', $data);
smarty_assign('randString', $randString);
smarty_assign('loginType', $loginType);
smarty_displayCommonPageWithSkin('auth/chooseIdentity.ihtml');
Example #7
0
<?php

require_once "../phplib/util.php";
$p = util_getRequestParameter('p');
switch ($p) {
    case '404':
        smarty_assign('page_title', 'Pagină inexistentă');
        break;
    case 'faq':
        smarty_assign('page_title', 'Informații');
        break;
    case 'contact':
        smarty_assign('page_title', 'Contact');
        break;
    case 'license':
        smarty_assign('page_title', 'Licență Publică Generală GNU');
        break;
    case 'links':
        smarty_assign('page_title', 'Legături');
        break;
    case 'ads':
        smarty_assign('page_title', 'Publicitate pe DEX online');
        break;
    default:
        exit;
}
smarty_displayCommonPageWithSkin("{$p}.ihtml");
Example #8
0
    WordOfTheDay::updateTodaysWord();
    $wotd = WordOfTheDay::get_by_displayDate($mysqlDate);
}
$archive = WordOfTheDay::getArchiveWotD(date('Y', $timestamp), date('m', $timestamp));
$defId = WordOfTheDayRel::getRefId($wotd->id);
$def = Definition::get_by_id($defId);
$searchResults = SearchResult::mapDefinitionArray(array($def));
setlocale(LC_ALL, 'ro_RO');
$roDate = strftime("%e %B %Y", $timestamp);
$pageTitle = sprintf("Cuvântul zilei: %s (%s)", $def->lexicon, $roDate);
if ($mysqlDate > WOTD_BIG_BANG) {
    smarty_assign('prevday', date('Y/m/d', $timestamp - 86400));
}
if ($mysqlDate < $today) {
    smarty_assign('nextday', date('Y/m/d', $timestamp + 86400));
}
smarty_assign('imageUrl', $wotd->getImageUrl());
smarty_assign('timestamp', $timestamp);
smarty_assign('archive', $archive);
smarty_assign('mysqlDate', $mysqlDate);
smarty_assign('page_title', $pageTitle);
smarty_assign('page_keywords', "Cuvântul zilei, {$def->lexicon}, dexonline, DEX online, {$pageTitle}");
smarty_assign('page_description', "{$pageTitle} de la dexonline");
smarty_assign('searchResult', array_pop($searchResults));
if ($type == 'url') {
    smarty_assign('today', $today);
    smarty_assign('title', $def->lexicon);
    smarty_displayWithoutSkin('common/bits/wotdurl.ihtml');
} else {
    smarty_displayCommonPageWithSkin('wotd.ihtml');
}
$token = util_getRequestParameter('token');
$identity = util_getRequestParameter('identity');
$pt = PasswordToken::get_by_token($token);
$data = FileCache::get($identity);
if (!$pt) {
    FlashMessage::add('Ați introdus un cod de recuperare incorect.');
} else {
    if ($pt->createDate < time() - 24 * 3600) {
        FlashMessage::add('Codul de recuperare introdus a expirat.');
    } else {
        if (!$data) {
            FlashMessage::add('Ați introdus o identitate incorectă.');
        } else {
            $user = User::get_by_id($pt->userId);
            if (!$user) {
                FlashMessage::add('Ați introdus un cod de recuperare incorect.');
            } else {
                if ($user->identity) {
                    FlashMessage::add('Acest cont a fost deja revendicat de o identitate OpenID.');
                } else {
                    FlashMessage::add('Contul dumneavoastră a fost recuperat și unificat cu identitatea OpenID.', 'info');
                    session_login($user, $data);
                }
            }
        }
    }
}
smarty_assign('page_title', 'Recuperarea parolei');
smarty_assign('suggestHiddenSearchForm', true);
smarty_displayCommonPageWithSkin('auth/passwordRecoveryWrongData.ihtml');
Example #10
0
    // Re-rank the inflections according to the order in $inflectionIds
    $modelTypeMap = array();
    foreach ($inflectionIds as $inflId) {
        $infl = Inflection::get_by_id($inflId);
        $rank = array_key_exists($infl->modelType, $modelTypeMap) ? $modelTypeMap[$infl->modelType] + 1 : 1;
        $modelTypeMap[$infl->modelType] = $rank;
        $infl->rank = $rank;
        $infl->save();
    }
    // Add a new inflection if one is given
    if ($newDescription) {
        $infl = Model::factory('Inflection')->create();
        $infl->description = $newDescription;
        $infl->modelType = $newModelType;
        $infl->rank = $modelTypeMap[$newModelType] + 1;
        $infl->save();
    }
    util_redirect('flexiuni');
}
// Tag inflections which can be safely deleted (only those that aren't being used by any model)
$inflections = Model::factory('Inflection')->order_by_asc('modelType')->order_by_asc('rank')->find_many();
$usedInflectionIds = db_getArray('select distinct inflectionId from ModelDescription');
foreach ($inflections as $infl) {
    $infl->canDelete = !in_array($infl->id, $usedInflectionIds);
}
smarty_assign('page_title', 'Editare flexiuni');
smarty_assign('suggestHiddenSearchForm', true);
smarty_assign('inflections', $inflections);
smarty_assign('modelTypes', ModelType::loadCanonical());
smarty_displayCommonPageWithSkin('editor-modele/flexiuni.ihtml');
    $src->canDistribute = util_getRequestParameterWithDefault("canDistribute", 0);
    $src->defCount = util_getRequestIntParameter("defCount");
    if (validate($src)) {
        // For new sources, set displayOrder to the highest available + 1
        if (!$sourceId) {
            $src->displayOrder = Model::factory('Source')->count() + 1;
        }
        $src->updatePercentComplete();
        $src->save();
        FlashMessage::add('Modificările au fost salvate', 'info');
        util_redirect("editare-sursa?id={$src->id}");
    }
}
smarty_assign('src', $src);
smarty_assign('page_title', $sourceId ? "Editare sursă {$src->shortName}" : "Adăugare sursă");
smarty_displayCommonPageWithSkin('editare-sursa.ihtml');
/**
 * Returns true on success, false on errors.
 */
function validate($src)
{
    $success = true;
    if (!$src->name) {
        FlashMessage::add('Numele nu poate fi vid.');
        $success = false;
    }
    if (!$src->shortName) {
        FlashMessage::add('Numele scurt nu poate fi vid.');
        $success = false;
    }
    if (!$src->urlName) {
}

$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:'', join(",",$ids));
$forms = db_getArrayOfRows($query);
*/

$query = sprintf(RANDOM_WORDS_QUERY, $showSource?SOURCE_PART_RANDOM_WORDS:'', $listLength);
$forms = db_getArrayOfRows($query);

$cnt = count($forms);

if ($noSkin) {
    smarty_assign('forms', $forms);
    smarty_displayWithoutSkin('common/randomWordListSimple.ihtml');
}
else {
    smarty_assign('forms', $forms);
    smarty_assign('page_title', "O listă de {$cnt} de cuvinte alese la întâmplare.");
    smarty_displayCommonPageWithSkin('randomWordList.ihtml');
}
?>
Example #13
0
<?php

require_once "../../phplib/util.php";
util_assertNotMirror();
util_assertNotLoggedIn();
$openid = util_getRequestParameter('openid');
switch ($openid) {
    case 'google':
        $openid = "https://www.google.com/accounts/o8/id";
        break;
    case 'yahoo':
        $openid = "http://yahoo.com/";
        break;
}
if ($openid) {
    OpenID::beginAuth($openid, null);
    smarty_displayWithoutSkin('common/auth/beginAuth.ihtml');
    exit;
}
smarty_assign('openid', $openid);
smarty_assign('page_title', 'Autentificare cu OpenID');
smarty_assign('suggestHiddenSearchForm', true);
smarty_displayCommonPageWithSkin('auth/login.ihtml');
require_once "../phplib/util.php";
util_assertModerator(PRIV_ADMIN);
$userIds = util_getRequestParameter('userIds');
$newNick = util_getRequestParameter('newNick');
$newCheckboxes = util_getRequestParameterWithDefault("newPriv", array());
$submitButton = util_getRequestParameter('submitButton');
if ($submitButton) {
    foreach ($userIds as $userId) {
        $checkboxes = util_getRequestParameterWithDefault("priv_{$userId}", array());
        $user = User::get_by_id($userId);
        $user->moderator = array_sum($checkboxes);
        $user->save();
    }
    if ($newNick) {
        $user = User::get_by_nick($newNick);
        if ($user) {
            $user->moderator = array_sum($newCheckboxes);
            $user->save();
        } else {
            FlashMessage::add("Numele de utilizator „{$newNick}” nu există");
            util_redirect("moderatori");
        }
    }
    FlashMessage::add('Modificările au fost salvate', 'info');
    util_redirect("moderatori");
}
smarty_assign('page_title', 'Moderatori');
smarty_assign('users', Model::factory('User')->where_not_equal('moderator', 0)->order_by_asc('nick')->find_many());
smarty_displayCommonPageWithSkin('moderatori.ihtml');
Example #15
0
    $user->email = StringUtil::scrambleEmail($user->email);
    // Find the rank of this user by number of words and number of characters
    $topWords = TopEntry::getTopData(CRIT_WORDS, SORT_DESC, true);
    $numUsers = count($topWords);
    $rankWords = 0;
    while ($rankWords < $numUsers && $topWords[$rankWords]->userNick != $nick) {
        $rankWords++;
    }
    $userData['rank_words'] = $rankWords + 1;
    if ($rankWords < $numUsers) {
        $topEntry = $topWords[$rankWords];
        $userData['last_submission'] = $topEntry->timestamp;
        $userData['num_words'] = $topEntry->numDefinitions;
        $userData['num_chars'] = $topEntry->numChars;
    }
    $topChars = TopEntry::getTopData(CRIT_CHARS, SORT_DESC, true);
    $numUsers = count($topChars);
    $rankChars = 0;
    while ($rankChars < $numUsers && $topChars[$rankChars]->userNick != $nick) {
        $rankChars++;
    }
    $userData['rank_chars'] = $rankChars + 1;
    smarty_assign('page_title', "Utilizator: {$nick}");
} else {
    smarty_assign('missingNick', $nick);
    smarty_assign('page_title', 'Utilizator inexistent');
}
smarty_assign('user', $user);
smarty_assign('userData', $userData);
smarty_displayCommonPageWithSkin('user.ihtml');
    $changeSet['changesCount'] = 0;
    if ($row['OldUserId'] !== $row['NewUserId']) {
        $changeSet['changesCount']++;
    }
    if ($row['OldSourceId'] !== $row['NewSourceId']) {
        $changeSet['changesCount']++;
    }
    if ($row['OldStatus'] !== $row['NewStatus']) {
        $changeSet['OldStatusName'] = $statuses[$row['OldStatus']];
        $changeSet['NewStatusName'] = $statuses[$row['NewStatus']];
        $changeSet['changesCount']++;
    }
    if ($row['OldLexicon'] !== $row['NewLexicon']) {
        $changeSet['changesCount']++;
    }
    if ($row['OldModUserId'] !== $row['NewModUserId']) {
        $changeSet['changesCount']++;
    }
    if ($row['OldInternalRep'] !== $row['NewInternalRep']) {
        $changeSet['diff'] = htmlDiff($row['OldInternalRep'], $row['NewInternalRep']);
        $changeSet['changesCount']++;
    }
    if ($changeSet['changesCount'] > 0) {
        $changeSets[] = $changeSet;
    }
}
smarty_assign('page_title', 'Istoria definiției ' . $def->lexicon);
smarty_assign('def', $def);
smarty_assign('changeSets', $changeSets);
smarty_displayCommonPageWithSkin('istoria-definitiei.ihtml');
<?php

require_once "../phplib/util.php";
$user = session_getUser();
if (!$user) {
    util_redirect('auth/login');
}
smarty_assign('page_title', 'Cuvinte favorite');
smarty_assign('bookmarks', UserWordBookmarkDisplayObject::getByUser($user->id));
smarty_displayCommonPageWithSkin('cuvinte-favorite.ihtml');
$user = session_getUser();
if (!$user) {
    util_redirect('auth/login');
}
if ($sendButton) {
    $user->detailsVisible = $detailsVisible ? 1 : 0;
    $user->preferences = $userPrefs;
    if (session_isValidSkin($skin)) {
        $user->skin = $skin;
    }
    $user->save();
    session_setVariable('user', $user);
    FlashMessage::add('Informațiile au fost salvate.', 'info');
} else {
    $detailsVisible = $user->detailsVisible;
    $skin = session_getSkin();
    $userPrefs = $user->preferences;
}
foreach (preg_split('/,/', $userPrefs) as $pref) {
    if (isset($userPreferencesSet[$pref])) {
        $userPreferencesSet[$pref]['checked'] = true;
    }
}
smarty_assign('detailsVisible', $detailsVisible);
smarty_assign('userPrefs', $userPreferencesSet);
smarty_assign('skin', $skin);
smarty_assign('availableSkins', pref_getServerPreference('skins'));
smarty_assign('privilegeNames', $PRIV_NAMES);
smarty_assign('page_title', 'Contul meu');
smarty_displayCommonPageWithSkin('auth/contul-meu.ihtml');
Example #19
0
<?php

require_once "../phplib/util.php";
$letter = util_getRequestParameter('letter');
if (mb_strlen($letter) != '1') {
    exit;
}
$forms = db_getArray("select distinct formNoAccent from Lexem where formNoAccent like '{$letter}%' order by formNoAccent");
smarty_assign('forms', $forms);
smarty_assign('letter', $letter);
smarty_assign('page_title', "Cuvinte care încep cu " . mb_strtoupper($letter));
smarty_displayCommonPageWithSkin('wordList.ihtml');
Example #20
0
<?php

require_once "../../phplib/util.php";
set_time_limit(0);
// If no GET arguments are set, print usage and return.
if (count($_GET) == 0) {
    smarty_displayWithoutSkin('common/update3Instructions.ihtml');
    return;
}
util_enforceGzipEncoding();
header('Content-type: text/xml');
$export = util_getRequestParameter('export');
$timestamp = util_getRequestIntParameter('timestamp');
$version = util_getRequestParameterWithDefault('version', '3.0');
if ($export && util_isDesktopBrowser() && !session_getUser()) {
    smarty_displayCommonPageWithSkin('updateError.ihtml');
    exit;
}
if ($export == 'sources') {
    smarty_assign('sources', Model::factory('Source')->find_many());
    smarty_displayWithoutSkin('common/update3Sources.ihtml');
} else {
    if ($export == 'inflections') {
        smarty_assign('inflections', Model::factory('Inflection')->order_by_asc('id')->find_many());
        smarty_displayWithoutSkin('common/update3Inflections.ihtml');
    } else {
        if ($export == 'abbrev') {
            smarty_assign('abbrev', AdminStringUtil::loadRawAbbreviations());
            smarty_displayWithoutSkin('common/update3Abbrev.ihtml');
        } else {
            if ($export == 'definitions') {
        $minFreq = easy;
        $maxFreq = limit_freq;
        break;
    case 1:
        $minFreq = normal;
        $maxFreq = easy;
        break;
    case 2:
        $minFreq = hard;
        $maxFreq = normal;
        break;
    default:
        $minFreq = imp;
        $maxFreq = hard;
}
$count = Model::factory('Lexem')->where_gte('frequency', $minFreq)->where_lte('frequency', $maxFreq)->where_raw('char_length(formUtf8General) > 5')->count();
do {
    $lexem = Model::factory('Lexem')->where_gte('frequency', $minFreq)->where_lte('frequency', $maxFreq)->where_raw('char_length(formUtf8General) > 5')->limit(1)->offset(rand(0, $count - 1))->find_one();
    // Select an official definition for this lexem.
    $defs = Model::factory('Definition')->select('Definition.*')->join('LexemDefinitionMap', 'Definition.id = definitionId')->join('Source', 'Source.id = sourceId')->where('lexemId', $lexem->id)->where('status', 0)->where('isOfficial', 2)->order_by_asc('displayOrder')->find_many();
} while (!$defs);
$searchResults = SearchResult::mapDefinitionArray($defs);
$cuv = $lexem->formNoAccent;
smarty_assign('wordLength', mb_strlen($cuv));
smarty_assign('letters', preg_split('//u', 'aăâbcdefghiîjklmnopqrsștțuvwxyz', null, PREG_SPLIT_NO_EMPTY));
smarty_assign('page_title', 'Spânzurătoarea');
smarty_assign('cuvant', $cuv);
smarty_assign('searchResults', $searchResults);
smarty_assign('difficulty', $difficulty);
smarty_displayCommonPageWithSkin("spanzuratoarea.ihtml");
                print sprintf("<span style=\"color: green\">%s: %s</span>\n", $newLocVersion, substr($line, 2));
            }
        }
    }
    print "</pre>\n";
    util_deleteFile($file1);
    util_deleteFile($file2);
    exit;
}
if ($locVersion) {
    header('Content-type: text/plain; charset=UTF-8');
    writeLexems($locVersion, 'php://output');
    exit;
}
setlocale(LC_ALL, "ro_RO.utf8");
smarty_assign('locVersions', pref_getLocVersions());
smarty_displayCommonPageWithSkin('scrabble-loc.ihtml');
function writeLexems($locVersion, $fileName)
{
    LocVersion::changeDatabase($locVersion);
    $dbResult = db_execute(DB_QUERY, PDO::FETCH_ASSOC);
    $handle = fopen($fileName, 'w');
    foreach ($dbResult as $row) {
        $l = Model::factory('Lexem')->create($row);
        fprintf($handle, AdminStringUtil::padRight(mb_strtoupper($l->form), 20));
        fprintf($handle, AdminStringUtil::padRight($l->modelType, 4));
        fprintf($handle, AdminStringUtil::padRight($l->modelNumber, 8));
        fprintf($handle, $l->restriction . "\n");
    }
    fclose($handle);
}
Example #23
0
<?php

require_once "../phplib/util.php";
$type = util_getRequestParameter('t');
if ($type == 'rss') {
    $articles = WikiArticle::getRss();
    $results = array();
    foreach ($articles as $a) {
        $results[] = array('title' => $a->title, 'description' => $a->htmlContents, 'pubDate' => date('D, d M Y H:i:s', $a->modDate) . ' EEST', 'link' => sprintf("http://%s/articol/%s", $_SERVER['HTTP_HOST'], $a->getUrlTitle()));
    }
    header("Content-type: text/xml");
    smarty_assign('rss_title', 'Articole lingvistice - DEX online');
    smarty_assign('rss_link', 'http://' . $_SERVER['HTTP_HOST'] . '/rss/articole/');
    smarty_assign('rss_description', 'Articole pe teme lingvistice de la DEX online');
    smarty_assign('rss_pubDate', date('D, d M Y H:i:s') . ' EEST');
    smarty_assign('results', $results);
    smarty_displayWithoutSkin('common/rss.ixml');
    exit;
}
smarty_assign('page_title', 'Articole lingvistice');
smarty_assign('wikiTitles', WikiArticle::loadAllTitles());
smarty_displayCommonPageWithSkin('articole.ihtml');
<?php

require_once "../phplib/util.php";
require_once "../phplib/userPreferences.php";
util_assertNotLoggedIn();
$sendButton = util_getRequestParameter('send');
if ($sendButton) {
    $userPrefs = util_getRequestCheckboxArray('userPrefs', ',');
    $skin = util_getRequestParameter('skin');
    session_setAnonymousPrefs($userPrefs);
    if (session_isValidSkin($skin)) {
        session_setSkin($skin);
    }
    FlashMessage::add('Preferințele au fost salvate.', 'info');
    util_redirect('preferinte');
} else {
    $userPrefs = session_getAnonymousPrefs();
    $skin = session_getSkin();
}
foreach (preg_split('/,/', $userPrefs) as $pref) {
    if (isset($userPreferencesSet[$pref])) {
        $userPreferencesSet[$pref]['checked'] = true;
    }
}
smarty_assign('userPrefs', $userPreferencesSet);
smarty_assign('skin', $skin);
smarty_assign('availableSkins', pref_getServerPreference('skins'));
smarty_assign('page_title', 'Preferințe');
smarty_displayCommonPageWithSkin('preferinte.ihtml');
Example #25
0
<?php

require_once "../phplib/util.php";
smarty_assign('manualData', TopEntry::getTopData(CRIT_CHARS, SORT_DESC, true));
smarty_assign('bulkData', TopEntry::getTopData(CRIT_CHARS, SORT_DESC, false));
smarty_assign('page_title', 'Topul voluntarilor');
smarty_displayCommonPageWithSkin('top.ihtml');
Example #26
0
<?php

require_once "../phplib/util.php";
$submitButton = util_getRequestParameter('submitButton');
if ($submitButton) {
    util_assertModerator(PRIV_ADMIN);
    $order = 1;
    $ids = util_getRequestParameter("ids");
    foreach ($ids as $id) {
        $src = Source::get_by_id($id);
        $src->displayOrder = $order++;
        $src->save();
    }
    FlashMessage::add('Ordinea a fost salvată.', 'info');
    util_redirect('surse');
}
$sources = util_isModerator(PRIV_VIEW_HIDDEN) ? Model::factory('Source')->order_by_asc('displayOrder')->find_many() : Model::factory('Source')->where_not_equal('isOfficial', SOURCE_TYPE_HIDDEN)->order_by_asc('displayOrder')->find_many();
smarty_assign('sources', $sources);
smarty_assign('page_title', 'Surse');
smarty_displayCommonPageWithSkin('surse.ihtml');
Example #27
0
<?php

require_once "../phplib/util.php";
$clientOptions = array('sync' => array('Sincronizare cu DEX online', 'Acest client se poate conecta periodic la DEX online pentru a-și transfera definițiile nou adăugate.'), 'vision' => array('Interfață pentru nevăzători', 'Acest client are o interfață prietenoasă pentru nevăzători.'), 'regexp' => array('Expresii regulate, wildcards', 'Acest client acceptă căutări cu expresii regulate și/sau wildcards, cum ar fi «echi*» pentru echilibru, echinocțiu etc.'), 'suggest' => array('Sugestii', 'Acest client oferă cele mai apropiate rezultate atunci când cuvântul căutat nu este găsit exact.'), 'diacritics' => array('Cu / fără diacritice', 'Acest client oferă opțiuni pentru tastarea căutărilor cu sau fără diacritice.'), 'full' => array('Căutare full-text', 'Acest client poate căuta nu doar cuvintele-titlu, ci și întreg textul definițiilor.'), 'flex' => array('Căutare forme flexionare', 'Acest client poate căuta declinări și conjugări ale cuvintelor, cum ar fi «meargă» în loc de «merge».'), 'click' => array('Clic pe cuvânt', 'Când dați clic pe un cuvânt dintr-o definiție, acest client navighează la definiția acelui cuvânt.'), 'history' => array('Istoria căutărilor', 'Acest client ține minte ultimele cuvinte căutate și poate naviga între ele.'));
$clients = array(array('name' => array('Maestro DEX', 'http://www.tranzactiibursiere.ro/maestro/'), 'available' => true, 'urls' => array(), 'os' => array('linux', 'windows'), 'space' => '490 MB', 'requires' => array('Perl, wxWidgets', '(numai sub Linux)'), 'authors' => array('Octavian Râșniță' => ''), 'license' => 'GPL', 'options' => array('vision' => 1, 'sync' => 1, 'regexp' => 1, 'suggest' => 1, 'diacritics' => 1, 'full' => 1, 'flex' => 1, 'click' => 1, 'history' => 1)), array('name' => array('PyDEX', 'http://pydex.lemonsoftware.eu/'), 'available' => true, 'urls' => array(), 'os' => array('linux', 'mac', 'windows'), 'space' => '250 MB', 'requires' => array('wxPython'), 'authors' => array('Cristian Năvălici' => ''), 'license' => 'GPLv3', 'options' => array('vision' => 0, 'sync' => 1, 'regexp' => 0, 'suggest' => 0, 'diacritics' => 1, 'full' => 1, 'flex' => 1, 'click' => 0, 'history' => 1)), array('name' => array('JaDEX', 'http://www.federicomestrone.com/jadex/'), 'available' => true, 'urls' => array(), 'os' => array('java', 'linux', 'mac', 'windows'), 'space' => '250 MB', 'requires' => array('Java'), 'authors' => array('Federico Mestrone' => ''), 'license' => 'Freeware', 'options' => array('vision' => 0, 'sync' => 1, 'regexp' => 1, 'suggest' => 0, 'diacritics' => 1, 'full' => 0, 'flex' => 0, 'click' => 0, 'history' => 1)), array('name' => array('Dixit', 'http://dixit.sourceforge.net/'), 'available' => true, 'urls' => array(), 'os' => array('linux', 'windows'), 'space' => '48 MB', 'requires' => array('QT, g++', '(numai sub Linux)'), 'authors' => array('Octavian Procopiuc' => ''), 'license' => 'GPL', 'options' => array('vision' => 0, 'sync' => 1, 'regexp' => 1, 'suggest' => 1, 'diacritics' => 0, 'full' => 0, 'flex' => 0, 'click' => 0, 'history' => 1)), array('name' => array('DEX.ro', 'http://dex-ro.blogspot.com/'), 'available' => true, 'urls' => array(), 'os' => array('windows'), 'space' => '75 MB', 'requires' => array(), 'authors' => array('Ion Silvestru' => '*****@*****.**'), 'license' => 'Freeware', 'options' => array('vision' => 0, 'sync' => 1, 'regexp' => 1, 'suggest' => 1, 'diacritics' => 0, 'full' => 0, 'flex' => 0, 'click' => 0, 'history' => 1)), array('name' => array('DEX Offline', 'http://www.macuser.ro/dexoffline/'), 'available' => true, 'urls' => array(), 'os' => array('mac'), 'space' => '100 MB', 'requires' => array('MAC OS X Leopard', 'sau mai nou,', 'Dictionary.app'), 'authors' => array('Cristian Băluță' => ''), 'license' => 'Freeware', 'options' => array('vision' => 0, 'sync' => 0, 'regexp' => 0, 'suggest' => 1, 'diacritics' => 1, 'full' => 0, 'flex' => 0, 'click' => 1, 'history' => 0)), array('name' => array('DEX pentru Android', 'http://dex.adrianvintu.com/'), 'available' => true, 'urls' => array('Market' => 'market://search?q=pub:%22Adrian%20Vintu%22'), 'os' => array('android'), 'space' => '490 MB', 'requires' => array(), 'authors' => array('Adrian Vîntu' => ''), 'license' => 'Freeware', 'options' => array('vision' => 0, 'sync' => 0, 'regexp' => 1, 'suggest' => 0, 'diacritics' => 0, 'full' => 0, 'flex' => 1, 'click' => 0, 'history' => 0)), array('name' => array('iDEX', 'http://www.mobiletouch.ro/aplicatii-iphone/2/idex-dictionare-ale-limbii-romane'), 'available' => true, 'urls' => array(), 'os' => array('iphone'), 'space' => '55 MB', 'requires' => array(), 'authors' => array('Mobile Touch' => ''), 'license' => 'Freeware', 'options' => array('vision' => 0, 'sync' => 1, 'regexp' => 0, 'suggest' => 1, 'diacritics' => 0, 'full' => 0, 'flex' => 0, 'click' => 0, 'history' => 1)), array('name' => array('iDEX for iPhone', 'http://www.federicomestrone.com/product-idex'), 'available' => true, 'urls' => array(), 'os' => array('iphone'), 'space' => '70 MB', 'requires' => array(), 'authors' => array('Federico Mestrone' => ''), 'license' => 'Freeware', 'options' => array('vision' => 0, 'sync' => 1, 'regexp' => 1, 'suggest' => 0, 'diacritics' => 1, 'full' => 0, 'flex' => 0, 'click' => 0, 'history' => 0)), array('name' => array('PocketDEX', 'http://pocketdex.aamedia.ro/'), 'available' => true, 'urls' => array(), 'os' => array('windowsce'), 'space' => '21 MB', 'requires' => array(), 'authors' => array('Alexandru Mirea' => ''), 'license' => 'Freeware', 'options' => array('vision' => 0, 'sync' => 0, 'regexp' => 0, 'suggest' => 0, 'diacritics' => 0, 'full' => 0, 'flex' => 0, 'click' => 0, 'history' => 1)), array('name' => array('DEXter', 'http://dapyx-soft.com/~bogdan/dexter.zip'), 'available' => false, 'urls' => array(), 'os' => array('windows'), 'space' => '10 MB', 'requires' => array(), 'authors' => array('Bogdan' => ''), 'license' => 'Freeware', 'options' => array('vision' => 0, 'sync' => 0, 'regexp' => 0, 'suggest' => 0, 'diacritics' => 0, 'full' => 0, 'flex' => 0, 'click' => 0, 'history' => 0)), array('name' => array('DEX Offline', 'http://dexoffline.sourceforge.net/'), 'available' => false, 'urls' => array(), 'os' => array('windows'), 'space' => '10 MB', 'requires' => array('Microsoft .NET', 'Microsoft MDAC'), 'authors' => array('Gecko Pointdexter' => ''), 'license' => 'Freeware', 'options' => array('vision' => 0, 'sync' => 1, 'regexp' => 0, 'suggest' => 0, 'diacritics' => 0, 'full' => 0, 'flex' => 0, 'click' => 0, 'history' => 1)));
$osNames = array('android' => 'Android', 'iphone' => 'iPhone', 'java' => 'Java', 'linux' => 'GNU / Linux', 'mac' => 'Mac', 'windows' => 'Windows', 'windowsce' => 'Windows CE');
smarty_assign('page_title', 'Unelte');
smarty_assign('clients', $clients);
smarty_assign('clientOptions', $clientOptions);
smarty_assign('osNames', $osNames);
smarty_displayCommonPageWithSkin('unelte.ihtml');
                } else {
                    // Create a new lexem.
                    $lexem = Lexem::create($lexemName, 'T', '1', '');
                    $lexem->save();
                    $lexem->regenerateParadigm();
                    LexemDefinitionMap::associate($lexem->id, $definition->id);
                    log_userLog("Created lexem {$lexem->id} ({$lexem->form})");
                }
            }
        }
        FlashMessage::add('Definiția a fost trimisă. Un moderator o va examina în scurt timp. Vă mulțumim!', 'info');
        util_redirect('contribuie');
    }
} else {
    smarty_assign('sourceId', session_getDefaultContribSourceId());
}
smarty_assign('contribSources', Model::factory('Source')->where('canContribute', true)->order_by_asc('displayOrder')->find_many());
smarty_assign('page_title', 'Contribuie cu definiții');
smarty_assign('suggestNoBanner', true);
smarty_displayCommonPageWithSkin('contribuie.ihtml');
/**************************************************************************/
function deleteEmptyElements(&$v)
{
    $result = array();
    foreach ($v as $elem) {
        if (!empty($elem)) {
            $result[] = $elem;
        }
    }
    return $result;
}
<?php

require_once "../phplib/util.php";
$title = util_getRequestParameter('title');
$wikiTitle = WikiArticle::urlTitleToWikiTitle($title);
$wa = WikiArticle::get_by_title(addslashes($wikiTitle));
if ($wa) {
    smarty_assign('wa', $wa);
    smarty_assign('page_title', $wikiTitle);
} else {
    smarty_assign('page_title', 'Articol inexistent');
}
smarty_assign('wikiTitles', WikiArticle::loadAllTitles());
smarty_displayCommonPageWithSkin('wikiArticle.ihtml');