当前位置: 首页>>代码示例>>PHP>>正文


PHP wpl_global::number_to_word方法代码示例

本文整理汇总了PHP中wpl_global::number_to_word方法的典型用法代码示例。如果您正苦于以下问题:PHP wpl_global::number_to_word方法的具体用法?PHP wpl_global::number_to_word怎么用?PHP wpl_global::number_to_word使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在wpl_global的用法示例。


在下文中一共展示了wpl_global::number_to_word方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: update_text_search_field

 /**
  * Updates text search field
  * @author Howard <howard@realtyna.com>
  * @static
  * @param int $property_id
  */
 public static function update_text_search_field($property_id)
 {
     $property_data = wpl_property::get_property_raw_data($property_id);
     /** get text_search fields **/
     $fields = wpl_flex::get_fields('', 1, $property_data['kind'], 'text_search', '1');
     $rendered = self::render_property($property_data, $fields);
     $text_search_data = array();
     foreach ($rendered as $data) {
         if (!isset($data['type'])) {
             continue;
         }
         if (isset($data['type']) and !trim($data['type']) or isset($data['value']) and !trim($data['value'])) {
             continue;
         }
         /** default value **/
         $value = isset($data['value']) ? $data['value'] : '';
         $value2 = '';
         $type = $data['type'];
         if ($type == 'text' or $type == 'textarea') {
             $value = $data['name'] . ' ' . $data['value'];
         } elseif ($type == 'neighborhood') {
             $value = $data['name'] . (isset($data['distance']) ? ' (' . $data['distance'] . ' ' . __('MINUTES', WPL_TEXTDOMAIN) . ' ' . __('BY', WPL_TEXTDOMAIN) . ' ' . $data['by'] . ')' : '');
         } elseif ($type == 'feature') {
             $feature_value = $data['name'];
             if (isset($data['values'][0])) {
                 $feature_value .= ' ';
                 foreach ($data['values'] as $val) {
                     $feature_value .= $val . ', ';
                 }
                 $feature_value = rtrim($feature_value, ', ');
             }
             $value = $feature_value;
         } elseif ($type == 'locations' and isset($data['locations']) and is_array($data['locations'])) {
             $location_value = '';
             foreach ($data['locations'] as $location_level => $value) {
                 $location_value .= $data['keywords'][$location_level] . ' ';
                 $abbr = wpl_locations::get_location_abbr_by_name($data['raw'][$location_level], $location_level);
                 $name = wpl_locations::get_location_name_by_abbr($abbr, $location_level);
                 $location_value .= $name . ' ' . ($name != $abbr ? $abbr . ' ' : NULL);
             }
             $location_value .= __('County', WPL_TEXTDOMAIN);
             $value = $location_value;
         } elseif (isset($data['value'])) {
             $value = $data['name'] . ' ' . $data['value'];
             if (is_numeric($data['value'])) {
                 $value2 = $data['name'] . ' ' . wpl_global::number_to_word($data['value']);
             }
         }
         /** set value in text search data **/
         if (trim($value) != '') {
             $text_search_data[] = strip_tags($value);
         }
         if (trim($value2) != '') {
             $text_search_data[] = strip_tags($value2);
         }
     }
     $column = 'textsearch';
     if (wpl_global::check_multilingual_status()) {
         $column = wpl_addon_pro::get_column_lang_name($column, wpl_global::get_current_language(), false);
     }
     wpl_db::set('wpl_properties', $property_id, $column, wpl_db::escape(implode(' ', $text_search_data)));
 }
开发者ID:amankatoch,项目名称:wp-plugin,代码行数:68,代码来源:property.php

示例2: update_text_search_field

 /**
  * Generate Text search field
  * @author Howard R <howard@realtyna.com>
  * @static
  * @param int $user_id
  */
 public static function update_text_search_field($user_id)
 {
     $user_data = (array) wpl_users::get_wpl_user($user_id);
     /** get text_search fields **/
     $fields = wpl_flex::get_fields('', 1, 2, 'text_search', '1');
     $rendered = self::render_profile($user_data, $fields);
     $text_search_data = array();
     foreach ($rendered as $data) {
         if (isset($data['type']) and !trim($data['type']) or isset($data['value']) and !trim($data['value'])) {
             continue;
         }
         /** default value **/
         $value = isset($data['value']) ? $data['value'] : '';
         $value2 = '';
         $type = isset($data['type']) ? $data['type'] : '';
         if ($type == 'text' or $type == 'textarea') {
             $value = $data['name'] . ' ' . $data['value'];
         } elseif ($type == 'locations' and isset($data['locations']) and is_array($data['locations'])) {
             $location_value = '';
             foreach ($data['locations'] as $location_level => $value) {
                 $location_value .= $data['keywords'][$location_level] . ' ';
                 $abbr = wpl_locations::get_location_abbr_by_name($data['raw'][$location_level], $location_level);
                 $name = wpl_locations::get_location_name_by_abbr($abbr, $location_level);
                 $location_value .= $name . ' ' . ($name != $abbr ? $abbr . ' ' : NULL);
             }
             $location_value .= __('County', WPL_TEXTDOMAIN);
             $value = $location_value;
         } elseif (isset($data['value'])) {
             $value = $data['name'] . ' ' . $data['value'];
             if (is_numeric($data['value'])) {
                 $value2 = $data['name'] . ' ' . wpl_global::number_to_word($data['value']);
             }
         }
         /** set value in text search data **/
         $text_search_data[] = $value;
         if (trim($value2) != '') {
             $text_search_data[] = $value2;
         }
     }
     $column = 'textsearch';
     if (wpl_global::check_multilingual_status()) {
         $column = wpl_addon_pro::get_column_lang_name($column, wpl_global::get_current_language(), false);
     }
     wpl_db::set('wpl_users', $user_id, $column, implode(' ', wpl_db::escape($text_search_data)));
 }
