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


PHP Definition::searchModerator方法代碼示例

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


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

示例1: util_assertModerator

<?php

require_once "../../phplib/util.php";
util_assertModerator(PRIV_EDIT);
util_assertNotMirror();
RecentLink::createOrUpdate('Definiții nemoderate');
$sourceId = 0;
$sourceUrlName = util_getRequestParameter('source');
if ($sourceUrlName) {
    $source = $sourceUrlName ? Source::get_by_urlName($sourceUrlName) : null;
    $sourceId = $source ? $source->id : 0;
    smarty_assign('src_selected', $sourceId);
}
$ip = $_SERVER['REMOTE_ADDR'];
$defs = Definition::searchModerator('*', '', $sourceId, ST_PENDING, 0, 0, time());
$searchResults = SearchResult::mapDefinitionArray($defs);
FileCache::putModeratorQueryResults($ip, $searchResults);
smarty_assign('searchResults', $searchResults);
smarty_assign('sectionTitle', 'Definiții nemoderate');
smarty_assign('allStatuses', util_getAllStatuses());
smarty_assign('recentLinks', RecentLink::loadForUser());
smarty_displayWithoutSkin('admin/definitionList.ihtml');
開發者ID:nastasie-octavian,項目名稱:DEXonline,代碼行數:22,代碼來源:viewPendingDefinitions.php

示例2: mktime

$ip = $_SERVER['REMOTE_ADDR'];
// Execute query and display results
// Convert wildcards to mysql format
if ($searchButton) {
    $name = StringUtil::cleanupQuery($name);
    $arr = StringUtil::analyzeQuery($name);
    $hasDiacritics = $arr[0];
    $hasRegexp = $arr[1];
    $isAllDigits = $arr[2];
    $field = $hasDiacritics ? 'formNoAccent' : 'formUtf8General';
    $userId = '';
    if ($nick) {
        $user = User::get_by_nick($nick);
        if ($user) {
            $userId = $user->id;
        }
    }
    $beginTime = mktime(0, 0, 0, $mo1, $da1, $yr1);
    $endTime = mktime(23, 59, 59, $mo2, $da2, $yr2);
    // Query the database and output the results
    $defs = Definition::searchModerator($name, $hasDiacritics, $sourceId, $status, $userId, $beginTime, $endTime);
    $searchResults = SearchResult::mapDefinitionArray($defs);
    FileCache::putModeratorQueryResults($ip, $searchResults);
} else {
    $searchResults = FileCache::getModeratorQueryResults($ip);
}
smarty_assign('searchResults', $searchResults);
smarty_assign('sectionTitle', 'Căutare definiții');
smarty_assign('allStatuses', util_getAllStatuses());
smarty_assign('recentLinks', RecentLink::loadForUser());
smarty_displayWithoutSkin('admin/definitionList.ihtml');
開發者ID:nastasie-octavian,項目名稱:DEXonline,代碼行數:31,代碼來源:definitionLookup.php

示例3: mktime

    }
    if ($nextPageButton) {
        $page++;
    }
    $name = StringUtil::cleanupQuery($name);
    $arr = StringUtil::analyzeQuery($name);
    $hasDiacritics = $arr[0];
    $hasRegexp = $arr[1];
    $isAllDigits = $arr[2];
    $field = $hasDiacritics ? 'formNoAccent' : 'formUtf8General';
    $userId = '';
    if ($nick) {
        $user = User::get_by_nick($nick);
        if ($user) {
            $userId = $user->id;
        }
    }
    $beginTime = mktime(0, 0, 0, $mo1, $da1, $yr1);
    $endTime = mktime(23, 59, 59, $mo2, $da2, $yr2);
    // Query the database and output the results
    $defs = Definition::searchModerator($name, $hasDiacritics, $sourceId, $status, $userId, $beginTime, $endTime, $page, RESULTS_PER_PAGE);
    $searchResults = SearchResult::mapDefinitionArray($defs);
    $args = array('name' => $name, 'status' => $status, 'nick' => $nick, 'sourceId' => $sourceId, 'yr1' => $yr1, 'mo1' => $mo1, 'da1' => $da1, 'yr2' => $yr2, 'mo2' => $mo2, 'da2' => $da2, 'page' => $page);
    FileCache::putModeratorQueryResults($ip, array($searchResults, $args));
} else {
    list($searchResults, $args) = FileCache::getModeratorQueryResults($ip);
}
SmartyWrap::assign('searchResults', $searchResults);
SmartyWrap::assign('args', $args);
SmartyWrap::assign('recentLinks', RecentLink::loadForUser());
SmartyWrap::displayAdminPage('admin/definitionLookup.tpl');
開發者ID:florinp,項目名稱:dexonline,代碼行數:31,代碼來源:definitionLookup.php


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