public function detail($unique_id = '') { $value = array(); $this->load->model('user/post_model'); $value['post'] = $this->post_model->get_post_by_unique_id($unique_id); $data['content'] = load_view('detail_view', $value, TRUE); $data['alias'] = 'detail'; $id = 0; $status = 1; if ($value['post']->num_rows() > 0) { $row = $value['post']->row(); $status = $row->status; $id = $row->id; $seo['key_words'] = $row->tags; $title = get_post_data_by_lang($row, 'title'); $description = get_post_data_by_lang($row, 'description'); $this->post_model->inc_view_count_by_unique_id($unique_id); } if ($status != 1) { $this->output->set_status_header('404'); $data['content'] = load_view('404_view', '', TRUE); load_template($data, $this->active_theme, 'template_view'); } else { $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); } }
function post_detail_url($post) { $CI =& get_instance(); $url = site_url('ads/' . $post->unique_id); #never remove this line $url .= '/' . dbc_url_title(get_category_title_by_id($post->category)); $url .= '/' . dbc_url_title(get_post_data_by_lang($post, 'title')); return $url; }
<a href="<?php echo post_detail_url($post); ?> "><img class="img-responsive img-thumbnail" src="<?php echo get_featured_photo_by_id($post->featured_img); ?> " alt="<?php echo get_post_data_by_lang($post, 'title'); ?> " /></a> <!-- Heading --> <h4><a href="<?php echo post_detail_url($post); ?> "><?php echo get_post_data_by_lang($post, 'title'); ?> </a></h4> <!-- Price --> <div class="price"><strong><?php echo lang_key('city'); ?> </strong>: <?php echo get_location_name_by_id($post->city); ?> <?php $average_rating = $post->rating; ?> <?php $half_star_position = check_half_star_position($average_rating); ?>
function prepare_map_json_from_query($query) { $CI = get_instance(); $data = array(); $posts = array(); $i = 0; foreach ($query->result() as $row) { $i++; $post = array(); $post['post_id'] = $row->id; $post['post_title'] = get_post_data_by_lang($row, 'title'); $post['post_purpose'] = ''; $post['featured_image_url'] = get_featured_photo_by_id($row->featured_img); $post['latitude'] = $row->latitude; $post['longitude'] = $row->longitude; $post['price'] = ''; $post['rating'] = $row->rating; $post['post_short_address'] = get_location_name_by_id($row->city); $post['detail_link'] = post_detail_url($row); $post['parent_category'] = get_category_title_by_id($row->category); $post['fa_icon'] = get_category_fa_icon($row->category); if ($i % 3 == 1) { $color = "#ed5441"; } else { if ($i % 3 == 2) { $color = "#51d466"; } else { $color = "#609cec"; } } $post['fa_color'] = $color; array_push($posts, $post); } $data['posts'] = $posts; return $data; }
content: contentString }); var marker, i; var markers = []; marker = new Marker({ position: myLatlng, map: map, title: '<?php echo get_post_data_by_lang($post, "title"); ?> ', zIndex: 9, icon: { path: SQUARE_PIN, fillColor: '#ed5441', fillOpacity: 1, strokeColor: '', strokeWeight: 0, scale: 1/3 }, label: '<i class="fa <?php echo $fa_icon; ?> "></i>'
" class="form-control"> <?php echo form_error('title_' . $lang); ?> </div> </div> <div class="form-group"> <label class="col-md-3 control-label"><?php echo lang_key('description'); ?> </label> <div class="col-md-8"> <?php $v = set_value('description_' . $lang) != '' ? set_value('description_' . $lang) : get_post_data_by_lang($post, 'description', $lang); ?> <textarea rows="15" name="description_<?php echo $lang; ?> " class="form-control rich"><?php echo $v; ?> </textarea> <?php echo form_error('description_' . $lang); ?> </div> </div>
</a> <!-- Comments --> <a href="<?php echo site_url('location-posts/' . $post->city . '/city/' . dbc_url_title(get_location_name_by_id($post->city))); ?> "><i class="fa fa-map-marker"></i> <?php echo get_location_name_by_id($post->city); ?> </a> <i class="fa fa-calendar"></i> <?php echo date('M d, Y', $post->create_time); ?> </div> <!-- Paragraph --> <p><?php echo truncate(strip_tags(get_post_data_by_lang($post, 'description')), 200, '', false); ?> </p> </div> <div class="clearfix"></div> </div> <?php } } ?> </div> <div class="clearfix"></div> <?php echo isset($pages) ? '<ul class="pagination">' . $pages . '</ul>' : '';
?> </td> <td data-title="<?php echo lang_key('image'); ?> " 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="<?php echo lang_key('title'); ?> " class="numeric"><?php echo get_post_data_by_lang($row, 'title'); ?> </td> <td data-title="<?php echo lang_key('category'); ?> " class="numeric"><?php echo get_category_title_by_id($row->category); ?> </td> <td data-title="<?php echo lang_key('price'); ?> " class="numeric"><?php