當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Okapi::cache_status_id2name方法代碼示例

本文整理匯總了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;
開發者ID:Slini11,項目名稱:okapi,代碼行數:67,代碼來源:geocaches.php


注:本文中的okapi\Okapi::cache_status_id2name方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。