示例#1
0
        <div class="alert alert-warning"><?php 
    echo lang_key('no_estates_found');
    ?>
</div>
        <?php 
} else {
    $data = array();
    $estates = array();
    foreach ($query->result() as $row) {
        if (get_settings('realestate_settings', 'hide_posts_if_expired', 'No') == 'Yes') {
            $is_expired = is_user_package_expired($row->created_by);
            if ($is_expired) {
                continue;
            }
        }
        $title = get_title_for_edit_by_id_lang($row->id, $curr_lang);
        $estate = array();
        $estate['estate_id'] = $row->id;
        $estate['estate_title'] = $title;
        $estate['featured_image_url'] = get_featured_photo_by_id($row->featured_img);
        $estate['latitude'] = $row->latitude;
        $estate['longitude'] = $row->longitude;
        $estate['estate_type'] = $row->type;
        $estate['estate_type_lang'] = lang_key($row->type);
        $estate['estate_status'] = $row->status;
        $estate['estate_price'] = show_price($row->total_price);
        $estate['estate_short_address'] = get_location_name_by_id($row->city) . ',' . get_location_name_by_id($row->state) . ',' . get_location_name_by_id($row->country);
        $estate['detail_link'] = site_url('property/' . $row->unique_id . '/' . dbc_url_title($title));
        array_push($estates, $estate);
    }
    $data['estates'] = $estates;
示例#2
0
 function get_site_map_xml()
 {
     $page_checked = $this->input->post('pages');
     $blog_post_checked = $this->input->post('blog_post');
     $estate_checked = $this->input->post('estate');
     $xml_array = array();
     if ($page_checked == 1 or $blog_post_checked == 2 or $estate_checked == 3) {
         if ($page_checked == 1) {
             $menu = get_option('top_menu');
             $menu = json_decode($menu->values);
             $page_url_array = array();
             foreach ($menu as $row) {
                 $id = $row->id;
                 $url = $this->get_page_url_by_id($id);
                 $page_url_array[] = $url;
             }
             if ($page_url_array) {
                 $xml_array = $page_url_array;
             }
         }
         if ($blog_post_checked == 2) {
             $this->load->model('show/show_model');
             $blog_post = $this->show_model->get_all_active_blog_posts_by_range('all', 'all', 'id', 'desc', 'all');
             if ($blog_post->num_rows() > 0) {
                 $blog_post_array = array();
                 foreach ($blog_post->result() as $row) {
                     $post_id = $row->id;
                     $post_title = $row->title;
                     $url = site_url('show/postdetail/' . $post_id . '/' . dbc_url_title($post_title));
                     $blog_post_array[] = $url;
                 }
             }
             if ($blog_post_array) {
                 $xml_array = array_merge($xml_array, $blog_post_array);
             }
         }
         if ($estate_checked == 3) {
             $estate_array = array();
             $this->load->model('realestate_model');
             $estate_data = $this->realestate_model->get_all_estates_admin('all', 'all', 'create_time', 'desc');
             if ($estate_data->num_rows() > 0) {
                 foreach ($estate_data->result() as $row) {
                     $curr_lang = $this->uri->segment(1) != '' ? $this->uri->segment(1) : 'en';
                     $title = get_title_for_edit_by_id_lang($row->id, $curr_lang);
                     $unique_id = $row->unique_id;
                     $site_title = dbc_url_title($title);
                     //                        $site_title = str_replace('&', '-', $site_title);
                     $site_title = preg_replace('/[^\\p{L}\\s\\p{N}]+/u', '', $site_title);
                     $url = site_url('property/' . $unique_id . '/' . $site_title);
                     $estate_array[] = $url;
                 }
             }
             if ($estate_array) {
                 $xml_array = array_merge($xml_array, $estate_array);
             }
         }
         $xml = $this->prepare_xml($xml_array);
         $this->load->helper('file');
         if (!write_file('./sitemap.xml', $xml)) {
             $this->session->set_flashdata('msg', '<div class="alert alert-danger">ROOT/sitemap.xml does not have write permission .</div>');
             redirect(site_url('admin/system/generatesitemap'));
         }
         $this->session->set_flashdata('msg', '<div class="alert alert-success">Site map generated successfully .</div>');
         redirect(site_url('admin/system/generatesitemap'));
     } else {
         $this->session->set_flashdata('msg', '<div class="alert alert-danger">Please select on or more select options .</div>');
         redirect(site_url('admin/system/generatesitemap'));
     }
 }
示例#3
0
                     <div id="<?php 
    echo $lang->short_name;
    ?>
" class="tab-pane fade in <?php 
    echo $flag == 1 ? 'active' : '';
    ?>
">

                    <div class="form-group">
                      <label class="col-sm-3 col-lg-2 control-label"><?php 
    echo lang_key('title');
    ?>
:</label>
                      <div class="col-sm-4 col-lg-5 controls">
                        <?php 
    $title = get_title_for_edit_by_id_lang($estate->id, $lang->short_name);
    $title = set_value('title' . $lang->short_name) != '' ? set_value('title' . $lang->short_name) : $title;
    ?>
                        <input type="text" name="title<?php 
    echo $lang->short_name;
    ?>
" value="<?php 
    echo $title;
    ?>
" placeholder="<?php 
    echo lang_key('title');
    ?>
" class="form-control input-sm" >
                        <span class="help-inline">&nbsp;</span>
                        <?php 
    echo form_error('title' . $lang->short_name);
示例#4
0
文件: show_core.php 项目: ageo80/test
 public function detail($unique_id = '')
 {
     $value['post'] = $this->show_model->get_post_by_unique_id($unique_id);
     if ($value['post']->num_rows() > 0) {
         $value['distance_info'] = $this->get_existing_distance_info($value['post']->row()->id);
     } else {
         $value['distance_info'] = array();
     }
     $data['content'] = load_view('detail_view', $value, TRUE);
     $data['alias'] = 'detail';
     $id = 0;
     if ($value['post']->num_rows() > 0) {
         $row = $value['post']->row();
         $id = $row->id;
         $seo['key_words'] = get_post_meta($row->id, 'tags');
     }
     $curr_lang = $this->uri->segment(1) != '' ? $this->uri->segment(1) : 'en';
     $title = get_title_for_edit_by_id_lang($id, $curr_lang);
     $description = get_description_for_edit_by_id_lang($id, $curr_lang);
     $data['sub_title'] = $title;
     $seo['meta_description'] = $description;
     $data['seo'] = $seo;
     load_template($data, $this->active_theme);
 }
示例#5
0
 function editestate($page = 0, $id = '', $msg = '')
 {
     if ($msg == 'error') {
         $msg = '<div class="alert alert-danger">' . lang_key('Missing required feilds. Please check the form below.') . '</div>';
     }
     $value['page'] = $page;
     $value['msg'] = $msg;
     $value['estate'] = $this->realestate_model->get_estate_by_id($id);
     $value['distance_info'] = $this->get_distance_info($id);
     $curr_lang = $this->uri->segment(1) != '' ? $this->uri->segment(1) : default_lang();
     $title = get_title_for_edit_by_id_lang($value['estate']->id, $curr_lang);
     $detail_link = site_url('property/' . $value['estate']->unique_id . '/' . dbc_url_title($title));
     $data['title'] = 'Edit estate (<a href="' . $detail_link . '" target="_blank">View Detail</a>)';
     $data['content'] = $this->load->view('admin/estate/edit_estate_view', $value, TRUE);
     $this->load->view('admin/template/template_view', $data);
 }
示例#6
0
 public function detail($unique_id = '')
 {
     $a = rand(1, 10);
     $b = rand(1, 10);
     $c = rand(1, 10) % 3;
     if ($c == 0) {
         $operator = '+';
         $ans = $a + $b;
     } else {
         if ($c == 1) {
             $operator = 'X';
             $ans = $a * $b;
         } else {
             if ($c == 2) {
                 $operator = '-';
                 $ans = $a - $b;
             }
         }
     }
     $this->session->set_userdata('security_ans', $ans);
     $value['question'] = $a . " " . $operator . " " . $b . " = ?";
     $value['post'] = $this->show_model->get_post_by_unique_id($unique_id);
     if ($value['post']->num_rows() > 0) {
         $value['distance_info'] = $this->get_existing_distance_info($value['post']->row()->id);
     } else {
         $value['distance_info'] = array();
     }
     $data['content'] = load_view('detail_view', $value, TRUE);
     $data['alias'] = 'detail';
     $id = 0;
     if ($value['post']->num_rows() > 0) {
         $row = $value['post']->row();
         $id = $row->id;
         $seo['key_words'] = get_post_meta($row->id, 'tags');
     }
     $curr_lang = $this->uri->segment(1) != '' ? $this->uri->segment(1) : 'en';
     $title = get_title_for_edit_by_id_lang($id, $curr_lang);
     $description = get_description_for_edit_by_id_lang($id, $curr_lang);
     $data['sub_title'] = $title;
     $description = strip_tags($description);
     $description = str_replace("'", "", $description);
     $description = str_replace('"', "", $description);
     $seo['meta_description'] = $description;
     $data['seo'] = $seo;
     load_template($data, $this->active_theme);
 }
示例#7
0
    <dc:creator><?php 
echo $creator_email;
?>
</dc:creator>

    <dc:rights>Copyright <?php 
echo gmdate("Y", time());
?>
</dc:rights>
    <admin:generatorAgent rdf:resource="http://www.codeigniter.com/" />
 
    <?php 
foreach ($posts->result() as $post) {
    ?>
     	<?php 
    $estate_title = get_title_for_edit_by_id_lang($post->id, $curr_lang);
    $description = get_description_for_edit_by_id_lang($post->id, $curr_lang);
    $detail_link = site_url('property/' . $post->unique_id . '/' . url_title($estate_title));
    ?>
        <item>
 
          <title><?php 
    echo xml_convert($estate_title);
    ?>
</title>
          <link><?php 
    echo $detail_link;
    ?>
</link>
          <guid><?php 
    echo $detail_link;
示例#8
0
        ?>

                      <tr>

                        <td data-title="#" class="numeric"><?php 
        echo $row->id;
        ?>
</td>

                        <td data-title="Thumb" class="numeric"><img class="thumbnail" style="width:50px;margin-bottom:0px;" src="<?php 
        echo get_featured_photo_by_id($row->featured_img);
        ?>
" /></td>

                        <td data-title="Title" class="numeric"><?php 
        echo get_title_for_edit_by_id_lang($row->id, $dl);
        ?>
</td>

                        <td data-title="Type" class="numeric"><?php 
        echo lang_key($row->type);
        ?>
</td>

                        <td data-title="Purpose" class="numeric"><?php 
        echo lang_key($row->purpose);
        ?>
</td>

                        <td data-title="Condition" class="numeric"><?php 
        echo lang_key($row->estate_condition);