Exemple #1
1
function google_cars()
{
    echo '<rss version ="2.0" xmlns:g="http://base.google.com/ns/1.0"> 
     
    <channel> 
	    <title>' . osc_page_title() . '</title> 
	    <description>' . osc_page_description() . '</description> 
	    <link>' . osc_base_url() . '</link>';
    if (osc_count_items()) {
        while (osc_has_items()) {
            $item = feed_get_car_data(osc_item());
            $date = date('d/m/Y');
            $time = date('H:i');
            if (preg_match('|([0-9]{4})-([0-9]{2})-([0-9]{2})|', osc_item_pub_date(), $tmp)) {
                $date = $tmp[3] . "/" . $tmp[2] . "/" . $tmp[1];
            }
            echo '<item> 
            <title>' . osc_item_title() . '</title> 
            <description>' . osc_item_description() . '</description> 
            <g:id>' . osc_item_id() . '</g:id> 
            <link>' . osc_item_url() . '</link> 
            <g:location>' . (osc_item_address() != '' ? osc_item_address() : '') . ', ' . (osc_item_city() != '' ? osc_item_city() : '') . ', ' . (osc_item_region() != '' ? osc_item_region() : '') . ', ' . (osc_item_zip() != '' ? osc_item_zip() : '') . ' ' . (osc_item_country() != '' ? osc_item_country() : '') . '</g:location> 
            <g:publish_date>' . $date . '</g:publish_date> 
            <g:color>' . (isset($item['s_color']) ? $item['s_color'] : '') . '</g:color> 
            <g:condition>' . (isset($item['b_new']) && $item['b_new'] == 1 ? 'new' : 'used') . '</g:condition>';
            if (osc_count_item_resources() > 0) {
                while (osc_has_item_resources()) {
                    if (strpos(osc_resource_type(), 'image') !== FALSE) {
                        echo '<g:image_link>' . osc_resource_path() . '</g:image_link>';
                    }
                }
            }
            echo '<g:make>' . (isset($item['s_make']) ? $item['s_make'] : '') . '</g:make> 
            <g:mileage>' . (isset($item['i_mileage']) ? $item['i_mileage'] : '') . '</g:mileage> 
            <g:model>' . (isset($item['s_model']) ? $item['s_model'] : '') . '</g:model> 
            <g:price>' . (osc_item_price() != '' ? osc_item_price() : '') . '</g:price> 
            <g:vehicle_type>' . (isset($item['s_name']) ? $item['s_name'] : '') . '</g:vehicle_type> 
            <g:year>' . (isset($item['i_year']) ? $item['i_year'] : '') . '</g:year>
            </item>';
        }
    }
    echo '</channel> 
    </rss>';
}
Exemple #2
1
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>';
}
Exemple #3
1
function trovit_cars()
{
    echo '<?xml version="1.0" encoding="utf-8"?>
            <trovit>';
    if (osc_count_items()) {
        while (osc_has_items()) {
            $item = feed_get_car_data(osc_item());
            $date = date('d/m/Y');
            $time = date('H:i');
            if (preg_match('|([0-9]{4})-([0-9]{2})-([0-9]{2}) ([0-9]{2}):([0-9]{2})|', osc_item_pub_date(), $tmp)) {
                $date = $tmp[3] . "/" . $tmp[2] . "/" . $tmp[1];
                $time = $tmp[4] . ":" . $tmp[5];
            }
            echo '<ad>
                    <id><![CDATA[' . osc_item_id() . ']]></id>
                    <url><![CDATA[' . osc_item_url() . ']]></url>
                    <title><![CDATA[' . osc_item_title() . ']]></title>

                    <content><![CDATA[' . osc_item_description() . ']]></content>

                    <price><![CDATA[' . osc_item_price() . ']]></price>

                    <make><![CDATA[' . (isset($item['s_make']) ? $item['s_make'] : '') . ']]></make>
                    <model><![CDATA[' . (isset($item['s_model']) ? $item['s_model'] : '') . ']]></model>
                    <color><![CDATA[' . (isset($item['s_color']) ? $item['s_color'] : '') . ']]></color>

                    <mileage><![CDATA[' . (isset($item['i_mileage']) ? $item['i_mileage'] : '') . ']]></mileage>
                    <doors><![CDATA[' . (isset($item['i_doors']) ? $item['i_doors'] : '') . ']]></doors>
                    <fuel><![CDATA[' . (isset($item['e_fuel']) ? $item['e_fuel'] : '') . ']]></fuel>
                    <transmission><![CDATA[' . (isset($item['e_transmission']) ? $item['e_transmission'] : '') . ']]></transmission>
                    <engine_size><![CDATA[' . (isset($item['i_engine_size']) ? $item['i_engine_size'] : '') . ']]></engine_size>
                    <cylinders><![CDATA[' . (isset($item['i_cylinders']) ? $item['i_cylinders'] : '') . ']]></cylinders>
                    <power unit="' . (isset($item['e_power_unit']) ? $item['e_power_unit'] : '') . '"><![CDATA[' . (isset($item['i_power']) ? $item['i_power'] : '') . ']]></power>
                    <seats><![CDATA[' . (isset($item['i_seats']) ? $item['i_seats'] : '') . ']]></seats>
                    <gears><![CDATA[' . (isset($item['i_gears']) ? $item['i_gears'] : '') . ']]></gears>

                    <address><![CDATA[' . (osc_item_address() != '' ? osc_item_address() : '') . ']]></address>
                    <city><![CDATA[' . (osc_item_city() != '' ? osc_item_city() : '') . ']]></city>

                    <city_area><![CDATA[' . (osc_item_city_area() != '' ? osc_item_city_area() : '') . ']]></city_area>
                    <postcode><![CDATA[' . (osc_item_zip() != '' ? osc_item_zip() : '') . ']]></postcode>
                    <region><![CDATA[' . (osc_item_region() != '' ? osc_item_region() : '') . ']]></region>

                    <latitude><![CDATA[' . (osc_item_latitude() != '' ? osc_item_latitude() : '') . ']]></latitude>
                    <longitude><![CDATA[' . (osc_item_longitude() != '' ? osc_item_longitude() : '') . ']]></longitude>';
            $res_string = '';
            if (osc_count_item_resources() > 0) {
                while (osc_has_item_resources()) {
                    if (strpos(osc_resource_type(), 'image') !== FALSE) {
                        $res_string .= '<picture>
                                            <picture_url><![CDATA[' . osc_resource_path() . ']]></picture_url>
                                            <picture_title><![CDATA[' . osc_resource_name() . ']]></picture_title>
                                        </picture>';
                    }
                }
            }
            if ($res_string != '') {
                echo '<pictures>' . $res_string . '</pictures>';
            }
            echo '
                <date><![CDATA[' . $date . ']]></date>
                <time><![CDATA[' . $time . ']]></time>
            </ad>';
        }
    }
    echo '</trovit>';
}
Exemple #4
0
function google_maps_location()
{
    $item = osc_item();
    if (osc_google_maps_key() != '') {
        osc_google_maps_header();
        require 'map.php';
    }
}
Exemple #5
0
function indeed()
{
    echo '<?xml version="1.0" encoding="utf-8"?>
    <source>
    <publisher>' . osc_page_title() . '</publisher>
    <publisherurl>' . osc_base_url() . '</publisherurl>
    <lastBuildDate>' . date("D, j M Y G:i:s T") . '</lastBuildDate>';
    if (osc_count_items()) {
        while (osc_has_items()) {
            $item = feed_get_job_data(osc_item());
            $salary = "";
            if (isset($item['i_salary_min']) && $item['i_salary_min'] != '') {
                $salary = $item['i_salary_min'];
            }
            if (isset($item['i_salary_max']) && $item['i_salary_max'] != '') {
                if ($salary != "") {
                    $salary .= ' - ';
                }
                $salary .= $item['i_salary_max'];
            }
            if (isset($item['e_salary_period']) && $item['e_slary_period'] != '') {
                if ($salary != "") {
                    $salary .= ' ';
                    $salary .= $item['e_salary_period'];
                }
            }
            $locale = current($item['locale']);
            if (isset($locale['s_desired_exp']) && $locale['s_desired_exp'] != '') {
                $experience = $locale['s_desired_exp'];
            } else {
                $experience = '';
            }
            if (isset($locale['s_studies']) && $locale['s_studies'] != '') {
                $education = $locale['s_studies'];
            } else {
                $education = '';
            }
            echo '<job>
            <title><![CDATA[' . osc_item_title() . ']]></title>
            <date><![CDATA[' . osc_item_pub_date() . ']]></date>
            <referencenumber><![CDATA[' . osc_item_id() . ']]></referencenumber>
            <url><![CDATA[' . osc_item_url() . ']]></url>
            <company><![CDATA[' . (isset($item['s_company_name']) && $item['s_company_name'] != NULL ? $item['s_company_name'] : '') . ']]></company>
            <city><![CDATA[' . (osc_item_city() != NULL ? osc_item_city() : '') . ']]></city>
            <state><![CDATA[' . (osc_item_region() != NULL ? osc_item_region() : '') . ']]></state>
            <country><![CDATA[' . (osc_item_country() != NULL ? osc_item_country() : '') . ']]></country>
            <postalcode><![CDATA[' . (osc_item_zip() != NULL ? osc_item_zip() : '') . ']]></postalcode>
            <description><![CDATA[' . (osc_item_description() != NULL ? osc_item_description() : '') . ']]></description>
            <salary><![CDATA[' . $salary . ']]></salary>
            <education><![CDATA[' . $education . ']]></education>
            <jobtype><![CDATA[' . (isset($item['e_position_type']) && $item['e_position_type'] != NULL ? $item['e_position_type'] : '') . ']]></jobtype>
            <category><![CDATA[]]></category>
            <experience><![CDATA[' . $experience . ']]></experience>
            </job>';
        }
    }
    echo '</source>';
}
Exemple #6
0
                                </div>
                            </div>
                            <?php 
}
?>

                            <div class="control-group">
                                <label class="control-label" for="city"><?php 
