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


PHP SearchHelper::getThreads方法代碼示例

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


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

示例1: getReplyAndView

 function getReplyAndView($tids)
 {
     if (!$tids) {
         return array();
     }
     $res = array();
     $threads = SearchHelper::getThreads($tids);
     foreach ($threads as $thread) {
         $res[$thread['tId']] = array('tid' => $thread['tId'], 'replies' => $thread['replyNum'], 'views' => $thread['viewNum']);
     }
     return $res;
 }
開發者ID:v998,項目名稱:discuzx-en,代碼行數:12,代碼來源:js.php

示例2: onSearchGetThreads

 function onSearchGetThreads($tIds)
 {
     $authors = $authorids = array();
     $result = SearchHelper::getThreads($tIds);
     if ($result) {
         foreach ($result as $thread) {
             $authors[$thread['authorId']][] = $thread['tId'];
         }
     }
     $authorids = array_keys($authors);
     if ($authorids) {
         $banuids = $uids = array();
         $sql = sprintf('SELECT uid, username, groupid FROM %s WHERE uid IN (%s)', DB::table('common_member'), implode($authorids, ', '));
         $query = DB::query($sql);
         while ($author = DB::fetch($query)) {
             $uids[$author['uid']] = $author['uid'];
             if ($author['groupid'] == 4 || $author['groupid'] == 5) {
                 $banuids[] = $author['uid'];
             }
         }
         $deluids = array_diff($authorids, $uids);
         foreach ($deluids as $deluid) {
             if (!$deluid) {
                 continue;
             }
             foreach ($authors[$deluid] as $tid) {
                 $result[$tid]['authorStatus'] = 'delete';
             }
         }
         foreach ($banuids as $banuid) {
             foreach ($authors[$banuid] as $tid) {
                 $result[$tid]['authorStatus'] = 'ban';
             }
         }
     }
     return $result;
 }
開發者ID:Kingson4Wu,項目名稱:php_demo,代碼行數:37,代碼來源:my.php

示例3: onSearchGetThreads

 function onSearchGetThreads($tIds)
 {
     $authors = $authorids = array();
     $result = SearchHelper::getThreads($tIds);
     if ($result) {
         $vtIds = $gfIds = array();
         foreach ($result as $key => $thread) {
             $authors[$thread['authorId']][] = $thread['tId'];
             if ($thread['specialType'] == 'poll') {
                 $vtIds[] = $thread['tId'];
             }
             if ($thread['isGroup']) {
                 $gfIds[$thread['fId']] = $thread['fId'];
             }
         }
         $guestPerm = SearchHelper::getGuestPerm($gfIds);
         foreach ($result as $key => $row) {
             if (in_array($row['fId'], $guestPerm['allowForumIds'])) {
                 $result[$key]['isPublic'] = true;
             } else {
                 $result[$key]['isPublic'] = false;
             }
         }
     }
     if ($vtIds) {
         // vote
         $polls = SearchHelper::getPollInfo($vtIds);
         foreach ($polls as $tId => $poll) {
             $result[$tId]['pollInfo'] = $poll;
         }
     }
     $authorids = array_keys($authors);
     if ($authorids) {
         $banuids = $uids = array();
         $sql = sprintf('SELECT uid, username, groupid FROM %s WHERE uid IN (%s)', DB::table('common_member'), implode($authorids, ', '));
         $query = DB::query($sql);
         while ($author = DB::fetch($query)) {
             $uids[$author['uid']] = $author['uid'];
             if ($author['groupid'] == 4 || $author['groupid'] == 5) {
                 $banuids[] = $author['uid'];
             }
         }
         $deluids = array_diff($authorids, $uids);
         foreach ($deluids as $deluid) {
             if (!$deluid) {
                 continue;
             }
             foreach ($authors[$deluid] as $tid) {
                 $result[$tid]['authorStatus'] = 'delete';
             }
         }
         foreach ($banuids as $banuid) {
             foreach ($authors[$banuid] as $tid) {
                 $result[$tid]['authorStatus'] = 'ban';
             }
         }
     }
     return $result;
 }
開發者ID:pan289091315,項目名稱:Discuz,代碼行數:59,代碼來源:my.php


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