當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Definition::getWordCount方法代碼示例

本文整理匯總了PHP中Definition::getWordCount方法的典型用法代碼示例。如果您正苦於以下問題:PHP Definition::getWordCount方法的具體用法?PHP Definition::getWordCount怎麽用?PHP Definition::getWordCount使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Definition的用法示例。


在下文中一共展示了Definition::getWordCount方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: smarty_fetchSkin

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");
}
開發者ID:nastasie-octavian,項目名稱:DEXonline,代碼行數:26,代碼來源:smarty.php

示例2: array_reduce

<?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());
開發者ID:Jobava,項目名稱:mirror-dexonline,代碼行數:31,代碼來源:index.php

示例3: smarty_assign

<?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');
開發者ID:nastasie-octavian,項目名稱:DEXonline,代碼行數:26,代碼來源:index.php


注:本文中的Definition::getWordCount方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。