function getRadio($date) { global $refresh; $strDate = gmdate('Y-m-d', $date); $gosfile = './gos/' . $strDate; $gosjson = null; if (!file_exists($gosfile) or $refresh) { $gosjson["title"] = "每日福音"; $gosjson["date"] = $strDate; $gosjson["logo"] = "http://www.cathassist.org/radio/logos/gos.jpg"; $gosjson["desc"] = "一起聆听主的教诲"; $itemsrc = "http://media.cathassist.org/thought/mp3/" . $strDate . ".mp3"; if (url_exists($itemsrc)) { $title = "每日福音"; $gosjson['items'][0] = array('title' => $title, 'src' => $itemsrc); file_put_contents($gosfile, json_encode($gosjson)); BaseChannel::append2All("gos", $gosjson); } else { return null; } } else { $gosjson = json_decode(file_get_contents($gosfile), true); } return $gosjson; }