function oodle_realstate() { echo '<?xml version="1.0" encoding="utf-8"?><listings>'; if (osc_count_items()) { while (osc_has_items()) { $item = feed_get_house_data(osc_item()); $time = explode(" ", osc_item_pub_date()); if (isset($item['s_square_meters'])) { $lot_size = $item['s_square_meters'] * 10.7639104; } else { $lot_size = 0; } $amenities = array(); if (isset($item['b_heating']) && $item['b_heating']) { $amenities[] = __('Heating', 'extra_feeds'); } if (isset($item['b_air_condition']) && $item['b_air_condition']) { $amenities[] = __('Air condition', 'extra_feeds'); } if (isset($item['b_elevator']) && $item['b_elevator']) { $amenities[] = __('Elevator', 'extra_feeds'); } if (isset($item['b_terrace']) && $item['b_terrace']) { $amenities[] = __('Terrace', 'extra_feeds'); } if (isset($item['b_parking']) && $item['b_parking']) { $amenities[] = __('Parking', 'extra_feeds'); } echo '<listing> <category>' . osc_item_category() . '</category> <description><![CDATA[' . osc_item_description() . ']]></description> <id>' . osc_item_id() . '</id> <title><![CDATA[' . osc_item_title() . ']]></title> <url>' . osc_item_url() . '</url> <address>' . osc_item_address() . '</address> <city>' . osc_item_city() . '</city> <country>' . osc_item_country_code() . '</country> <neighborhood>' . osc_item_city_area() . '</neighborhood> <state>' . osc_item_region() . '</state> <zip_code>' . osc_item_zip() . '</zip_code> <longitude>' . osc_item_longitude() . '</longitude> <latitude>' . osc_item_latitude() . '</latitude> <amenities>' . implode(", ", $amenities) . '</amenities> <bathrooms>' . @$item['i_num_bathrooms'] . '</bathrooms> <bedrooms>' . @$item['i_num_rooms'] . '</bedrooms> <condition>' . @$item['e_status'] . '</condition> <create_time>' . $time[0] . '</create_time> <currency>' . osc_item_currency() . '</currency> <furnished>' . (@$item['b_furnished'] ? 'Furnished' : '') . '</furnished>'; if (osc_count_item_resources() > 0) { if (strpos(osc_resource_type(), 'image') !== FALSE) { echo '<image_url><![CDATA[' . osc_resource_path() . ']]></image_url>'; } } echo '<lot_size>' . $lot_size . '</lot_size> <lot_size_units>square feet</lot_size_units> <price>' . osc_item_price() . '</price> <seller_email>' . osc_item_contact_email() . '</seller_email> <seller_name><![CDATA[' . osc_item_contact_name() . ']]></seller_name> <year>' . @$item['i_year'] . '</year> </listing>'; } } echo '</listings>'; }
function multicurrency_add_prices($formatted_price) { if (osc_item_price() != NULL && osc_item_price() != '' && osc_item_price() != 0) { $rates = ModelMC::newInstance()->getRates(osc_item_currency()); $data = array(); foreach ($rates as $r) { $price = osc_item_price() / 1000000 * $r['f_rate']; $symbol = $r['s_to']; $currencyFormat = osc_locale_currency_format(); $currencyFormat = str_replace('{NUMBER}', number_format($price, osc_locale_num_dec(), osc_locale_dec_point(), osc_locale_thousands_sep()), $currencyFormat); $currencyFormat = str_replace('{CURRENCY}', $symbol, $currencyFormat); $data[] = $currencyFormat; } return $formatted_price . ' <a class=MCtooltip href="#">' . __('Other currencies', 'multicurrency') . '<span>' . implode("<br />", $data) . '</span></a>'; } return $formatted_price; }
/** * Formats the price using the appropiate currency. * * @param float $price * @return string */ function osc_format_price($price) { if ($price == null) { return osc_apply_filter('item_price_null', __('Check with seller')); } if ($price == 0) { return osc_apply_filter('item_price_zero', __('Free')); } $price = $price / 1000000; $currencyFormat = osc_locale_currency_format(); $currencyFormat = str_replace('{NUMBER}', number_format($price, osc_locale_num_dec(), osc_locale_dec_point(), osc_locale_thousands_sep()), $currencyFormat); $currencyFormat = str_replace('{CURRENCY}', osc_item_currency(), $currencyFormat); return osc_apply_filter('item_price', $currencyFormat); }
/** * Gets currency symbol of an item * * @since 3.0 * @return string */ function osc_item_currency_symbol() { $aCurrency = Currency::newInstance()->findByPrimaryKey(osc_item_currency()); return $aCurrency['s_description']; }
function osc_format_price($price) { if ($price == 0) { return __('Check with seller'); } //if ($price == null) return __('Check with seller') ; //if ($price == 0) return __('Free') ; $currencyFormat = osc_locale_currency_format(); $currencyFormat = preg_replace('/%s/', 'CURRENCY', $currencyFormat); $currencyFormat = sprintf($currencyFormat, $price); $currencyFormat = preg_replace('/CURRENCY/', '%s', $currencyFormat); return sprintf($currencyFormat, osc_item_currency()); }
?> "><?php echo osc_item_title(); ?> </a></div> <div class="hr" style="width:40%"></div> <div class="add-date"><?php //echo osc_item_pub_date(); ?> </div> <h6 style="color:#737884;"><?php echo osc_item_category(); ?> </h6> <h6><?php echo osc_item_price() / 1000000 . " " . osc_item_currency(); ?> </h6> </li> </ul> <p class="add-para add-para1"><?php echo osc_item_description(); ?> </p> </div> </div> <?php } //END ELSE ?> <?php