Esempio n. 1
0
<?php

require_once "../phplib/util.php";
require_once "../phplib/ads/adsModule.php";
// Display a custom ad 50% of the times
if (rand(0, 99) < 50) {
    AdsModule::runAllModules(null, null);
}
$widgets = Preferences::getWidgets(session_getUser());
$numEnabledWidgets = array_reduce($widgets, function ($result, $w) {
    return $result + $w['enabled'];
});
$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());
Esempio n. 2
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');
}