当前位置: 首页>>代码示例>>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;未经允许,请勿转载。