本文整理匯總了PHP中SearchHelper::convertPost方法的典型用法代碼示例。如果您正苦於以下問題:PHP SearchHelper::convertPost方法的具體用法?PHP SearchHelper::convertPost怎麽用?PHP SearchHelper::convertPost使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類SearchHelper
的用法示例。
在下文中一共展示了SearchHelper::convertPost方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: _getAllPosts
function _getAllPosts($table, $num, $pId = 0, $orderType = 'ASC')
{
if ($orderType == 'DESC') {
$op = '<';
$key = 'minPid';
} else {
$op = '>';
$key = 'maxPid';
}
$sql = sprintf("SELECT * FROM %s\n\t\t\t\tWHERE pid %s %d\n\t\t\t\tORDER BY pid %s\n\t\t\t\tLIMIT %d", $table, $op, $pId, $orderType, $num);
$query = DB::query($sql);
$result = array();
$tIds = $authors = array();
while ($post = DB::fetch($query)) {
$result[$key] = $post['pid'];
if ($post['invisible'] == 0) {
$result['data'][$post['pid']] = SearchHelper::convertPost($post);
}
}
return $result;
}
示例2: getThreadPosts
function getThreadPosts($tIds)
{
$result = array();
foreach ($tIds as $postTableId => $_tIds) {
$suffix = $postTableId ? "_{$postTableId}" : '';
$sql = sprintf("SELECT * FROM %s\n\t\t\t\t\t\t WHERE tid IN (%s) AND first = 1", DB::table('forum_post' . $suffix), implode($_tIds, ', '));
$query = DB::query($sql);
while ($post = DB::fetch($query)) {
$result[$post['tid']] = SearchHelper::convertPost($post);
}
}
return $result;
}