_e('City', 'bender');
?>
</label>
                                <div class="controls">
                                    <?php 
if (bender_default_location_show_as() == 'dropdown') {
    if (Params::getParam('action') != 'item_edit') {
        ItemForm::city_select(array(array('pk_i_id' => '', 's_name' => __("Select a city..."))), osc_item());
    } else {
        // add new item
        ItemForm::city_select(osc_get_cities(osc_user_region_id()), osc_user());
    }
} else {
    ItemForm::city_text(osc_user());
}
?>
                                </div>
                            </div>
                            <div class="control-group">
                                <label class="control-label" for="cityArea"><?php 
_e('City Area', 'bender');
?>
</label>
 public static function show_email_checkbox($item = null)
 {
     if ($item == null) {
         $item = osc_item();
     }
     if (Session::newInstance()->_getForm('showEmail') != 0) {
         $item['b_show_email'] = Session::newInstance()->_getForm('showEmail');
     }
     parent::generic_input_checkbox('showEmail', '1', isset($item['b_show_email']) ? $item['b_show_email'] : false);
     return true;
 }
function item_address()
{
    ?>
        <?php 
    $item = osc_item() != null ? osc_item() : array();
    ?>
        <input type="text" id="address" name="address" value="<?php 
    echo get_item_address($item);
    ?>
" />
        <?php 
}
Exemple #9
0
function printLocaleDescription($locales = null, $item = null)
{
    if ($locales == null) {
        $locales = osc_get_locales();
    }
    if ($item == null) {
        $item = osc_item();
    }
    $num_locales = count($locales);
    foreach ($locales as $locale) {
        $name = 'description' . '[' . $locale['pk_c_code'] . ']';
        echo '<div><label for="description">' . __('Description') . ' *</label>';
        $description = isset($item) && isset($item['locale'][$locale['pk_c_code']]) && isset($item['locale'][$locale['pk_c_code']]['s_description']) ? $item['locale'][$locale['pk_c_code']]['s_description'] : '';
        if (Session::newInstance()->_getForm('description') != "") {
            $description_ = Session::newInstance()->_getForm('description');
            if ($description_[$locale['pk_c_code']] != "") {
                $description = $description_[$locale['pk_c_code']];
            }
        }
        echo '<textarea id="' . $name . '" name="' . $name . '" rows="10">' . $description . '</textarea></div>';
    }
}
Exemple #10
0
                        <a href="<?php 
