/** * 添加事件 * * @author Garbin * @param array $feed 事件 * @return false:失败 true:成功 */ function add($feed_info) { return outer_call('uc_feed_add', array($feed_info['icon'], $feed_info['user_id'], $feed_info['user_name'], $feed_info['title']['template'], $feed_info['title']['data'], $feed_info['body']['template'], $feed_info['body']['data'], $feed_info['body_general'], $feed_info['target_ids'], $feed_info['images'])); }
/** * 判断feed是否启用 * * @author Garbin * @return bool **/ function feed_enabled() { $feed_enabled = null; if ($feed_enabled === null) { $cache_server =& cache_server(); $cache_key = 'feed_enabled'; $feed_enabled = $cache_server->get($cache_key); if ($feed_enabled === false) { $feed_enabled = 0; $app_list = outer_call('uc_app_ls'); if ($app_list) { foreach ($app_list as $app) { if ($app['type'] == 'UCHOME') { $feed_enabled = $app; } } } $cache_server->set($cache_key, $feed_enabled, 86400); } } return $feed_enabled; }