本文整理汇总了PHP中okapi\Okapi::cache_status_id2name方法的典型用法代码示例。如果您正苦于以下问题:PHP Okapi::cache_status_id2name方法的具体用法?PHP Okapi::cache_status_id2name怎么用?PHP Okapi::cache_status_id2name使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类okapi\Okapi
的用法示例。
在下文中一共展示了Okapi::cache_status_id2name方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: call
//.........这里部分代码省略.........
$owner_ids = array();
while ($row = mysql_fetch_assoc($rs)) {
$entry = array();
$cacheid2wptcode[$row['cache_id']] = $row['wp_oc'];
foreach ($fields as $field) {
switch ($field) {
case 'code':
$entry['code'] = $row['wp_oc'];
break;
case 'gc_code':
// OC software allows entering anything here, and that's what users do.
// We do a formal verification so that only a valid GC code is returned:
if (preg_match('/^\\s*[Gg][Cc][A-Za-z0-9]+\\s*$/', $row['wp_gc'])) {
$entry['gc_code'] = strtoupper(trim($row['wp_gc']));
} else {
$entry['gc_code'] = null;
}
break;
case 'name':
$entry['name'] = $row['name'];
break;
case 'names':
$entry['names'] = array(Settings::get('SITELANG') => $row['name']);
break;
// for the future
// for the future
case 'location':
$entry['location'] = round($row['latitude'], 6) . "|" . round($row['longitude'], 6);
break;
case 'type':
$entry['type'] = Okapi::cache_type_id2name($row['type']);
break;
case 'status':
$entry['status'] = Okapi::cache_status_id2name($row['status']);
break;
case 'url':
$entry['url'] = Settings::get('SITE_URL') . "viewcache.php?wp=" . $row['wp_oc'];
break;
case 'owner':
$owner_ids[$row['wp_oc']] = $row['user_id'];
/* continued later */
break;
case 'distance':
$entry['distance'] = (int) Okapi::get_distance($center_lat, $center_lon, $row['latitude'], $row['longitude']);
break;
case 'bearing':
$tmp = Okapi::get_bearing($center_lat, $center_lon, $row['latitude'], $row['longitude']);
$entry['bearing'] = $tmp !== null ? (int) (10 * $tmp) / 10.0 : null;
break;
case 'bearing2':
$tmp = Okapi::get_bearing($center_lat, $center_lon, $row['latitude'], $row['longitude']);
$entry['bearing2'] = Okapi::bearing_as_two_letters($tmp);
break;
case 'bearing3':
$tmp = Okapi::get_bearing($center_lat, $center_lon, $row['latitude'], $row['longitude']);
$entry['bearing3'] = Okapi::bearing_as_three_letters($tmp);
break;
case 'is_found':
/* handled separately */
break;
case 'is_not_found':
/* handled separately */
break;
case 'is_watched':
/* handled separately */
break;