本文整理汇总了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');
示例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');
示例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');