foreach ($arr as $aid) { if (is_numeric($aid)) { $aidarr[] = $aid; } } // 读取频道下的文章列表 if ($cids != "") { $arr = explode(",", $cids); $cidarr = array(); foreach ($arr as $cid) { if (is_numeric($cid)) { $cidarr[] = $cid; } } if ($clearcache) { Bigapp_Portal_Article::clearCache($cidarr, $aidarr); $ret["data"] = "clear cache"; bigapp_core::result(bigapp_core::variable($ret)); } $ret["data"] = Bigapp_Portal_Article::getArticalInChannelExceptAids($cidarr, $aidarr, $page); } else { if (!empty($aidarr)) { $ret["data"] = Bigapp_Portal_Article::getByArticleIds($aidarr); } } bigapp_core::result(bigapp_core::variable($ret)); } catch (Exception $e) { //echo $e->getMessage(); die(0); bigapp_core::result(bigapp_core::variable($ret)); } // vim600: sw=4 ts=4 fdm=marker syn=php
if (is_array($cids) && !empty($cids)) { //比对频道设置是否发生变化,清楚上一次的cache $content_setting_cids = C::t('common_setting')->fetch('content_setting_cids', true); if (false === $content_setting_cids[0]) { $oldcids = array(); } else { $oldcids = $content_setting_cids; } if ($oldcids !== $cids && !empty($oldcids)) { $oldaids = array(); Bigapp_Portal_Article::clearCache($oldcids, $oldaids); } $settings = array('content_setting_cids' => $cids); C::t('common_setting')->update_batch($settings); //获取频道文章数据 $articles = Bigapp_Portal_Article::getArticalInChannelExceptAids($cids, $all_aids, $page); if (!$ispic_mode) { //文章无图模式情况下,过滤掉图片 for ($i = 0; $i < count($articles['list']); $i++) { $articles['list'][$i]['attachment_urls'] = array(); } } $ret['data'] = array_merge($ret['data'], $articles['list']); $ret['count'] = $articles['total']; if (intval($articles['total_page']) > intval($page)) { $ret['need_more'] = '1'; } } //读取板块下的帖子列表 if (is_array($fids) && !empty($fids)) { //比对版块设置是否发生变化,清楚上一次的cache