开发者ID:amankatoch,项目名称:wp-plugin,代码行数:51,代码来源:users.php

示例3: update_text_search_field

 /**
  * Updates text search field
  * @author Howard <howard@realtyna.com>
  * @static
  * @param int $property_id
  */
 public static function update_text_search_field($property_id)
 {
     $property_data = wpl_property::get_property_raw_data($property_id);
     $kind = wpl_property::get_property_kind($property_id);
     /** get text_search fields **/
     $fields = wpl_flex::get_fields('', 1, $property_data['kind'], 'text_search', '1');
     $rendered = self::render_property($property_data, $fields);
     $text_search_data = array();
     foreach ($rendered as $data) {
         if (!isset($data['type'])) {
             continue;
         }
         if (isset($data['type']) and !trim($data['type']) or isset($data['value']) and !trim($data['value'])) {
             continue;
         }
         /** default value **/
         $value = isset($data['value']) ? $data['value'] : '';
         $value2 = '';
         $type = $data['type'];
         if ($type == 'text' or $type == 'textarea') {
             $value = $data['name'] . ' ' . $data['value'];
         } elseif ($type == 'neighborhood') {
             $value = $data['name'] . (isset($data['distance']) ? ' (' . $data['distance'] . ' ' . __('MINUTES', WPL_TEXTDOMAIN) . ' ' . __('BY', WPL_TEXTDOMAIN) . ' ' . $data['by'] . ')' : '');
         } elseif ($type == 'feature') {
             $feature_value = $data['name'];
             if (isset($data['values'][0])) {
                 $feature_value .= ' ';
                 foreach ($data['values'] as $val) {
                     $feature_value .= $val . ', ';
                 }
                 $feature_value = rtrim($feature_value, ', ');
             }
             $value = $feature_value;
         } elseif ($type == 'locations' and isset($data['locations']) and is_array($data['locations'])) {
             $location_values = array();
             foreach ($data['locations'] as $location_level => $value) {
                 array_push($location_values, $data['keywords'][$location_level]);
                 $abbr = wpl_locations::get_location_abbr_by_name($data['raw'][$location_level], $location_level);
                 $name = wpl_locations::get_location_name_by_abbr($abbr, $location_level);
                 $ex_space = explode(' ', $name);
                 foreach ($ex_space as $value_raw) {
                     array_push($location_values, $value_raw);
                 }
                 if ($name !== $abbr) {
                     array_push($location_values, $abbr);
                 }
             }
             /** Add all location fields to the location text search **/
             $location_category = wpl_flex::get_category(NULL, " AND `kind`='{$kind}' AND `prefix`='ad'");
             $location_fields = wpl_flex::get_fields($location_category->id, 1, $kind);
             foreach ($location_fields as $location_field) {
                 if (!isset($rendered[$location_field->id])) {
                     continue;
                 }
                 if (!trim($location_field->table_column)) {
                     continue;
                 }
                 if (!isset($rendered[$location_field->id]['value']) or isset($rendered[$location_field->id]['value']) and !trim($rendered[$location_field->id]['value'])) {
                     continue;
                 }
                 $ex_space = explode(' ', strip_tags($rendered[$location_field->id]['value']));
                 foreach ($ex_space as $value_raw) {
                     array_push($location_values, $value_raw);
                 }
             }
             $location_suffix_prefix = wpl_locations::get_location_suffix_prefix();
             foreach ($location_suffix_prefix as $suffix_prefix) {
                 array_push($location_values, $suffix_prefix);
             }
             $location_string = '';
             $location_values = array_unique($location_values);
             foreach ($location_values as $location_value) {
                 $location_string .= 'LOC-' . __($location_value, WPL_TEXTDOMAIN) . ' ';
             }
             $value = trim($location_string);
         } elseif (isset($data['value'])) {
             $value = $data['name'] . ' ' . $data['value'];
             if (is_numeric($data['value'])) {
                 $value2 = $data['name'] . ' ' . wpl_global::number_to_word($data['value']);
             }
         }
         /** set value in text search data **/
         if (trim($value) != '') {
             $text_search_data[] = strip_tags($value);
         }
         if (trim($value2) != '') {
             $text_search_data[] = strip_tags($value2);
         }
     }
     $column = 'textsearch';
     if (wpl_global::check_multilingual_status()) {
         $column = wpl_addon_pro::get_column_lang_name($column, wpl_global::get_current_language(), false);
     }
     wpl_db::set('wpl_properties', $property_id, $column, wpl_db::escape(implode(' ', $text_search_data)));
//.........这里部分代码省略.........
开发者ID:gvh1993,项目名称:project-vvvh,代码行数:101,代码来源:property.php


注:本文中的wpl_global::number_to_word方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。