示例#1
0
function smarty_fetchSkin()
{
    $skin = session_getSkin();
    // Set some skin variables based on the skin preferences in the config file.
    // Also assign some skin-specific variables so we don't compute them unless we need them
    $skinVariables = session_getSkinPreferences($skin);
    switch ($skin) {
        case 'zepu':
            $skinVariables['afterSearchBoxBanner'] = true;
            break;
        case 'polar':
            $wordCount = Definition::getWordCount();
            $wordCountRough = $wordCount - $wordCount % 10000;
            smarty_assign('words_total', util_formatNumber($wordCount, 0));
            smarty_assign('words_rough', util_formatNumber($wordCountRough, 0));
            smarty_assign('words_last_month', util_formatNumber(Definition::getWordCountLastMonth(), 0));
            break;
        case 'mobile':
            smarty_assign('words_total', util_formatNumber(Definition::getWordCount(), 0));
            smarty_assign('words_last_month', util_formatNumber(Definition::getWordCountLastMonth(), 0));
            break;
    }
    smarty_assign('skinVariables', $skinVariables);
    smarty_register_outputfilters();
    return $GLOBALS['smarty_theSmarty']->fetch("{$skin}/pageLayout.ihtml");
}
示例#2
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());
示例#3
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);
}
smarty_assign('page_title', 'Dicționar explicativ al limbii române');
smarty_assign('onHomePage', '1');
smarty_assign('letters', preg_split('//u', 'aăâbcdefghiîjklmnopqrsștțuvwxyz'));
smarty_assign('words_total', util_formatNumber(Definition::getWordCount(), 0));
smarty_assign('words_last_month', util_formatNumber(Definition::getWordCountLastMonth(), 0));
/* WotD part */
$wotd = WordOfTheDay::getTodaysWord();
if (!$wotd) {
    WordOfTheDay::updateTodaysWord();
    $wotd = WordOfTheDay::getTodaysWord();
}
$wotd->ensureThumbnail();
$defId = WordOfTheDayRel::getRefId($wotd->id);
$def = Model::factory('Definition')->where('id', $defId)->where('status', ST_ACTIVE)->find_one();
smarty_assign('thumbUrl', $wotd->getThumbUrl());
smarty_assign('title', $def->lexicon);
smarty_assign('today', date('Y/m/d'));
smarty_displayPageWithSkin('index.ihtml');