Minahito
minah****@users*****
2006年 10月 14日 (土) 02:52:40 JST
Index: xoops2jp/html/modules/base/service/LegacySearchService.class.php diff -u xoops2jp/html/modules/base/service/LegacySearchService.class.php:1.1.2.8.2.3 xoops2jp/html/modules/base/service/LegacySearchService.class.php:1.1.2.8.2.4 --- xoops2jp/html/modules/base/service/LegacySearchService.class.php:1.1.2.8.2.3 Thu Oct 5 19:18:13 2006 +++ xoops2jp/html/modules/base/service/LegacySearchService.class.php Sat Oct 14 02:52:39 2006 @@ -184,8 +184,6 @@ */ function _searchItems($mid, $queries, $andor, $max_hit, $start, $uid) { - $ret = array(); - $modleArr = $this->getActiveModules(); $flag = false; @@ -204,42 +202,31 @@ $timezone = $root->mContext->getXoopsConfig('server_TZ') * 3600; $handler =& xoops_gethandler('module'); - $module =& $handler->get($mid); - if (!is_object($module)) { + $xoopsModule =& $handler->get($mid); + if (!is_object($xoopsModule)) { return $ret; } - if (!$module->get('isactive') || !$module->get('hassearch')) { + if (!$xoopsModule->get('isactive') || !$xoopsModule->get('hassearch')) { return $ret; } - $results =& $module->search($queries, $andor, $max_hit, $start, $uid); + $module =& Legacy_Utils::createModule($xoopsModule); + $results = $module->doLegacyGlobalSearch($queries, $andor, $max_hit, $start, $uid); if (is_array($results) && count($results) > 0) { - foreach ($results as $result) { - $item = array(); - if (isset($result['image']) && strlen($result['image']) > 0) { - $item['image'] = XOOPS_URL . '/modules/' . $module->get('dirname') . '/' . $result['image']; - } - else { - $item['image'] = XOOPS_URL . '/images/icons/posticon2.gif'; - } - - $item['link'] = XOOPS_URL . '/modules/' . $module->get('dirname') . '/' . $result['link']; - $item['title'] = $result['title']; - $item['uid'] = $result['uid']; - + foreach (array_keys($results) as $key) { // // TODO If this service will come to web service, we should // change format from unixtime to string by timeoffset. // - $item['time'] = isset($result['time']) ? $result['time'] - $timezone : 0; - - $ret[] = $item; + if ($results[$key]['time'] != 0) { + $results[$key]['time'] = $results[$key]['time'] - $timezone; + } } } - return $ret; + return $results; } }