本文整理汇总了PHP中SearchHelper::convertThread方法的典型用法代码示例。如果您正苦于以下问题:PHP SearchHelper::convertThread方法的具体用法?PHP SearchHelper::convertThread怎么用?PHP SearchHelper::convertThread使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SearchHelper
的用法示例。
在下文中一共展示了SearchHelper::convertThread方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: preGetThreads
function preGetThreads($table, $tIds)
{
$tIds = implode($tIds, ', ');
$result = array();
if ($tIds) {
$sql = sprintf("SELECT * FROM %s WHERE tid IN (%s)", $table, $tIds);
$query = DB::query($sql);
while ($thread = DB::fetch($query)) {
$thread['pid'] = $threadPosts[$thread['tid']]['pId'];
$result[$thread['tid']] = SearchHelper::convertThread($thread);
}
}
return $result;
}
示例2: _getAllThreads
function _getAllThreads($table, $num, $tid = 0, $orderType = 'ASC')
{
$result = array();
$op = $orderType == 'DESC' ? '<' : '>';
$key = $orderType == 'DESC' ? 'minTid' : 'maxTid';
$sql = sprintf("SELECT * FROM %s\n\t\t\t\tWHERE tid %s %d\n\t\t\t\tORDER BY tid %s\n\t\t\t\tLIMIT %d", $table, $op, $tid, $orderType, $num);
$query = DB::query($sql);
$tIds = array();
while ($thread = DB::fetch($query)) {
if ($thread['displayorder'] >= 0) {
$result[$key] = $thread['tid'];
$result['data'][$thread['tid']] = SearchHelper::convertThread($thread);
}
}
return $result;
}
示例3: _getAllThreads
function _getAllThreads($table, $num, $tid = 0, $orderType = 'ASC')
{
$result = array();
$op = $orderType == 'DESC' ? '<' : '>';
$key = $orderType == 'DESC' ? 'minTid' : 'maxTid';
$sql = sprintf("SELECT * FROM %s\n\t\t\t\tWHERE tid %s %d\n\t\t\t\tORDER BY tid %s\n\t\t\t\tLIMIT %d", $table, $op, $tid, $orderType, $num);
$query = DB::query($sql);
$tIds = $vtIds = array();
while ($thread = DB::fetch($query)) {
$result[$key] = $thread['tid'];
$result['data'][$thread['tid']] = SearchHelper::convertThread($thread);
if ($result['data'][$thread['tid']]['specialType'] == 'poll') {
$vtIds[] = $thread['tid'];
}
}
$polls = SearchHelper::getPollInfo($vtIds);
foreach ($polls as $tId => $poll) {
$result['data'][$tId]['pollInfo'] = $poll;
}
return $result;
}