function db_rss_list_friend_c_rss_cache_list($c_member_id, $limit) { static $is_recurred = false; //再帰処理中かどうかの判定フラグ if (!$is_recurred) { //function cacheのために再帰処理を行う $is_recurred = true; $funcargs = func_get_args(); $result = pne_cache_recursive_call(OPENPNE_FUNCTION_CACHE_LIFETIME_FAST, __FUNCTION__, $funcargs); $is_recurred = false; return $result; } $friends = db_friend_c_member_id_list($c_member_id, true); if (!$friends) { return array(); } $ids = implode(',', array_map('intval', $friends)); $hint = db_mysql_hint('USE INDEX (c_member_id_r_datetime)'); $sql = 'SELECT * FROM c_rss_cache' . $hint . ' WHERE c_member_id IN (' . $ids . ')' . ' ORDER BY r_datetime DESC'; $list = db_get_all_limit($sql, 0, $limit); foreach ($list as $key => $value) { $list[$key]['c_member'] = db_member_c_member4c_member_id_LIGHT($value['c_member_id']); } return $list; }
/** * フレンド最新日記リスト取得 * 日記公開範囲を考慮 * * @param int $c_member_id * @param int $limit * @param int $use_is_display_friend_home * @return array_of_array (c_diary.*, nickname) */ function p_h_home_c_diary_friend_list4c_member_id($c_member_id, $limit, $use_is_display_friend_home = false) { static $is_recurred = false; //再帰処理中かどうかの判定フラグ if (!$is_recurred) { //function cacheのために再帰処理を行う $is_recurred = true; $funcargs = func_get_args(); $result = pne_cache_recursive_call(OPENPNE_FUNCTION_CACHE_LIFETIME_FAST, __FUNCTION__, $funcargs); $is_recurred = false; return $result; } $friends = db_friend_c_member_id_list($c_member_id, true); if (!$friends) { return array(); } // 対象の最新書き込みのみを表示する場合 if ($use_is_display_friend_home) { // 表示対象一覧を取得し、取得済みフレンド一覧とぶつける $friends = array_intersect($friends, db_friend_is_display_friend_home_list($c_member_id, $is_display_friend_home = 1)); } $ids = implode(',', array_map('intval', $friends)); $hint = db_mysql_hint('USE INDEX (r_datetime_c_member_id, r_datetime)'); $sql = 'SELECT * FROM c_diary' . $hint . ' WHERE c_member_id IN (' . $ids . ')' . ' AND public_flag <> \'private\'' . ' ORDER BY c_diary.r_datetime DESC'; $c_diary_friend_list = db_get_all_limit($sql, 0, $limit); foreach ($c_diary_friend_list as $key => $value) { $c_member = db_member_c_member4c_member_id_LIGHT($value['c_member_id']); $c_diary_friend_list[$key]['nickname'] = $c_member['nickname']; $c_diary_friend_list[$key]['count_comments'] = db_diary_count_c_diary_comment4c_diary_id($value['c_diary_id']); } return $c_diary_friend_list; }
/** * 都道府県リスト(全データ)を取得 */ function db_etc_c_profile_pref_list() { $hint = db_mysql_hint('FORCE INDEX (sort_order)'); $sql = 'SELECT * FROM c_profile_pref' . $hint . ' ORDER BY sort_order'; return db_get_all($sql); }
/** * 中カテゴリリストを取得 * * @return array 中カテゴリリスト */ function db_commu_c_commu_category_parent_list4null() { $hint = db_mysql_hint('FORCE INDEX (sort_order)'); $sql = 'SELECT * FROM c_commu_category_parent' . $hint . ' ORDER BY sort_order'; return db_get_all($sql); }