Example #1
0
 public static function getInstance()
 {
     if (!self::$_instance instanceof self) {
         self::$_instance = new self();
     }
     return self::$_instance;
 }
Example #2
0
 private function _searchStatusCallback($appName, $status)
 {
     $available = 0;
     if ($status == 'normal') {
         $available = 1;
     }
     C::t('common_setting')->update('my_search_status', $available);
     if ($available) {
         Cloud::loadFile('Service_SearchHelper');
         Cloud_Service_SearchHelper::allowSearchForum();
     }
     $this->setPluginAvailable('cloudsearch', $available);
     return true;
 }
Example #3
0
 public function onCommonGetNavs($type = '')
 {
     Cloud::loadFile('Service_SearchHelper');
     $navtype = null;
     switch ($type) {
         case 'footer':
             $navtype = 1;
             break;
         case 'space':
             $navtype = 2;
             break;
         case 'my':
             $navtype = 3;
             break;
         case 'header':
             $navtype = 0;
             break;
     }
     $navs = $subNavs = array();
     foreach (C::t('common_nav')->fetch_all_by_navtype($navtype) as $nav) {
         if (!$nav['parentid']) {
             $navs[$nav['id']] = Cloud_Service_SearchHelper::convertNav($nav);
         } else {
             $subNavs[$nav['id']] = $nav;
         }
     }
     foreach ($subNavs as $k => $v) {
         $navs[$v['parentid']]['navs'][$v['id']] = Cloud_Service_SearchHelper::convertNav($v);
     }
     return $navs;
 }
Example #4
0
 public function onSearchGetForums($fIds = array())
 {
     return Cloud_Service_SearchHelper::getForums($fIds);
 }
Example #5
0
 function getReplyAndView($tids)
 {
     if (!$tids) {
         return array();
     }
     $res = array();
     $threads = Cloud_Service_SearchHelper::getThreads($tids);
     foreach ($threads as $thread) {
         $res[$thread['tId']] = array('tid' => $thread['tId'], 'replies' => $thread['replyNum'], 'views' => $thread['viewNum']);
     }
     return $res;
 }