echo osc_esc_html(pop_email_share_url());
?>
" title="Share" class="share-icon email-icon"></a>
                        <p>
                </div>
            </div>

            <div class="item-details">
                <div class="header"><?php 
_e('Details', 'pop');
?>
 </div>

                <?php 
osc_run_hook('item_detail', osc_item());
?>

                <div id="custom_fields">
                    <?php 
if (osc_count_item_meta() >= 1) {
    ?>
                    <div class="meta_list">
                        <?php 
    while (osc_has_item_meta()) {
        ?>
                        <?php 
        if (osc_item_meta_value() != '') {
            ?>
                        <div class="meta">
                            <strong><?php 
Exemple #11
0
?>
" ;
            twitter_theme.max_images_fields_txt   = "<?php 
_e('Sorry, you have reached the maximum number of images per ad', 'twitter_bootstrap');
?>
" ;
            twitter_theme.country_select_id       = "<?php 
echo get_country_id(osc_item() != null ? osc_item() : array());
?>
" ;
            twitter_theme.region_select_id        = "<?php 
echo get_region_id(osc_item() != null ? osc_item() : array());
?>
" ;
            twitter_theme.city_select_id          = "<?php 
echo get_city_id(osc_item() != null ? osc_item() : array());
?>
" ;
            twitter_theme.ajax_url                = "<?php 
echo osc_base_url(true) . '?page=ajax';
?>
" ;
            twitter_theme.text_select_country     = "<?php 
_e('Select a country...', 'twitter_bootstrap');
?>
" ;
            twitter_theme.text_select_region      = "<?php 
_e('Select a region...', 'twitter_bootstrap');
?>
" ;
            twitter_theme.text_select_city        = "<?php 
Exemple #12
0
function google_maps_location()
{
    $item = osc_item();
    osc_google_maps_header();
    require 'map.php';
}
Exemple #13
0
/**
 * return number of views of current item
 *
 * @return int
 */
function osc_item_views()
{
    $item = osc_item();
    if (isset($item['i_num_views'])) {
        return (int) osc_item_field("i_num_views");
    } else {
        return ItemStats::newInstance()->getViews(osc_item_id());
    }
}
function multilanguage_form($fields)
{
    $locales = osc_get_locales();
    $item = osc_item();
    $num_locales = count($locales);
    foreach ($locales as $locale) {
        foreach ($fields as $field) {
            if ($num_locales > 1) {
                echo '<div class="switch-locale locale-' . $locale['pk_c_code'] . '">';
            }
            multilanguage_form_create_field($locale, $field);
            if ($num_locales > 1) {
                echo '</div>';
            }
        }
    }
}
 public static function show_email_checkbox($item = null)
 {
     if ($item == null) {
         $item = osc_item();
     }
     parent::generic_input_checkbox('showEmail', '1', isset($item['b_show_email']) ? $item['b_show_email'] : false);
     return true;
 }
Exemple #16
0
                            <label class="control-label" for="city"><?php 
_e('City', 'pop');
?>
</label>
                            <div class="controls">
                                <?php 
if ($action == 'item_add_post') {
    ?>
                                <?php 
    ItemForm::city_select(osc_get_cities(osc_user_region_id()), osc_user());
    ?>
                                <?php 
} else {
    ?>
                                <?php 
    ItemForm::city_select(null, osc_item());
    ?>
                                <?php 
}
?>
                            </div>
                        </div>
                        <div class="control-group">
                            <label class="control-label" for="cityArea"><?php 
_e('City Area', 'pop');
?>
</label>
                            <div class="controls">
                                <?php 
ItemForm::city_area_text(osc_user());
?>
Exemple #17
0
function osc_item_field($field, $locale = "")
{
    return osc_field(osc_item(), $field, $locale);
}
Exemple #18
0
/**
 * Create automatically the url of the item details page
 *
 * @param string $locale
 * @return string
 */
function osc_item_url($locale = '')
{
    return osc_item_url_from_item(osc_item(), $locale);
}
<input type="hidden" name="page" value="item" />
<input type="hidden" name="id" value="<?php 
echo osc_item_id();
?>
" />
<input type="hidden" name="secret" value="<?php 
echo osc_item_secret();
?>
" />
<ul id="error_list"></ul>
<div class="content add_item">
    <div class="ui-generic-form ">
        <div class="ui-generic-form-content">
            <?php 
$locales = osc_get_locales();
$item = osc_item();
$num_locales = count($locales);
if ($num_locales > 1) {
    echo '<div class="row">';
    echo '<label for="switch-language">' . __('Language', 'realestate') . '</label>';
    echo '<select name="switch-language">';
    foreach ($locales as $locale) {
        echo '<option value="' . $locale['pk_c_code'] . '">' . $locale['s_short_name'] . '</option>';
    }
    echo '</select>';
    echo '</div>';
}
?>
            <?php 
if (!osc_is_web_user_logged_in()) {
    ?>
Exemple #20
0
function yandex_maps_location()
{
    $item = osc_item();
    require 'map.php';
}